VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Example on changing child and parent window at runtime using API calls

by Muhammad Asif (3 Submissions)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 26th June 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Example on changing child and parent window at runtime using API calls

API Declarations


Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long


Rate Example on changing child and parent window at runtime using API calls



'//

Private Sub Form_Load()
    'Get the taskbar's window handle
    tWnd = FindWindow("Shell_TrayWnd", vbNullString)
    'Get the start-button's window handle
    bWnd = FindWindowEx(tWnd, ByVal 0&, "BUTTON", vbNullString)

'changes start button parent
SetParent bWnd, Me.hwnd

End Sub


Private Sub Form_Unload(Cancel As Integer)

'reset parent
SetParent bWnd, tWnd

End Sub





Download this snippet    Add to My Saved Code

Example on changing child and parent window at runtime using API calls Comments

No comments have been posted about Example on changing child and parent window at runtime using API calls. Why not be the first to post a comment about Example on changing child and parent window at runtime using API calls.

Post your comment

Subject:
Message:
0/1000 characters