定义两个外部函数
Function long FindWindowExA(long hWnd,long hWndChild,ref string lpszClassName,ref string lpszWindow) library "user32.dll"
Function long ShowWindow(long hwnd,long nCmdShow) library "user32.dll"
在窗口的open事件中写下例代码
CONSTANT LONG SW_HIDE=0
CONSTANT LONG SW_NORMAL=1
CONSTANT LONG SW_SHOWMINIMIZED=2
CONSTANT LONG SW_SHOWMAXIMIZED=3
CONSTANT LONG SW_SHOWNOCATIVATE=4
CONSTANT LONG SW_SHOW=5
CONSTANT LONG SW_MINIMIZED=6
CONSTANT LONG SW_SHOWMINNOACTIVE=7
CONSTANT LONG SW_SHOWNA=8
CONSTANT LONG SW_RESTORE=9
CONSTANT LONG SW_SHOWDEFAULT=10
string ls_ShellTaskBarWnd="shell_TrayWnd"
string ls_isnull
long ll_HTaskBar,ll_HDeskTop
ll_HTaskBar=FindWindowExA(0,0,ls_ShellTaskBarWnd,ls_isnull)
ShowWindow(ll_HTaskBar,SW_HIDE)
①定义API:
Function ulong FindWindowEx(ulong hWnd1,ulong hWnd2,ref string lpsz1,ref string lpsz2) LIBRARY "user32.dll" ALIAS FOR "FindWindowExA"
Function ulong ShowWindow( ulong winhandle, int wincommand ) Library "user32"
②脚本:
// Names of the shell windows we'll be looking for
String str_ShellViewWnd = "Progman"
String str_ShellTaskBarWnd = "Shell_TrayWnd"
String str_Null
Long lng_HTaskBar, lng_HDeskTop