显示/隐藏桌面与任务栏
下面的技巧将使用API调用来显示或隐藏桌面与任务栏。有些应用程序需要屏幕用户在当前应用程序与桌面或任务栏之间进行切换,使用本方法即可达到:

1.说明下面两下API调用

Function long FindWindowExA & 
   ( long hWnd, long hWndChild, ref string lpszClassName, &
   ref string lpszWindow) library 'user32'
Function long ShowWindow &
   (long hWnd, long nCmdShow ) library 'user32'

2.增加如下的Powerscript脚本:

// Constants for ShowWindow()
Constant Long SW_HIDE = 0
Constant Long SW_NORMAL = 1
Constant Long SW_SHOWMINIMIZED = 2
Constant Long SW_SHOWMAXIMIZED = 3
Constant Long SW_SHOWNOACTIVATE = 4
Constant Long SW_SHOW = 5
Constant Long SW_MINIMIZE = 6
Constant Long SW_SHOWMINNOACTIVE = 7
Constant Long SW_SHOWNA = 8
Constant Long SW_RESTORE = 9
Constant Long SW_SHOWDEFAULT = 10

// Names of the shell windows we'll be looking for
String ls_ShellViewWnd = "Progman"
String ls_ShellTaskBarWnd = "Shell_TrayWnd"
String ls_Null

// Locals
Long ll_HTaskBar, ll_HDeskTop

// Hide task bar
ll_HTaskBar = FindWindowExA( 0, 0, ls_ShellTaskBarWnd, ls_Null )
ShowWindow( ll_HTaskBar, SW_HIDE )

// Hide Desktop
ll_HDeskTop = FindWindowExA( 0, 0, ls_ShellViewWnd, ls_Null )
ShowWindow( ll_HDeskTop, SW_HIDE )

// Pause to Restore
MessageBox( 'pbdr.com', 'look no hands!' )

// Show task bar
ll_HTaskBar = FindWindowExA( 0, 0, ls_ShellTaskBarWnd, ls_Null )
ShowWindow( ll_HTaskBar, SW_SHOW )

// Show Desktop
ll_HDeskTop = FindWindowExA( 0, 0, ls_ShellViewWnd, ls_Null )
ShowWindow( ll_HDeskTop, SW_SHOW )