瀏覽代碼

Added some DPI related functions. Fixes #18.

woollybah 6 年之前
父節點
當前提交
02d5bf7da5
共有 3 個文件被更改,包括 16 次插入0 次删除
  1. 14 0
      win32.mod/shcore.bmx
  2. 1 0
      win32.mod/user32.bmx
  3. 1 0
      win32.mod/win32.bmx

+ 14 - 0
win32.mod/shcore.bmx

@@ -0,0 +1,14 @@
+SuperStrict
+
+Import "user32.bmx"
+
+Local shcoreLib:Byte Ptr = LoadLibraryA( "Shcore.dll" )
+
+Global GetDpiForMonitor:Int(monitor:Byte Ptr, dpiType:Int, dpix:UInt Var, dpiy:UInt Var)"Win32"
+
+If shcoreLib Then
+	GetDpiForMonitor = GetProcAddress( shcoreLib, "GetDpiForMonitor" )
+End If
+
+
+

+ 1 - 0
win32.mod/user32.bmx

@@ -1263,6 +1263,7 @@ Function GetClassNameW:Int( hwnd:Byte Ptr, dst:Short Ptr, maxlen:Int)="int __std
 
 Function MessageBoxW:Int(hWnd:Byte Ptr, lpText:Short Ptr, lpCaption:Short Ptr, uType:UInt)="int __stdcall MessageBoxW(HWND ,LPCWSTR ,LPCWSTR ,UINT )!"
 
+Function MonitorFromWindow:Byte Ptr(hwnd:Byte Ptr, flags:Int)="HMONITOR __stdcall MonitorFromWindow(HWND, DWORD)!"
 'shellapi
 
 Function DragAcceptFiles(hWnd:Byte Ptr,fAccept)="void DragAcceptFiles(HWND ,BBINT )!"

+ 1 - 0
win32.mod/win32.bmx

@@ -46,6 +46,7 @@ Import "com.bmx"
 Import "commdlg.bmx"
 Import "commctrl.bmx"
 Import "richedit.bmx"
+Import "shcore.bmx"
 
 Rem
 bbdoc: Locks the left/right Windows keys, preventing them from opening the Windows menu.