Hi Guys,
I'm using SDK controls for my program, and i'm changing 'CONTROL GET TEXT' with GetWindowText but instead of using ASCIIZ buffer, I want to use a dynamic string. Reason is that i'm not sure with the length in characters of the strings. Is there any problem with the code below?
I've tested it and so far it works without any problems.
Many Thanks
-Gary-
I'm using SDK controls for my program, and i'm changing 'CONTROL GET TEXT' with GetWindowText but instead of using ASCIIZ buffer, I want to use a dynamic string. Reason is that i'm not sure with the length in characters of the strings. Is there any problem with the code below?
Code:
txtLen=SendMessage(GETDLGITEM(hWnd, Ctrl_ID), %WM_GETTEXTLENGTH, 0, 0) LOCAL txtBuffer AS STRING txtBuffer=STRING$(txtLen + 1,$NUL) GetWindowText GETDLGITEM(hWnd, Ctrl_ID), BYVAL STRPTR(txtBuffer), txtLen + 1 txtBuffer=LEFT$(txtBuffer, txtLen)
Many Thanks

-Gary-
Comment