Results 1 to 12 of 12

Thread: Subclassing ANY window

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 1999
    Location
    Prague, Czech Republic
    Posts
    350

    Unhappy

    In almost every samples of subclassing solves how to subclass your own application. But I am not able to subclass any window (through handle) and I don't know where is the problem. Can somebody help me to subclass another window (like Spy++)?

  2. #2
    Guest
    I dont have the code anymore, but I once used an example found on here(vb-world) and modified it to catch all clicks for internet explorer.

    it worked fine, you just replace the hwnd of your form, with the hwnd of the window you want to subclass.

  3. #3
    Guest
    I tried it once and it didn't work
    In order to Subclass windows that aren't yours you must use a callback function that is located in an external DLL.
    You can't create this kind of DLLs in VB though.

  4. #4
    Guest
    Make sure that it's a Standard DLL, not an ActiveX DLL. To create standard DLL's, use Visual C++ because VB can only create OLE DLL's.

  5. #5
    Guest
    Originally posted by Sc0rp
    I tried it once and it didn't work
    In order to Subclass windows that aren't yours you must use a callback function that is located in an external DLL.
    You can't create this kind of DLLs in VB though.
    damn, must have been dreaming then...
    I hate that... dreams seem so real.

  6. #6
    Guest

    Question

    denniswrenn: ???

  7. #7
    Guest
    Dennis: Are you sure you didn't use a DLL for it?

  8. #8
    Guest
    oh yeah, I think I used a DLL......
    I dont have it anymore ... it was on my HDD before I reformatted....

  9. #9
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516

    Wink Call me cynical, but

    Ain't that convenient?
    Courgettes.

  10. #10
    Guest
    Is there a way to Subclass windows using CopyMemory in some way?
    I mean SetWindowLong sets the value of the proc in the memory, doesn't it?

  11. #11
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    With SetWindowLong you provide a pointer to the function (this is what AddressOf gets). I think using FindWindow and SetWindowLong should be able to get it sorted. On the other hand, you could set a global hook, in which case it's easier to use a DLL.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 1999
    Location
    Prague, Czech Republic
    Posts
    350
    And Windows doesn't have a DLL file which could call my function?

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