.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Programming
General Programming Help others and get yourself helped here!

Reply
 
Thread Tools
hook on window events? (not self)
Old
  (#1)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default hook on window events? (not self) - 02-10-2004

Hi

I need to know how to hook on certain window events, but not for a hWnd of my program, for another window on the desktop. Let's say, for example, that I want my application to know when I click on the minimize button of this IE window (or any other window).

I know this is possible. I have a little app running here that does the same thing for Outlook Express, it hides OE in the systray when I click minimize, and fires it up again when I click on its icon in the systray. Unfortunately I don't have the source code for it. And I need to do just that in my program.

I know how to use EnumWindows() to find the handle of a particular window on the desktop, now I just want to know how to have a callback function called when a certain event occurs in this window. Polling is out of question

Any ideas ?



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: hook on window events? (not self)
Old
  (#2)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: hook on window events? (not self) - 02-10-2004

You can use SetWindowsHookEx to load a dll into the target process, from the dll you export a new window procedure where you can check for windows messages.

I'll see if I can find a code sample somewhere, if not I'll write one myself.

Added:
Here's one...
http://www.codeproject.com/system/Mi...ndowToTray.asp

Last edited by Lazy; 02-10-2004 at 19:15..
  
Reply With Quote
Re: hook on window events? (not self)
Old
  (#3)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: hook on window events? (not self) - 02-10-2004

Thanks a lot, that was just what I needed



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com