FaridAgl Posted September 2, 2012 Share Posted September 2, 2012 Well, the title almost says everything.I have a target application that has a ListView on its GUI, I'm trying to hook the ListView's notify messages with my AutoIt script. The Notification that I want to hook is LVN_INSERTITEM, I'm want to get the text of every item that get added to the ListView.If it was on my own GUI, it was kindly easy to achieve the goal with GUIRegisterMsg(), but I have no idea about hooking another process's notification from my AutoIt process.Any help is greatly welcomed, some idea maybe. http://faridaghili.ir Link to comment Share on other sites More sharing options...
FireFox Posted September 2, 2012 Share Posted September 2, 2012 (edited) Hi, It's a good question, try to hook the messages by setting your GUI as a child of your target wnd with the function _WinAPI_SetParent; then do as if the listview was on your GUI. Br, FireFox. Edited September 2, 2012 by FireFox Link to comment Share on other sites More sharing options...
FaridAgl Posted September 2, 2012 Author Share Posted September 2, 2012 Actually it's a good idea, so tricky, I'm going to give it a try right now. http://faridaghili.ir Link to comment Share on other sites More sharing options...
FaridAgl Posted September 2, 2012 Author Share Posted September 2, 2012 (edited) Doesn't work. Here is an example of how I tried to do this: expandcollapse popup#include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $hParent = WinGetHandle('[Class:Notepad]') If @error Then MsgBox(16, '', 'Error 1') Exit EndIf Global $hChild = GUICreate('Child Window', 450, 300) GUICtrlCreateButton('', 10, 10, 100, 23) GUISetState() _WinAPI_SetParent($hChild, $hParent) If @error Then MsgBox(16, '', 'Error 2') Exit EndIf If (GUIRegisterMsg($WM_NOTIFY, 'WM_NOTIFY') == 0) Then MsgBox(16, '', 'Error 3') Exit EndIf While (True) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) ConsoleWrite('1') Return $GUI_RUNDEFMSG EndFunc Edited September 2, 2012 by D4RKON3 http://faridaghili.ir Link to comment Share on other sites More sharing options...
FireFox Posted September 2, 2012 Share Posted September 2, 2012 @D4RKON3My bad.I have found links that should help you :Br, FireFox. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now