首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

请问,怎么将一个窗体放在桌面之上,但又不会 遮住其它窗口

2012-03-13 
请教,如何将一个窗体放在桌面之上,但又不会 遮住其它窗口如体[解决办法]看来楼主的QB是等不到了,呵呵,算了

请教,如何将一个窗体放在桌面之上,但又不会 遮住其它窗口
如体

[解决办法]
看来楼主的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

热点排行