Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is _WINDOWHANDLE working properly?
#7
Yes, the wiki example for _SCREENEXISTS below does work correctly for me - it's sets the _TITLE ok.

Code: (Select All)
SCREEN 12
DO: _LIMIT 10: LOOP UNTIL _SCREENEXISTS
_TITLE "My Title"

That works.   But using_SCREENEXISTS that way in Terry's code fails for me here.  I still have to add a small _DELAY to work. 

EDIT:  Here's the edited code I'm testing, with the added SCREENEXISTS loop from the wiki.  API call isn't working. (I'm using the Windows 32-bit version, btw).  

Code: (Select All)
Type RECTAPI
    left As Long
    top As Long
    right As Long
    bottom As Long
End Type

Dim apirect As RECTAPI

Declare Dynamic Library "user32"
    'https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getclientrect
    Function GetClientRect% (ByVal hWnd As Long, lpRect As RECTAPI)
End Declare

Screen _NewImage(800, 600, 32) ' results the same no matter what size screen is used??

Do: _Limit 10: Loop Until _ScreenExists 'this doesn't do it for me
'_DELAY .25  'this does works for me

tmp = GetClientRect(_WindowHandle, apirect)

Print apirect.left
Print apirect.top
Print apirect.right
Print apirect.bottom

- Dav

Find my programs here in Dav's QB64 Corner
Reply


Messages In This Thread
RE: Is _WINDOWHANDLE working properly? - by Dav - 08-17-2023, 08:53 PM
RE: Is _WINDOWHANDLE working properly? - by Dav - 08-17-2023, 09:37 PM
RE: Is _WINDOWHANDLE working properly? - by Dav - 08-17-2023, 10:09 PM
RE: Is _WINDOWHANDLE working properly? - by Dav - 08-18-2023, 01:14 PM
RE: Is _WINDOWHANDLE working properly? - by Dav - 08-18-2023, 03:29 PM
RE: Is _WINDOWHANDLE working properly? - by Dav - 08-18-2023, 04:47 PM



Users browsing this thread: 4 Guest(s)