Results 1 to 4 of 4

Thread: Safe subclassing - no more crash - d/l the simple codes here

  1. #1

    Thread Starter
    Fanatic Member jian2587's Avatar
    Join Date
    Aug 2000
    Location
    I bet u need a fusion powered shuttle to reach my place...
    Posts
    963

    Safe subclassing - no more crash - d/l the simple codes here

    I've written a simple ActiveX DLL for use with subclassing.
    If you've always crashed ur machine for forgetting to unsubclass
    the window, this simple DLL will help you around on that.

    VB Code:
    1. 'General Declarations
    2. Dim WithEvents myHook As WindowHook.Hook
    3.  
    4. 'In a procedure
    5. Set myHook = New WindowHook.Hook
    6. myHook.CallDefaultProc = True 'Let default procedure to process
    7.                                                   'the messages, always set to True
    8. myHook.HookWindow Me.hWnd
    9.  
    10. 'And there's only one event:
    11. Private Sub myHook_WindowMessage(hwnd As Long, uMsg As Long, wParam As Long, lParam As Long)
    12. 'Your codes here
    13. End Sub

    well, not as good as Merrion's, but this serve as a primitive
    but easy subclassing method that's crash prone(due to its DLL
    nature) and can be instatiated - which means you can subclass
    a lot of stuffs. If you code it yourself, you've to make a lot of
    module window message handling procedures, and that's very
    undynamic.
    Attached Files Attached Files
    ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
    Programming is fun, but only if you're not on a tight deadline
    So I consider all those working engineers sad people

    VB FTP class
    3 page PHP crash course
    Crash Course on DX9 Managed with VB.NET covering basics till terrain creation

  2. #2

    Thread Starter
    Fanatic Member jian2587's Avatar
    Join Date
    Aug 2000
    Location
    I bet u need a fusion powered shuttle to reach my place...
    Posts
    963
    Oh...sorry.
    Forgot to submit the module along.
    Here's the complete one. Download this one instead.
    It has an example project mouseleave.vbp to show how
    windowhook works.
    Attached Files Attached Files
    ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
    Programming is fun, but only if you're not on a tight deadline
    So I consider all those working engineers sad people

    VB FTP class
    3 page PHP crash course
    Crash Course on DX9 Managed with VB.NET covering basics till terrain creation

  3. #3
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    subclassing method that's crash prone
    I presume you mean not crash prone?
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  4. #4

    Thread Starter
    Fanatic Member jian2587's Avatar
    Join Date
    Aug 2000
    Location
    I bet u need a fusion powered shuttle to reach my place...
    Posts
    963
    stupid me
    I mean crash proof

    got twisted wif dis words
    ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
    Programming is fun, but only if you're not on a tight deadline
    So I consider all those working engineers sad people

    VB FTP class
    3 page PHP crash course
    Crash Course on DX9 Managed with VB.NET covering basics till terrain creation

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