mistersquirrle Posted October 3, 2009 Share Posted October 3, 2009 A ghost window is translucent and will always appear on top of otherwindows. When a ghost window loses the input focus, it remainstranslucent and always on top, but all clicks will pass right throughit like it wasn't even thereThat's what I want to do, but I want to know if there's a way to do that in AutoIt, so I don't have to use a third-party program.I've messed around with WinSetTrans, WinSetState, and WinSetOnTop, but nothing I've tried does what the program GhostIt does. I just want a way to do functions like GhostIt does, but through AutoIt. I don't know if this is possible, but, worth asking... We ought not to misbehave, but we should look as though we could. Link to comment Share on other sites More sharing options...
martin Posted October 3, 2009 Share Posted October 3, 2009 That's what I want to do, but I want to know if there's a way to do that in AutoIt, so I don't have to use a third-party program. I've messed around with WinSetTrans, WinSetState, and WinSetOnTop, but nothing I've tried does what the program GhostIt does. I just want a way to do functions like GhostIt does, but through AutoIt. I don't know if this is possible, but, worth asking... Trancexx showed how to do this a few months ago. Set the window extended style to $WS_EX_TOPMOST), and set its transparency with WinSetTrans. Here is an example I wrote for someone who had no CAPS indicator on their keyboard. expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_outfile=CapsLok.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Misc.au3> #include <windowsconstants.au3> #include <winapi.au3> #include <guiconstantsEx.au3> Opt("sendcapslockmode", 0) $gui = GUICreate("capslok",20,25,0,@DesktopHeight - 25,$WS_POPUP,$WS_EX_TOPMOST);BitOr($WS_EX_TRANSPARENT,$WS_EX_TOPMOST)) GUISetFont(12) GUISetBkColor(0xff0000) WinSetTrans($gui,"",200) GUISetState() $lab = GUICtrlCreateLabel("CAPS",1,2);,80,22) GUICtrlSetResizing(-1,$GUI_DOCKLEFT+$GUI_DOCKWIDTH) GUICtrlSetColor(-1,0x33ff55) $tags =_WinAPI_GetTextExtentPoint32(_WinAPI_GetDC($gui)," CAPS ") $wid=DllStructGetData($tags,1) ConsoleWrite("wid = " & $wid & @CRLF) $ht=DllStructGetData($tags,2) ;ConsoleWrite($ht & @CRLF) $ls = ControlGetPos($gui,"",$lab) ConsoleWrite("labwid = " & $ls[2] & @CRLF) WinMove($gui,"",0,@DesktopHeight - 25,$wid+1) $CAPS = 8 $displayCL = 9 While 1 $stateCL = GETCAPSLOCK() If $stateCL <> $displayCL And Not _IsPressed("14") Then If $stateCL Then GUICtrlSetData($lab,"CAPS") Else GUICtrlSetData($lab,"") EndIf $displayCL = $stateCL WinSetOnTop($gui,"",1) EndIf Sleep(100) WEnd Func GETCAPSLOCK() Local $RET $RET = DllCall("user32.dll", "long", "GetKeyState", "long", "0x14") Return $RET[0] EndFunc ;==>GETCAPSLOCK Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
mistersquirrle Posted October 3, 2009 Author Share Posted October 3, 2009 Trancexx showed how to do this a few months ago. Set the window extended style to $WS_EX_TOPMOST), and set its transparency with WinSetTrans. Here is an example I wrote for someone who had no CAPS indicator on their keyboard. expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_outfile=CapsLok.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Misc.au3> #include <windowsconstants.au3> #include <winapi.au3> #include <guiconstantsEx.au3> Opt("sendcapslockmode", 0) $gui = GUICreate("capslok",20,25,0,@DesktopHeight - 25,$WS_POPUP,$WS_EX_TOPMOST);BitOr($WS_EX_TRANSPARENT,$WS_EX_TOPMOST)) GUISetFont(12) GUISetBkColor(0xff0000) WinSetTrans($gui,"",200) GUISetState() $lab = GUICtrlCreateLabel("CAPS",1,2);,80,22) GUICtrlSetResizing(-1,$GUI_DOCKLEFT+$GUI_DOCKWIDTH) GUICtrlSetColor(-1,0x33ff55) $tags =_WinAPI_GetTextExtentPoint32(_WinAPI_GetDC($gui)," CAPS ") $wid=DllStructGetData($tags,1) ConsoleWrite("wid = " & $wid & @CRLF) $ht=DllStructGetData($tags,2) ;ConsoleWrite($ht & @CRLF) $ls = ControlGetPos($gui,"",$lab) ConsoleWrite("labwid = " & $ls[2] & @CRLF) WinMove($gui,"",0,@DesktopHeight - 25,$wid+1) $CAPS = 8 $displayCL = 9 While 1 $stateCL = GETCAPSLOCK() If $stateCL <> $displayCL And Not _IsPressed("14") Then If $stateCL Then GUICtrlSetData($lab,"CAPS") Else GUICtrlSetData($lab,"") EndIf $displayCL = $stateCL WinSetOnTop($gui,"",1) EndIf Sleep(100) WEnd Func GETCAPSLOCK() Local $RET $RET = DllCall("user32.dll", "long", "GetKeyState", "long", "0x14") Return $RET[0] EndFunc ;==>GETCAPSLOCK I tested your script, it works, but it doesn't pass clicks through the red "CAPS" window, which is mainly what I want. I know how to make a window semi transparent (or all the way, which makes clicks pass through it, because it isn't there, for some reason). I've tried something like WinSetOnTop("Win", ,"", 1) to set it on top, and WinSetTrans("Win", "", 175) to make it transparent, but it still receives clicks. I also don't want to create a GUI window, I want to do this to an already existing window, like a picture or something. Right now I'm using GhostIt to watch Stargate SG-1 while I do an online college math course. So I can watch it, and still work, even though the player is technically covering my work space We ought not to misbehave, but we should look as though we could. Link to comment Share on other sites More sharing options...
martin Posted October 3, 2009 Share Posted October 3, 2009 I tested your script, it works, but it doesn't pass clicks through the red "CAPS" window, which is mainly what I want. I know how to make a window semi transparent (or all the way, which makes clicks pass through it, because it isn't there, for some reason). I've tried something like WinSetOnTop("Win", ,"", 1) to set it on top, and WinSetTrans("Win", "", 175) to make it transparent, but it still receives clicks.I also don't want to create a GUI window, I want to do this to an already existing window, like a picture or something. Right now I'm using GhostIt to watch Stargate SG-1 while I do an online college math course. So I can watch it, and still work, even though the player is technically covering my work spaceIn XP it works but I've tried it in Vista and it doesn't allow clicks through so if you are using Vista I don't know the answer. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted October 3, 2009 Share Posted October 3, 2009 Will making the browser (or whatever you use for the online course) transparent on top of the media window (or whatever you're using to watch SG-1 (which is a great show..)) work? - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
mistersquirrle Posted October 4, 2009 Author Share Posted October 4, 2009 Yeah I'm using Vista Home Premium or some version. And yeah, that would work... but that's more a temporary fix... I want it to be more versatile, and doing that would make the math a lot harder to read (and I use Firefox for the course). I was just thinking of making a script to take over some things that my computer does normally, but not how I want, and I was thinking that this would be a neat function... and being built in to one program, would be useful. We ought not to misbehave, but we should look as though we could. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted October 4, 2009 Share Posted October 4, 2009 (edited) Have a look at the code of this script, Yet another clock - AutoIt Forums, written by WideBoyDixon. The background of the GUI is transparent, and does 'pass thru' clicks to whatever is 'underneath'. The program 'getting the click' gets the focus too, but it would only take some additional code to 'return focus to where it was'.. Edited October 4, 2009 by snowmaker - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Yashied Posted October 4, 2009 Share Posted October 4, 2009 In XP it works but I've tried it in Vista and it doesn't allow clicks through so if you are using Vista I don't know the answer.It's strange, but I have XP and it does not get through a mouse click, and in fact as it can do. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
somdcomputerguy Posted October 4, 2009 Share Posted October 4, 2009 That CapsLok script wouldn't 'pass thru' clicks on my XP or Vista PC's either. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Yashied Posted October 4, 2009 Share Posted October 4, 2009 That CapsLok script wouldn't 'pass thru' clicks on my XP or Vista PC's either.It can not do. Not. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Yashied Posted October 4, 2009 Share Posted October 4, 2009 Here it is necessary to register all mouse clicks and pass it to the next window. Anyway, it will be works bad. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
mistersquirrle Posted October 5, 2009 Author Share Posted October 5, 2009 Have a look at the code of this script, Yet another clock - AutoIt Forums, written by WideBoyDixon. The background of the GUI is transparent, and does 'pass thru' clicks to whatever is 'underneath'. The program 'getting the click' gets the focus too, but it would only take some additional code to 'return focus to where it was'..I looked at the clock program... I don't know WinAPI stuff very well. Or at all really, but I see what you're talking about... I don't know if that'd be able to help me though... Thanks for the suggestion. I'll look into WinAPI functions and see if I can come up with anything We ought not to misbehave, but we should look as though we could. 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