请教,如何将一个窗体放在桌面之上,但又不会 遮住其它窗口
如体
[解决办法]
看来楼主的QB是等不到了,呵呵,算了,代码贴出来
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
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 SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Public Sub PinToDesktop(FormToPin As Form)
Dim progman As Long
progman = FindWindow("progman", vbNullString)
SetParent FormToPin.hWnd, progman
End Sub
Public Sub UnPinFromDesktop(FormToUnPin As Form)
Dim lngExplorer As Long
lngExplorer = FindWindow("ExploreWClass", vbNullString)
SetParent FormToUnPin.hWnd, lngExplorer
End Sub