getsystemmetrics

SystemParametersInfoA with SPI_GETMOUSE returns 0's

本秂侑毒 提交于 2020-06-01 07:36:05
问题 Go to the answer of the question I'm trying to get my mouse speed, but when I call the function SystemParametersInfoA with parameter SPI_GETMOUSE it sets the target array to {0,0,0} which I think its not supposed to happen. Example code: int IntArr[3]; SystemParametersInfoA(SPI_GETMOUSE, 0, &IntArr, 0); I tried changing my mouse sensitivity (from the control panel) but that didn't work either. Does this function is supposed to return those zeros or thats my fault? 回答1: The documentation says:

GetSystemMetrics and TScreen returns wrong value

耗尽温柔 提交于 2019-12-12 15:23:54
问题 I am using Delphi XE5. I think i have a problem with my laptop. After a while, it returns wrong value to Screen.Width and GetSystemMetrics(SM_CXSCREEN) (same for Height). My OS is Windows 7 64-bit. My laptop's screen res is 1920x1080 (1080p) however my app says it is 1280x720 (720p). I don't think there is a DPI problem as the problem goes when i reboot and starts after a while. Also Compatibality settings are off. Did anyone have this problem before? Or do you know a solution? I have also

find size of external monitor in excel vba

牧云@^-^@ 提交于 2019-12-10 10:33:44
问题 To find the size of the monitor, I've been using: Declare Function GetSystemMetrics32 Lib "user32" Alias "GetSystemMetrics" (ByVal Index As Long) As Long and then: Function getMonitorSize() monitorHeight = GetSystemMetrics32(1) monitorWidth = GetSystemMetrics32(0) End Function This works fine for the main monitor, but how do I find the size of an external monitor? 回答1: EnumDisplayDevices tells you something about a monitor with a certain index. You can increment the index from 0 to whatever,

find size of external monitor in excel vba

房东的猫 提交于 2019-12-06 12:11:04
To find the size of the monitor, I've been using: Declare Function GetSystemMetrics32 Lib "user32" Alias "GetSystemMetrics" (ByVal Index As Long) As Long and then: Function getMonitorSize() monitorHeight = GetSystemMetrics32(1) monitorWidth = GetSystemMetrics32(0) End Function This works fine for the main monitor, but how do I find the size of an external monitor? EnumDisplayDevices tells you something about a monitor with a certain index. You can increment the index from 0 to whatever, until the function returns 0, which means there's no monitor with that index. Then you call

GetSystemMetrics() returns different results for .NET 4.5 & .NET 4.0

房东的猫 提交于 2019-11-28 12:18:31
During a .NET 4.0 -> .NET 4.5 application migration process I've discovered an extremely strange behavior. I've been able to track this issue down to this short code snippet: class Program { [System.Runtime.InteropServices.DllImport("user32.dll")] public static extern int GetSystemMetrics(int nIndex); static void Main(string[] args) { const int CXFRAME = 0x20; const int CYFRAME = 0x21; var dx = GetSystemMetrics(CXFRAME); var dy = GetSystemMetrics(CYFRAME); Console.WriteLine("{0}x{1}", dx, dy); Console.ReadKey(); } } When compiled with Target Framework = 4.0 (and also 2.0, 3.0, 3.5), it outputs

GetSystemMetrics() returns different results for .NET 4.5 & .NET 4.0

和自甴很熟 提交于 2019-11-26 23:31:14
问题 During a .NET 4.0 -> .NET 4.5 application migration process I've discovered an extremely strange behavior. I've been able to track this issue down to this short code snippet: class Program { [System.Runtime.InteropServices.DllImport("user32.dll")] public static extern int GetSystemMetrics(int nIndex); static void Main(string[] args) { const int CXFRAME = 0x20; const int CYFRAME = 0x21; var dx = GetSystemMetrics(CXFRAME); var dy = GetSystemMetrics(CYFRAME); Console.WriteLine("{0}x{1}", dx, dy)