qwert 42 Posted December 10, 2015 MSDN prescribes the following as a VB script to toggle the desktop:dim objShell set objShell = CreateObject("shell.application") objShell.ToggleDesktop set objShell = nothingI'd like to replicate this in Au3 ... but don't see things beyond the obvious first step:Global $objShell = ObjCreate("Shell.Application")Beyond seeing them in a few example scripts, I have no experience with objects ... and haven't been able to garner anything from the two examples in Help. Would someone mind showing me how to fashion this into a callable function?Thanks for any help. Share this post Link to post Share on other sites
iamtheky 927 Posted December 10, 2015 (edited) Global $objShell = ObjCreate("Shell.Application") $objShell.ToggleDesktop the last line in your example just sets the variable back to nothing, which is unnecessary Edited December 10, 2015 by iamtheky ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Share this post Link to post Share on other sites
qwert 42 Posted December 10, 2015 Thanks very much. That does work.Are there other considerations to be aware of? ... like when calling it a few dozen times in the script? Can the create be done once at the beginning? Share this post Link to post Share on other sites
qwert 42 Posted December 10, 2015 I have partly answered my own questions. I happened upon the section in the help file on the introduction to COM extensions ... "objects".On the first line we create a new object called "shell.application". This is an internal Windows object, defined in shell32.dll. The pointer to this new object is assigned to the variable $oShell. $oShell is from now on an Object variable.It seems to be "create once, use many". I'll test that in my script. It also says "no need to delete an object ... Au3 does so upon exit". Share this post Link to post Share on other sites
iamtheky 927 Posted December 10, 2015 The only consideration I can think of would be not throwing it in a never ending while loop. ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Share this post Link to post Share on other sites