Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GetWindowTextW - can you get it to work?
#3
A working example, plus a few changes which you'll want to make use of:

Code: (Select All)
DECLARE DYNAMIC LIBRARY "user32"
FUNCTION GetWindowTextA (BYVAL hWnd AS _OFFSET, lpString AS STRING, BYVAL nMaxCount AS INTEGER)
FUNCTION GetWindowTextW (BYVAL hWnd AS _OFFSET, lpString AS STRING, BYVAL nMaxCount AS INTEGER)
END DECLARE

DIM Dummy AS INTEGER
DIM n AS STRING * 255

_TITLE "This is a test"
Dummy = GetWindowTextA(_WINDOWHANDLE, n, 255)
PRINT n
Dummy = GetWindowTextW(_WINDOWHANDLE, n, 255)
PRINT n
_DELAY .5
Dummy = GetWindowTextA(_WINDOWHANDLE, n, 255)
PRINT n
Dummy = GetWindowTextW(_WINDOWHANDLE, n, 255)
PRINT n


Note that since this is a Windows call, you'll need a delay after the _TITLE to give the OS time to update things to return the proper title for you.

Also note that I'm passing an _OFFSET and not an _INTEGER64.

And you can see the difference in A and W function calls here.

Also notice the STRING * 255 here. Wink
Reply


Messages In This Thread
RE: GetWindowTextW - can you get it to work? - by SMcNeill - 06-07-2024, 07:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Does _base64decode$ and _inflate$ work when used together? Dav 5 540 11-21-2025, 06:59 AM
Last Post: Pete
  CAN someone please get the graphics in this to work? Dragoncat 3 662 05-07-2025, 12:17 PM
Last Post: bplus
  Even robocopy doesn't work krovit 3 968 08-15-2024, 11:36 AM
Last Post: mdijkens
  Does _MapTriangle work in a user defined Window? bplus 12 2,292 02-16-2024, 01:40 AM
Last Post: bplus
Bug I want it to work so bad.... NasaCow 39 9,046 11-30-2022, 10:30 PM
Last Post: bplus

Forum Jump:


Users browsing this thread: 1 Guest(s)