IanN1990 Posted December 17, 2011 Share Posted December 17, 2011 (edited) I want to start using alt and tab more, but the problem is i have so much open by default it makes navigating between what i really want hard. Is there any way for me to use Autoit to hide some of those icons ? and a second small question. Assuming something has focus like WinActivate("[class:Notepad]"), is there any way to remove active status from that program but not give it to anything else ? Edited April 14, 2012 by IanN1990 Link to comment Share on other sites More sharing options...
somdcomputerguy Posted December 17, 2011 Share Posted December 17, 2011 (edited) 1. You could hide the window(s) with the WinSetState function, or you could use a program such as this - written and shared by KaFu. A hidden program is not Alt-Tabbable2. The only way I know of to not give focus to any program is to power off the PC. Focus has to go somewhere.. You could use the WinSetOnTop function though, to leave an unfocused program where it is, while the focus is on another program. Edited December 17, 2011 by somdcomputerguy - 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...
KaFu Posted December 17, 2011 Share Posted December 17, 2011 Always nice seeing a reference , thanks somdcomputerguy. In HMW I use the function _WinGetAltTabWinList by Ascend4nt. In this function he documented the following:; Extended Style bits WS_EX_NOACTIVATE (0x08000000) and WS_EX_TOOLWINDOW (0x80) indicate non-Alt-Tab windows,; but if bit WS_EX_APPWINDOW (0x040000) is set, then it is still Alt-Tab-ableYou can use the function to get a list of Alt-Tabable windows and then loop through that list adjusting the styles of those windows you want to remove from the list using _WinAPI_SetWindowLong correspondingly. I'm not sure if the style change is applied instantly or if you need to hide and unhide (e.g. by _WinAPI_ShowWindow()) the window again to apply it. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
IanN1990 Posted December 17, 2011 Author Share Posted December 17, 2011 thanks for ur replies somdcomputerguy and kafe, the wingetalttablist sounds very promising i will look into that imminently As far of the focus idea, reading your post made me think "what happens to focus when a program is closed" which then lead me to creative $hGUI = GUICreate("Test", 0, 0) WinActivate("Test") Winclose("Test") Makes a gui, gives it focus, kills it Link to comment Share on other sites More sharing options...
somdcomputerguy Posted December 17, 2011 Share Posted December 17, 2011 ..made me think "what happens to focus when a program is closed"Usually (probably almost always..), focus goes back to whatever program had it before the second program was opened, which you probably found out from your test. - 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...
IanN1990 Posted December 17, 2011 Author Share Posted December 17, 2011 (edited) yea seams your right, maybe i got my hopes up too soon i guess Edited December 17, 2011 by IanN1990 Link to comment Share on other sites More sharing options...
IanN1990 Posted December 17, 2011 Author Share Posted December 17, 2011 (edited) @68852 well the idea of my code is if u click the desktop, it shows all the icons. If u unclick the desktop after 10 seconds it hides it but i wanted to add some code if u click the desktop but dont move the mouse after 10 secs it hides it again. I thought the best way of doing that would be to unfocus it So in ur example setting the desk as focus wouldn't work but i did use the idea of setting another hidden application as focus @KaFu So i downloaded and installed your link, ran the test code getting [0]|13|| [1]|Windows Live Messenger|0x00010310|MSBLWindowClass [2]|Friends|0x0003049E|USurface_822813 [3]|Skype™ (BETA) - edited|0x0001024E|tSkMainForm [4]|C:Program Files (x86)Scripts00¦ MiscellaneousMicrosoftStorageTest.au3 - SciTE4AutoIt3|0x003402A2|SciTEWindow [5]|Hotmail - edited@hotmail.co.uk - Windows Live - Mozilla Firefox|0x0403072E|MozillaWindowClass [6]|AutoIt Help|0x002607B8|HH Parent [7]|Include|0x0037046C|CabinetWClass [8]|Internet Download Manager 6.07|0x0003037C|#32770 [9]|edited - Chat|0x003306FC|USurface_822813 [10]|Windows Media Player|0x00010414|WMPlayerApp [11]|User Moderation - AutoIt Forums - Mozilla Firefox|0x003D068E|MozillaWindowClass [12]||0x0010052A|AutoIt v3 GUI [13]|Untitled - Notepad|0x00410380|Notepad So how would i use the _WinAPI_SetWindowLong to hide notepad from the list ? Edited December 17, 2011 by IanN1990 Link to comment Share on other sites More sharing options...
IanN1990 Posted December 18, 2011 Author Share Posted December 18, 2011 Using Opt('WinTitleMatchMode', 2 ) #include "_WinGetAltTabWinList.au3" #include <Array.au3> Local $aWindows=_WinGetAltTabWinList("","",True) _ArrayDisplay($aWindows) #include <Constants.au3> #include <WinAPI.au3> $b = WinGetHandle("[CLASS:MSBLWindowClass]") $c = WinGetHandle("[CLASS:tSkMainForm]") $d = WinGetHandle("[CLASS:WMPlayerApp]") $e = WinGetHandle("[CLASS:AutoIt v3 GUI]") $f = WinGetHandle("Program Manager") $g = WinGetHandle("Friends") _WinAPI_SetWindowLong($b, $GWL_Exstyle, 0x08000000) _WinAPI_SetWindowLong($c, $GWL_Exstyle, 0x08000000) _WinAPI_SetWindowLong($d, $GWL_Exstyle, 0x08000000) _WinAPI_SetWindowLong($e, $GWL_Exstyle, 0x80000000) _WinAPI_SetWindowLong($f, $GWL_Exstyle, 0x08000000) _WinAPI_SetWindowLong($g, $GWL_Exstyle, 0x08000000) Works nicely at removing lots of those unneeded ones but i cant hide desktop ? Any ideas Link to comment Share on other sites More sharing options...
IanN1990 Posted December 19, 2011 Author Share Posted December 19, 2011 One last question #include <Constants.au3> #include <WinAPI.au3> $b = WinGetHandle("[CLASS:MSBLWindowClass]") if _WinAPI_GetWindowLong($b, $GWL_Exstyle) = (0x08000000) Then MsgBox(4096, "Test", "This box will time out in 10 seconds", 10) EndIf Is my failed attempt but how do i write it to do a if statement "if window = 0x0800000) then do this ?? Link to comment Share on other sites More sharing options...
KaFu Posted December 19, 2011 Share Posted December 19, 2011 if BitAND(_WinAPI_GetWindowLong($b, $GWL_Exstyle), 0x08000000) Then OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
IanN1990 Posted December 19, 2011 Author Share Posted December 19, 2011 Seams my code was well off thanks for giving the correct syntax and all ur help on this little project 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