Little task with hooking/subclassing
I'll code it myself because i have experience of coding in vb but i left vb in 2003 or 2002 so lot of things are forgotten.
So please help me now. :)
There is a small software installed on my pc for which i have no support now.It has some errors so it ask for debugging when it gets error while executing and if i click NO then it keeps on working.
It is really a headache for me to click NO various times in a day.
I want to write small vb program so that it can check this application's message box and click NO so that i can avoid this annoying situation.
Is it possible ? ( i think yes thru hooking or subcalssing which i have forgotten now).
Please help me about solving this problem
Thanks a lot for you coming help. :)
Re: Little task with hooking/subclassing
Perhars you can find something in this thread by rm_03.
Re: Little task with hooking/subclassing
I need little more help :)
Now i know i want to hook message box which appears randomly.
but one problem that application changes their caption constantly.
so how i would give value to
Const ParentCaption variable ?
another helpful thread http://vbforums.com/showthread.php?t=322261
yes i need little more help. :)
Re: Little task with hooking/subclassing
Const ParentCaption variable? Const and variable? That's a bit confusing :confused: Clarify.
Re: Little task with hooking/subclassing
slice,
I don't think you want to do any hooking.
I have run into this situation a few times and what I do is this:
1. In a loop or timer use findWindow to see when the message box is on the screen
2. use FindWindowEx to get the handle of the "No" button
3. Use sendMessage to send a click to the "No" button
Re: Little task with hooking/subclassing
There is a freeware scripting langauge called AutoIt that can pull this off with a 3 line script, no API declarations needed, that will compile to exe
Re: Little task with hooking/subclassing
way to go, triggernum. lead people away from vb..*sarcasm*
Re: Little task with hooking/subclassing
Use any tactic that works, and take the path of least resistance, [Paste overused metaphor here].. AutoIt drastically simplifies most of what I see ppl looking to subclass controls in other apps seeking..
Don't get me wrong, a real programming language is far more diverse, but with that diversity comes complexity..
Maybe I can save face by mentioning that you can have the best of both worlds by using AutoIt's activex dll in VB etc?..:)
Re: Little task with hooking/subclassing
well that works :P
if they can make machine code and asm* both work in vb, im sure the scripting could be a nice addition as well.
*(asm via 3rd party addin)
Re: Little task with hooking/subclassing
Love the Inline ASM! Takes me back to QBasic..:)
If anybody is curious, http://www.persistentrealities.com/v...0&item=5&t=asm
Re: Little task with hooking/subclassing
Quote:
Originally Posted by moeur
slice,
I don't think you want to do any hooking.
I have run into this situation a few times and what I do is this:
1. In a loop or timer use findWindow to see when the message box is on the screen
2. use FindWindowEx to get the handle of the "No" button
3. Use sendMessage to send a click to the "No" button
If you have already run into this situation then i am lucky :)
could you please post some code ?