Results 1 to 11 of 11

Thread: Little task with hooking/subclassing

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Location
    Osaka
    Posts
    200

    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.

  2. #2

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Location
    Osaka
    Posts
    200

    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.

  4. #4
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Little task with hooking/subclassing

    Const ParentCaption variable? Const and variable? That's a bit confusing Clarify.

  5. #5
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    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

  6. #6
    Hyperactive Member
    Join Date
    Aug 2006
    Posts
    367

    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

  7. #7
    Hyperactive Member
    Join Date
    Aug 2006
    Location
    TeXaS
    Posts
    497

    Re: Little task with hooking/subclassing

    way to go, triggernum. lead people away from vb..*sarcasm*

  8. #8
    Hyperactive Member
    Join Date
    Aug 2006
    Posts
    367

    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?..

  9. #9
    Hyperactive Member
    Join Date
    Aug 2006
    Location
    TeXaS
    Posts
    497

    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)

  10. #10
    Hyperactive Member
    Join Date
    Aug 2006
    Posts
    367

    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

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Location
    Osaka
    Posts
    200

    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 ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width