' 先找到桌面句柄,然后把自己程序的窗口设成桌面的子窗口就可以了。
' 下面的程序在Windows XP + VB6下调试通过。
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Dim Handle As Long ' 窗口句柄
Private Sub Form_Load()
Handle = FindWindow("Progman", "Program Manager") ' 获得窗口句柄
SetParent Me.hwnd, Handle
End Sub
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Sub Form_Load()