Sign in to follow this  
Followers 0
FaridAgl

Monitoring the notify messages of a control in another process?

5 posts in this topic

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Doesn't work.

Here is an example of how I tried to do this:

#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 by D4RKON3

Share this post


Link to post
Share on other sites

@D4RKON3

My bad.

I have found links that should help you :

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0