Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c
Original file line number Diff line number Diff line change
Expand Up @@ -2510,6 +2510,26 @@ JNIEXPORT jint JNICALL OS_NATIVE(GetDpiForMonitor)
}
#endif

#ifndef NO_GetDpiForWindow
JNIEXPORT jint JNICALL OS_NATIVE(GetDpiForWindow)
(JNIEnv *env, jclass that, jlong arg0)
{
jint rc = 0;
OS_NATIVE_ENTER(env, that, GetDpiForWindow_FUNC);
/*
rc = (jint)GetDpiForWindow(arg0);
*/
{
OS_LOAD_FUNCTION(fp, GetDpiForWindow)
if (fp) {
rc = (jint)((jint (CALLING_CONVENTION*)(jlong))fp)(arg0);
}
}
OS_NATIVE_EXIT(env, that, GetDpiForWindow_FUNC);
return rc;
}
#endif

#ifndef NO_GetFocus
JNIEXPORT jlong JNICALL OS_NATIVE(GetFocus)
(JNIEnv *env, jclass that)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

/* Libraries for dynamic loaded functions */
#define GetDpiForMonitor_LIB "shcore.dll"
#define GetDpiForWindow_LIB "user32.dll"
#define RtlGetVersion_LIB "ntdll.dll"
#define OpenThemeDataForDpi_LIB "uxtheme.dll"
#define GetSystemMetricsForDpi_LIB "user32.dll"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ typedef enum {
GetDlgItem_FUNC,
GetDoubleClickTime_FUNC,
GetDpiForMonitor_FUNC,
GetDpiForWindow_FUNC,
GetFocus_FUNC,
GetFontLanguageInfo_FUNC,
GetForegroundWindow_FUNC,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2814,6 +2814,8 @@ public static int HRESULT_FROM_WIN32(int x) {
public static final native int GetDoubleClickTime ();
/** @method flags=dynamic */
public static final native int GetDpiForMonitor (long hmonitor, int dpiType, int [] dpiX, int [] dpiY);
/** @method flags=dynamic */
public static final native int GetDpiForWindow (long hWnd);
public static final native long GetFocus ();
/** @param hdc cast=(HDC) */
public static final native int GetFontLanguageInfo (long hdc);
Expand Down
Loading