covaks Posted April 21, 2007 Posted April 21, 2007 If an external program sends a WM_SETTEXT message to my GUI, how do I get the actual text that it is trying to set? $lparam in the code below is a hex value, I want to msgbox the actual text. So, if an external C program has the following line: SendMessage(hwnd, WM_SETTEXT,NULL,(LPARAM)"foo"); I want my message box to say "foo", instead of some hex value. Is that possible? GUIRegisterMsg($WM_SETTEXT,"MyFunc") Func MyFunc($hwndGui, $msgid, $wparam, $lparam) msgbox(1,"",$lparam) return 1 EndFunc
piccaso Posted April 21, 2007 Posted April 21, 2007 where you able to catch the WM_SETTEXT message? if yes then lparam is a pointer you can use DllStruct stuff to read it there is a function inside sqlite.au3 (should be in your include dir) called __SQLite_szStringRead which shows how to read a zString CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
covaks Posted April 21, 2007 Author Posted April 21, 2007 Thank you very much, that worked. :-) SendMessage(hwnd, WM_SETTEXT,NULL,(LPARAM)"Super Duper"); From a C program will now cause my AutoIT script to pop up a message box with the text "Super Duper". Now I have a way to pass messages back and forth between the two programs. GUIRegisterMsg($WM_SETTEXT,"MyFunc") Func MyFunc($hwndGui, $msgid, $wparam, $lparam) $text = DllStructCreate("ubyte[15]",$lparam) msgbox(1,"",DllStructGetData($text,1)) return 1 EndFunc
CoDEmanX Posted February 16, 2008 Posted February 16, 2008 So, if an external C program has the following line:SendMessage(hwnd, WM_SETTEXT,NULL,(LPARAM)"foo");I want to send the WM_SETTEXT message from my autoit script to an external application's controls (ThunderRT6). How to do that?
Recommended Posts