请在声明区中放入以下声明
ConstGWL_EXSTYLE=(-20)
ConstWS_EX_TRANSPARENT=&H20&
ConstSWP_FRAMECHANGED=&H20
ConstSWP_NOMOVE=&H2
ConstSWP_NOSIZE=&H1
ConstSWP_SHOWME=SWP_FRAMECHANGEDOrSWP_NOMOVEOrSWP_NOSIZE
ConstHWND_NOTOPMOST=-2
PrivateDeclareFunctionSetWindowLongLib”user32″Alias”SetWindowLongA”(ByValhwndAsLong,ByValnIndexAsLong,ByValdwNewLongAsLong)AsLong
PrivateDeclareFunctionSetWindowPosLib”user32″(ByValhwndAsLong,ByValhWndInsertAfterAsLong,ByValxAsLong,ByValyAsLong,ByValcxAsLong,ByValcyAsLong,ByValwFlagsAsLong)AsLong
在Form_Load使用的范例如下:
PrivateSubForm_Load()
SetWindowLongMe.hwnd,GWL_EXSTYLE,WS_EX_TRANSPARENT
SetWindowPosMe.hwnd,HWND_NOTOPMOST,0&,0&,0&,0&,SWP_SHOWME
Me.Refresh
EndSub->