Skip to content

Instantly share code, notes, and snippets.

@ddhahn
Created February 3, 2013 01:29
Show Gist options
  • Save ddhahn/4700110 to your computer and use it in GitHub Desktop.
Save ddhahn/4700110 to your computer and use it in GitHub Desktop.
Switch to a desktop named sparedesktop
#include <winapiex.au3>
#include <apiconstants.au3>
;+--- switch to the desktop named sparedesktop
; Switch to the newly created desktop
_WinAPI_SwitchDesktop($hDesktop)
$hPrev = _WinAPI_GetThreadDesktop(_WinAPI_GetCurrentThreadID())
$hDesktop = _WinAPI_CreateDesktop('MyDesktop', BitOR($DESKTOP_CREATEWINDOW, $DESKTOP_SWITCHDESKTOP))
If Not $hDesktop Then
sgBox(16, 'Error', 'Unable to create desktop.')
Exit
endIf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment