Re: GetWindowText - Windows API
From: Gregory Adam (GregoryAdam_at_PleaseReplyViaNewsGroup.com)
Date: 04/17/04
- Next message: Sarah: "Re: GetWindowText - Windows API"
- Previous message: Maurizio: "RE: proper command help"
- In reply to: Sarah: "GetWindowText - Windows API"
- Next in thread: Sarah: "Re: GetWindowText - Windows API"
- Reply: Sarah: "Re: GetWindowText - Windows API"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 17 Apr 2004 12:20:59 +0200
hi Sarah,
GetWindowText has a third parameter, ie the length of the buffer where it
can put the text
declare integer GetWindowText in User32.dll ;
integer hnwd, string @lpstring, integer buflen
declare integer FindWindow in win32api ;
string @lpClassName, string @WindowName
local hwnd
hwnd = FindWindow( null, _screen.caption )
local buf, nchars
buf = space(1024)
nchars = GetWindowText(hwnd, @buf, len(buf))
do case
case empty(nchars)
?? 'error'
otherwise
buf = left(buf, nchars)
?buf
endcase
Gregory
__________________________________________________
"Sarah" <anonymous@discussions.microsoft.com> wrote in message
news:45E16284-2487-4D15-B82A-4AF6F996BCB9@microsoft.com...
> Hi All,
>
> I want to use the GetWindowText, Windows API in vfp. The following code is
giving error
>
> DECLARE INTEGER GetWindowText IN win32api;
> HWND iwinhdl,;
> STRING cwindow_title
> GetWindowText(mActiveWndHdl,mGetWinTxt)
>
> The following is the error message
> Too many arguments.
> Line of code with error: GetWindowText(mActiveWndHdl,mGetWinTxt)
> Message1: ISWINDEX
>
> Can't make out why the error is flaged!
>
>
>
- Next message: Sarah: "Re: GetWindowText - Windows API"
- Previous message: Maurizio: "RE: proper command help"
- In reply to: Sarah: "GetWindowText - Windows API"
- Next in thread: Sarah: "Re: GetWindowText - Windows API"
- Reply: Sarah: "Re: GetWindowText - Windows API"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|