PowerBuilder Using Hide/Show Desktop and Taskbar Win32 API
With this tips you can easily hide the desktop and taskbar from the user.
External Function Prototypes Declaration
1 2 3 | //External Function Prototypes Declaration Function Long FindWindowEx (Long hwnd1, Long hwnd2, String lpsz1, String lpsz2) Library "user32" Alias For "FindWindowExA" Function Long ShowWindow (Long hwnd, Long nCmdShow) Library "user32" Alias For "ShowWindow" |
Type the example codes below to hide/show the desktop and taskbar
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | //[PowerScript] //constants 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 //Type the example codes below to hide the desktop and taskbar String ls_ShellViewWnd = "Progman" String ls_ShellTaskBarWnd = "Shell_TrayWnd" String ls_Null Long ll_HTaskBar, ll_HDeskTop SetNull (ls_Null) //Hide TaskBar ll_HTaskBar = FindWindowEx ( 0, 0, ls_ShellTaskBarWnd, ls_Null) ShowWindow ( ll_HTaskBar, SW_HIDE ) //Hide Desktop ll_HDeskTop = FindWindowEx ( 0, 0, ls_ShellViewWnd, ls_Null ) ShowWindow ( ll_HDeskTop, SW_HIDE ) //To show up the desktop and taskbar again, use codes below //Show Task Bar ll_HTaskBar = FindWindowEx ( 0, 0, ls_ShellTaskBarWnd, ls_Null) ShowWindow ( ll_HTaskBar, SW_SHOW ) //Show Desktop ll_HDeskTop = FindWindowEx ( 0, 0, ls_ShellViewWnd, ls_Null ) ShowWindow ( ll_HDeskTop, SW_SHOW ) |
Good Luck!