Results 1 to 4 of 4

Thread: Subclassing [RESOLVED]

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2002
    Location
    midewest u.s.
    Posts
    275

    Resolved Subclassing [RESOLVED]

    Hello everyone.

    I have heard quite a bit about subclassing, but never have used it and dont really know what it is.

    My belief is that when you want to watch something on another program you need to subclass it in your application to check it for changes, or what not.

    Could someone please give me a description of what it is (if I am wrong) and possibly an example of how I would subclass something? I would eventually like to subclass some chat applications like irc (if I was semi-right about subclassing) to flash/open/beep or anything when someone types your name

    Any help would be appreciated and thank you
    Last edited by Tool; Feb 4th, 2005 at 09:12 PM.

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

    Re: Subclassing

    I'm sure that by posting this question you have already searched the forums for your answers.

    Subclassing refers to the process of "hooking" into the window procedure for a window (in VB a window is called a form or a control). The Window Procedure is where Windows messages are handled. By intercepting these messages you can change the way the window behaves by discarding the message or changing it.

    Another closely related process is called hooking. Hooking puts the intercept point a little further upstream in what is sometimes referred to as the message pump. This is a procedure that takes messages from the message queue and sends them to the Window procedure. There are several types of hooks, in some of them you can discard the message, in others you can change the message and in some you can only monitor the message.

    You cannot Subclass a process outside the process of your program, but you can hook it. See my post in the code bank for code written to do this.

    A book I would like to recommend on the subject is Subclassing & Hooking with Visual Basic. Check it out.

    ...

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2002
    Location
    midewest u.s.
    Posts
    275

    Re: Subclassing

    Thank you very much on all the information in your post. I do understand the message loop/pump idea. I just made my first window in c++ with a friends help so that is not all too foreign. I have been looking for good books to get (I love learning, but hate books that start too slow). I have a bunch that I cant get past page 100 because it bores me. I have been looking for some good books on API, I will surely get that one soon and hopefully understand how it all works, and how to use it. Thanks again

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Subclassing [RESOLVED]

    I know you resolved your thread but I just wanted to give you a link to my Sub-Classing example since it will help
    you to understand the basics of subclassing in your own application first. Maybe it will help you with the other advanced examples.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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