I'm using the function
Code: Select all
DllCall("GetMonitorInfo", "Ptr", monitorHandle, "Ptr", &monitorInfo)
I can get all of the monitor names using MonitorCount and MonitorName, but these don't give me the handles needed to use "GetMonitorInfo".
Code: Select all
DllCall("GetMonitorInfo", "Ptr", monitorHandle, "Ptr", &monitorInfo)
Code: Select all
DllCall("EnumDisplayMonitors", "Ptr", 0, "Ptr", 0, "Ptr", RegisterCallback("MonitorEnumProc"), "Ptr", 0)
MonitorEnumProc(hMon, hdc, lpRect, lParam) {
}
BLTN, A fellow Argonian (was it you?) got a nice explanation on SO, so bumped it here for the readers.LizardCobra wrote: ↑28 Feb 2020, 13:09Where is the handle to each monitor in your example? It looks like since this example passes null values for the first two parameters, it will pass a null handle to the call back function. So what then would the handles that I need get passed to?
Although I can't know how to interpret this, because it refers to the "hdcMonitor", but never defines what that is.
Is there supposed to be anything in the body of the function "MonitorEnumProc?" When/where are the arguments for that function defined?
That SO post was me, and the answer I received there was indeed very helpful. Thanks for linking!lmstearn wrote: ↑07 Feb 2021, 10:38BLTN, A fellow Argonian (was it you?) got a nice explanation on SO, so bumped it here for the readers.LizardCobra wrote: ↑28 Feb 2020, 13:09Where is the handle to each monitor in your example? It looks like since this example passes null values for the first two parameters, it will pass a null handle to the call back function. So what then would the handles that I need get passed to?
Although I can't know how to interpret this, because it refers to the "hdcMonitor", but never defines what that is.
Is there supposed to be anything in the body of the function "MonitorEnumProc?" When/where are the arguments for that function defined?