- Christopher Craft
- PowerBuilder
- Saturday, 22 January 2022 02:06 AM UTC
I am trying to use the Windows API GetMonitorInfo but my returned structure seems to always be NULL. I followed this ( https://rgagnon.com/pbdetails/powerbuilder-display-on-the-second-monitor.html ) as my starting point but it is not working. The one odd thing is his example has the structure set with 'rect' as the type but that is not a valid entry so I used 'rectangle'. I also changed the declarations multiple times but still nothing.
function Long MonitorFromWindow (Long hwnd, Long dwFlags) LIBRARY "user32.dll"
function Long GetMonitorInfo (long hMonitor, ref str_monitorinfo moninfo) LIBRARY "user32.dll" Alias for "GetMonitorInfoW"
Has anyone ever used this? What I am trying to do is get the monitor handle of the frame so I can determine if this monitor is still valid the next time they launch the application. If it is then I restore the position.
Thanks,
Chris Craft
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.