return current desktop to a script

Post any technical problems or questions you have while using or configuring Dexpot.
Bug-Tracker
User avatar
willichan
Posts: 11
Joined: 10.02.2012 07:18:42

return current desktop to a script

Postby willichan » 10.02.2012 09:26:59

Is there a way for a script (I use AutoIt, but batch or VB is ok) to read what the current desktop number is? Registry location, environment variable, command-line return code?

Why I need it:
- I have a monitoring program that watches what my children (and guests) are doing on the network/internet. Unfortunately, it runs in full-screen mode, and likes to pop itself to the front all the time. It is something a friend is writing, and I am his live test. He keeps promising to fix it, but is stuck on other (paying) projects for now. I get around this using a rule to keep it on a particular desktop.
- I have a special transparent screen-saver the same friend made for me that lets me lock my computer, but show through whatever would be showing on my desktop.
- I am writing an AutoIt script that will watch for the screen saver to kick in, and switch the current Dexpot desktop between the one with the network usage monitor and another screen that shows a web page with things like weather and a family calendar.

The problem is that I want the script to switch the current desktop back to where-ever I was before the screen-saver script kicked in. Unfortunately, the -back switch won't do it, because Dexpot will have switched desktops multiple times after the screen-saver script kicked in.

User avatar
Patrick
Developer
Posts: 7380
Joined: 04.03.2003 14:51:26

Re: return current desktop to a script

Postby Patrick » 11.02.2012 09:14:16

:dex:

Code: Select all

$handle = WinGetHandle("[TITLE:Dexpot - Main Menu; CLASS:ThunderRT6FormDC]")
$ret = DllCall("user32.dll", "int", "SendMessage", "HWND", $handle, "UINT", 2006, "WPARAM",  0, "LPARAM", 0)
MsgBox(0, "Current Desktop", $ret[0])

User avatar
willichan
Posts: 11
Joined: 10.02.2012 07:18:42

Re: return current desktop to a script

Postby willichan » 22.02.2012 18:04:41

Thank you! That is a big help.


Return to “Support”

Who is online

Users browsing this forum: No registered users and 57 guests