Skip to content

Instantly share code, notes, and snippets.

@BrendonKoz
Created January 13, 2012 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrendonKoz/1607227 to your computer and use it in GitHub Desktop.
Save BrendonKoz/1607227 to your computer and use it in GitHub Desktop.
AutoIt Script to enable/disable (toggle on each run) the display of desktop icons on a Windows PC. Can be used to prevent users from clicking on programs before computer is fully loaded if run as a startup application (with a delayed timer).
Func PostMessage($hWnd, $msg, $wParm, $lParm)
Return DllCall("user32.dll", "int", "PostMessage", _
"hwnd", $hWnd, _
"int", $msg, _
"int", $wParm, _
"int", $lParm)
EndFunc ;==>PostMessage
$programManager = WinGetHandle("Program Manager");
PostMessage($programManager, 0x111, 28755, 0); Show/Hide desktop icons (0x0111 is defined as $WM_COMMAND in GUIConstants.au3)
PostMessage($programManager, 0x111, 28931, 0); Refresh the desktop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment