gsx Posted September 4, 2010 Share Posted September 4, 2010 (edited) Hi, Since I cannot find a solution, I hope somebody can tell it. I like to show a tooltip when Desktop is on focus. I tried the following code but it does not work. AutoItSetOption("WinTitleMatchMode", 4) While 1 If WinActive("[CLASS:Program; Title:Program Manager]") Then ToolTip("Desktop is active.") Else ToolTip("Desktop is not active") EndIf Sleep(88) WEnd Thanks. Edited September 4, 2010 by gsx Link to comment Share on other sites More sharing options...
ajag Posted September 4, 2010 Share Posted September 4, 2010 The CLASS is "Progman" not "Program" If WinActive("[CLASS:Progman; Title:Program Manager]") ThenA-Jay Rule #1: Always do a backup Rule #2: Always do a backup (backup of rule #1) Link to comment Share on other sites More sharing options...
gsx Posted September 4, 2010 Author Share Posted September 4, 2010 Thank you A-Jay, it worked!By the way, is it possible to detect Desktop by just hovering over it, which does not require necessarily to activate desktop?This thread seems to be talking about it but I cannot apply the code to my need.Opt("WinTitleMatchMode", 4) $hWnd = WinGetHandle("classname=Progman") DllCall("user32.dll", "long", "SendMessage", "hwnd", $hWnd, "int", 0x111, "int", 28931, "int", 0) Link to comment Share on other sites More sharing options...
ajag Posted September 4, 2010 Share Posted September 4, 2010 Try this #include <WinAPI.au3> $DesktopHandle = ControlGetHandle("[CLASS:Progman]", "", "SysListView321") While 1 $MousePos = _WinAPI_GetMousePos() $WinHandle = _WinAPI_WindowFromPoint($MousePos) If $WinHandle = $DesktopHandle Then MsgBox(0,"Ding-Dong","Gotcha") Sleep(100) WEnd A-Jay Rule #1: Always do a backup Rule #2: Always do a backup (backup of rule #1) Link to comment Share on other sites More sharing options...
gsx Posted September 4, 2010 Author Share Posted September 4, 2010 Great! A-Jay, thank you so much. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now