GetWindowTextW with Pointers
Sven Rega <[email protected]> Tue, 23 Aug 2005 23:52:10 -0400
| Newsgroups | gmane.comp.windows.devel.jawin |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
Hy,
i've not understand, how to use jawin with pointers.
The GetWindowText(Win32 API) funktion needs at "LPTSTR lpString" a pointer
to string buffer (returns the name of the window in this string).I've tried
some possiblities with no solution. Always getting a Exception.
I'm not clear enough about the syntax of the instruction string, too.
findWin2 = new FuncPtr("USER32.DLL", "GetWindowTextW");
NakedByteStream nbs = new NakedByteStream();
LittleEndianOutputStream leos = new LittleEndianOutputStream(nbs);
leos.writeInt(whnd);
leos.writeInt(255);
res=findWin2.invoke("Ip4I:I:G",12,nbs,new Object
[255],ReturnFlags.CHECK_FALSE);
-->THE WIN32 API DEFINITION
int GetWindowText(
HWND hWnd,
LPTSTR lpString,
int nMaxCount
);
Maybe someone has an idea, cause after several hours i gived up :-(