Results 1 to 4 of 4

Thread: SetParent

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363

    Question

    Hi, I'm using SetParent to capture an app's window (App A) into another app's window (App B). I later want to release App A so another application can capture it, but when I use SetParent again from another app, App A won't leave. I even tried to force the desktop window to become its new parent (by using vbNull as the parent argument in SetParent) and that doesn't work either. What can I do??

    Thanks.

    [Edited by WadeD on 05-18-2000 at 02:10 PM]
    Wade

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    This should work just fine:
    Code:
    Private Sub Command1_Click()
        Dim lHwnd As Long
        Dim lDesktop As Long
        Dim lSomeOtherApp As Long
        
        lDesktop = GetDesktopWindow
        
        'Here I'm assuming that you already have a
        'window handle of that form and a window handle
        'of the application you want to assign your form to
        
        Call SetParent(lHwnd, lSomeOtherApp)
        
        
        'Do your stuff here
        
        'Now set your form to be a child to a desktop again
        Call SetParent(lHwnd, lDesktop)
    End Sub

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    And here's the fast way
    Code:
    Setparent yourwnd&, 0
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363

    Thumbs up

    Thanks guys.
    Wade

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