Results 1 to 4 of 4

Thread: Advanced Win32 API / Sub-classing

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    6

    Post

    A problem for all those who can use VB to the highest standard: as far as I can tell (as a native C++ user) there is no way I can sub-class a window in VB...

    I want to stick a tool-bar inside another window (I have the hWnd) that looks like a floating window inside that one. It cannot be moved outside its window, becomes covered by that application's menus, doesn't disappear when clicking on the host window, but isn't always on top, Intercepts any keyboard or mouse events that apply to it WITHOUT yielding focus from the host window.

    Can this be done in VB?


    JamesW

  2. #2
    Hyperactive Member Gimpster's Avatar
    Join Date
    Oct 1999
    Location
    Redmond, WA 98052
    Posts
    331

    Post

    Check out these other posts about subclassing, they should help you.
    http://www.vb-world.net/ubb/Forum1/HTML/009824.html
    http://www.vb-world.net/ubb/Forum1/HTML/004619.html

    ------------------
    Ryan

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    6

    Post

    Sorry, this isn't much use... I need to get a much deeper type of sub-classing where the window effectively owns my form...

    Any ideas?

  4. #4
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,176

    Post

    Sounds alot like an MDI Parent/Child Releationship to me...

    If you don't want to use an MDI Form, then use the SetParent API, ie.
    Code:
    Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
    
    Private Sub Form_Load()
        Form2.Show
        SetParent Form2.hWnd, hWnd
    End Sub
    ------------------
    Aaron Young
    Analyst Programmer
    aarony@redwingsoftware.com
    ajyoung@pressenter.com


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