-
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]
-
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
-
And here's the fast way
Code:
Setparent yourwnd&, 0
-