|
-
Dec 19th, 2001, 05:25 PM
#1
uncapture a window
i captured a window with setparent into my mdi form. How do i uncapture this window (e.g. remove this window from my mdi form without closing it)?
-
Dec 19th, 2001, 05:36 PM
#2
Use SetParent to 'give' it to another form. You can create a small
.Visible = False form to hold it while you don't want to use it. OR you can park it somewhere else.
-
Dec 19th, 2001, 05:48 PM
#3
the thing is, my program is suppose to capture a a program on startup (i got that part) and uncapture it at end.
So what parent should i set the program to?
-
Dec 19th, 2001, 07:56 PM
#4
Destroy the Window in your Form Unload event
VB Code:
Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function IsWindowEnabled Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Sub Form_Load()
'KPD-Team 2001
'URL: [url]http://www.allapi.net/[/url]
Dim bl As Boolean
'Is the window enabled?
bl = IsWindowEnabled(Me.hwnd)
MsgBox "Is the form enabled? " + Str$(bl)
'Move the window
MoveWindow Me.hwnd, 0, 0, 200, 200, 1
'Show the window
Me.Show
'Wait 5 seconds
t = Timer
Do
'Show the remaining time in the form's caption
Me.Caption = 5 - Int(Timer - t)
DoEvents
Loop Until Timer > t + 5
'Destroy the window
DestroyWindow Me.hwnd
End Sub
-
Dec 20th, 2001, 01:44 AM
#5
but i want to keep that captured window alive when i close my program. it usally becomes invisible when i close my program.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|