I need to get the entire actual desktop size, regardless of which monitor is set as the main one.
So I tried adapting this code by Chi -> viewtopic.php?p=507541#p507541
And here's what I'm testing:
Code: Select all
; Get full real desktop size of all monitors combined.
Global desktop_size_x,desktop_size_y,desktop_size_w,desktop_size_h
Procedure MonitorEnumProc(hMonitor,hdcMonitor,lprcMonitor,dwData) ; http://forums.purebasic.com/english/viewtopic.php?p=507541
*monRect.RECT=lprcMonitor
x=*monRect\left : If x<desktop_size_x : desktop_size_x=x : EndIf
y=*monRect\top : If y<desktop_size_y : desktop_size_y=y : EndIf
w=*monRect\right : If w>desktop_size_w : desktop_size_w=w : EndIf
h=*monRect\bottom : If h>desktop_size_h : desktop_size_h=h : EndIf
ProcedureReturn #True
EndProcedure
Procedure GetDesktopSize()
desktop_size_x=0
desktop_size_y=0
desktop_size_w=0
desktop_size_h=0
EnumDisplayMonitors_(0,0,@MonitorEnumProc(),0)
EndProcedure
GetDesktopSize()
OpenWindow(0,desktop_size_x+10,desktop_size_y+10,desktop_size_w-20,desktop_size_h-20,"",#PB_Window_BorderLess)
SetWindowColor(0,#Yellow)
UpdateWindow_(WindowID(0))
Repeat : WaitWindowEvent(1) : Until GetAsyncKeyState_(#VK_ESCAPE) & $8000 <> 0

Screenshot for reference:
