ARPFre Posted March 14, 2022 Posted March 14, 2022 Good morning, can someone teach me how to use _GUICtrlTab_ActivateTab or explain to me why it doesn't work? I looked for help on the internet, but they are very specific to IE or other browsers. I'm wanting to open the TaskManager in Tab 02 (Performance / "Desempenho" ), but it doesn't work, and it doesn't return an error. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiTab.au3> #RequireAdmin $hWnd = Run("taskmgr.exe") $hWnd = WinWaitActive ("[CLASS:TaskManagerWindow]", "") WinActivate ( $hWnd ) _GUICtrlTab_ActivateTab ( $hWnd, 2)
Danyfirex Posted March 14, 2022 Posted March 14, 2022 You need to use the Tab handle in ActivateTab. ;~ #AutoIt3Wrapper_UseX64=y #RequireAdmin #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiTab.au3> Local $iPID = Run("taskmgr.exe") Local $hWnd = WinWaitActive("[CLASS:TaskManagerWindow]", "") WinActivate($hWnd) Local $hTab = ControlGetHandle($hWnd, "", "SysTabControl321") _GUICtrlTab_ActivateTab($hTab, 1) Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
whim Posted March 14, 2022 Posted March 14, 2022 @ARPFre You could also set the default startup tab for taskmanager in its' Options menu, or manipulate the registry where it saves it's options: in HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\TaskManager Modify the REG_DWORD named StartUpTab Values range from 0 to 6 for tabs from left to right. (checked this on Win 10 21H2) ARPFre 1
ARPFre Posted March 14, 2022 Author Posted March 14, 2022 8 minutes ago, Danyfirex said: You need to use the Tab handle in ActivateTab. ;~ #AutoIt3Wrapper_UseX64=y #RequireAdmin #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiTab.au3> Local $iPID = Run("taskmgr.exe") Local $hWnd = WinWaitActive("[CLASS:TaskManagerWindow]", "") WinActivate($hWnd) Local $hTab = ControlGetHandle($hWnd, "", "SysTabControl321") _GUICtrlTab_ActivateTab($hTab, 1) Saludos Thank you very much, It worked 90%, now I think it's a Windows error. When you switch to the performance tab, the application does not accept it, that is, it marks only the tab and the part below remains unchanged. I think it's ugly, but I'll adapt with Send Right and Left.
Solution Danyfirex Posted March 14, 2022 Solution Posted March 14, 2022 Change _GUICtrlTab_ActivateTab for _GUICtrlTab_ClickTab. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
ARPFre Posted March 14, 2022 Author Posted March 14, 2022 (edited) 9 minutes ago, Danyfirex said: Change _GUICtrlTab_ActivateTab for _GUICtrlTab_ClickTab. Saludos Yes, it worked correctly. Thanks, I didn't know about this resource, I'm learning a lot from these forums, it's almost my only source. From what I was reading the "ControlGetHandle" can be used for any handle, so I can click and manipulate the applications? And where did "SysTabControl321" come from? ons? Edited March 14, 2022 by ARPFre
Danyfirex Posted March 14, 2022 Posted March 14, 2022 Yes it works for any Window Common Control. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
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