AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

WinEventHook example...
Goto page Previous  1, 2, 3, 4, 5
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
majkinetor



Joined: 24 May 2006
Posts: 3589
Location: Belgrade

PostPosted: Thu Jan 03, 2008 11:04 pm    Post subject: Reply with quote

You can get the pointer to your own window procedure already, with GetWindowLong. Then you can subclass the window to monitor its messages.

When third party processes are in question, you can't do this from AHK as dll is mandatory.
_________________
Back to top
View user's profile Send private message MSN Messenger
Mustang



Joined: 17 May 2007
Posts: 359
Location: England

PostPosted: Fri Jan 04, 2008 2:27 am    Post subject: Reply with quote

I guess keyboard and mouse event dont require a dll hook because they are not process specific?
What I was actually trying to do was capture WM_CREATE message from all processes on my system

I also guess that the GetModuleHandle was returning a handle to AHK?
So I was only hooking my AHK process rather than all system processes?

Please let me know if the above statements are anywhere along the right lines Embarassed

So if I do require a dll to hook all processes has there been any progress with regards this lately?
i.e. Successfully hooking them all without crashing Confused

Or is there another way I might monitor system wide messages?
Back to top
View user's profile Send private message
ABCza
Guest





PostPosted: Sat Jan 12, 2008 4:20 am    Post subject: Reply with quote

Any suggestion to hook the "Process Start" operation for determinate process and catch the command line?
Back to top
majkinetor



Joined: 24 May 2006
Posts: 3589
Location: Belgrade

PostPosted: Sat Jan 12, 2008 12:49 pm    Post subject: Reply with quote

Quote:
What I was actually trying to do was capture WM_CREATE message from all processes on my system

a-a

Quote:
So I was only hooking my AHK process rather than all system processes?

aha

Quote:
So if I do require a dll to hook all processes has there been any progress with regards this lately?

The only way to do it is to do the same as JGR, but using SetWIndowsHookEx. But, I wouldn't dare go into that direction....


Quote:
Or is there another way I might monitor system wide messages?

a-a

Eventualy, you could make a dll using AHK dotNet dynamicaly....
_________________
Back to top
View user's profile Send private message MSN Messenger
steliyan



Joined: 20 Apr 2007
Posts: 26

PostPosted: Mon May 12, 2008 9:14 am    Post subject: Reply with quote

Is it possible to hook the change of program's title bar?
Back to top
View user's profile Send private message
majkinetor!
Guest





PostPosted: Mon May 12, 2008 11:29 am    Post subject: Reply with quote

no
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 2472
Location: Australia, Qld

PostPosted: Mon May 12, 2008 12:18 pm    Post subject: Reply with quote

Yes it is.
Code:
#Persistent
; EVENT_OBJECT_NAMECHANGE = 0x800C
; WINEVENT_OUTOFCONTEXT = 0x0000
DllCall("SetWinEventHook", "uint", 0x800C, "uint", 0x800C
    , "uint", 0, "uint", RegisterCallback("ObjectNameChange")
    , "uint", 0, "uint", 0, "uint", 0)

ObjectNameChange(hWinEventHook, event, hwnd, idObject, idChild, thread, time)
{
    ; If the object is a window (OBJID_WINDOW),
    if (idObject = 0)
        ; is not hidden,
        && WinExist("ahk_id " hwnd)
        ; and is not a child window,
        && DllCall("GetAncestor","uint",hwnd,"uint",1) = DllCall("GetDesktopWindow")
    {   ; tooltip its new title.
        WinGetTitle, title, ahk_id %hwnd%
        ToolTip % hwnd " : " title
    }
}
Back to top
View user's profile Send private message
Guest






PostPosted: Wed May 14, 2008 12:05 am    Post subject: Reply with quote

Lexikos wrote:
Yes it is.
Code:
#Persistent
; EVENT_OBJECT_NAMECHANGE = 0x800C
; WINEVENT_OUTOFCONTEXT = 0x0000
DllCall("SetWinEventHook", "uint", 0x800C, "uint", 0x800C
    , "uint", 0, "uint", RegisterCallback("ObjectNameChange")
    , "uint", 0, "uint", 0, "uint", 0)

ObjectNameChange(hWinEventHook, event, hwnd, idObject, idChild, thread, time)
{
    ; If the object is a window (OBJID_WINDOW),
    if (idObject = 0)
        ; is not hidden,
        && WinExist("ahk_id " hwnd)
        ; and is not a child window,
        && DllCall("GetAncestor","uint",hwnd,"uint",1) = DllCall("GetDesktopWindow")
    {   ; tooltip its new title.
        WinGetTitle, title, ahk_id %hwnd%
        ToolTip % hwnd " : " title
    }
}
wokin?
Back to top
n-l-i-d
Guest





PostPosted: Wed May 14, 2008 9:10 am    Post subject: Reply with quote

Quote:
wokin?


Did you twy the scwipt?

Twy Googwe Seawch speciaw, ow if you stiww don't undewstand: hewe is a twanswation, uh-hah-hah-hah.

Wink
Back to top
Micahs



Joined: 01 Dec 2006
Posts: 328

PostPosted: Wed May 14, 2008 1:09 pm    Post subject: Reply with quote

I laughed so hard I snorted!
_________________
Back to top
View user's profile Send private message
majkinetor!
Guest





PostPosted: Wed May 14, 2008 4:08 pm    Post subject: Reply with quote

Lex wrote:
Yes it is.

I guess I missed that one....
Back to top
nonov
Guest





PostPosted: Sat May 31, 2008 11:47 am    Post subject: Reply with quote

can i hook sysmenu(alt+space) by this method?
i'm trying to make exactly same as Powermenu doing.
i've searched google day by day. what i found was i need a dll that does global hook for me.
the Powermenu has also a Powermenuhook.dll that i don't know exactly that how it is working.
can anyone please tell me if i'm on right way?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5
Page 5 of 5

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group