Jump to content

Select a tab, tab is selected, but interface is not updated, why?


Recommended Posts

I used _GUICtrlTab_SetCurSel to select the tab, and also used _GUICtrlTab_SetCurFocus to set focus to the tab, but the tab interface is still not update, why?

What I mean is, for example, there are two tabs - Windows and Mac. Under Windows tab, it shows Windows XP, Vista; under the Mac tab, it shows OS X, Leopard. However, when I use autoit to select the Mac tab, it still shows Windows XP, Vista.

Link to comment
Share on other sites

I used _GUICtrlTab_SetCurSel to select the tab, and also used _GUICtrlTab_SetCurFocus to set focus to the tab, but the tab interface is still not update, why?

What I mean is, for example, there are two tabs - Windows and Mac. Under Windows tab, it shows Windows XP, Vista; under the Mac tab, it shows OS X, Leopard. However, when I use autoit to select the Mac tab, it still shows Windows XP, Vista.

The Beta version has a function _GUICtrlTab_ClickTab which will do what you want. If you don't want to use the Beta then you could copy and paste that function to your script.
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

sfresher

martin

I don't know how implemented tab selection in the beta version, but this fork for me:

#include <WindowsConstants.au3>
#include <GuiTab.au3>

Send("#{Pause}")

Dim $sTitle = "Свойства системы" ;Change title name, because my OS is russian :)

WinWait($sTitle)
WinActivate($sTitle)
WinWaitActive($sTitle)

$hWnd = WinGetHandle($sTitle)
$hTab = ControlGetHandle($hWnd, "", "SysTabControl321")

$TabID = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $hTab)
$TabID = $TabID[0]

MsgBox(48, "Attention", "Now we change a tab item")

_GUICtrlTab_SetCurFocus($hTab, 1)
$sResult = _SendMessage($hWnd, $WM_NOTIFY, $TabID, $TCN_SELCHANGE)

:)

Link to comment
Share on other sites

Thanks a lot! It works for me. But I really don't get it, what does the following code do?

sfresher

martin

I don't know how implemented tab selection in the beta version, but this fork for me:

$TabID = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $hTab)
$TabID = $TabID[0]

:)

Link to comment
Share on other sites

Hmm... a new problem pops up. After I set the focus to the tab, I cannot use controlclick to click on a button that sits outside the tab, but within the same window.

How to overcome this issue?

Thanks a lot! It works for me. But I really don't get it, what does the following code do?

Link to comment
Share on other sites

sfresher

But I really don't get it, what does the following code do?

MSDN

The GetDlgCtrlID function retrieves the identifier of the specified control.

In other words this function convert the control handle to a control ID.

sfresher

Hmm... a new problem pops up. After I set the focus to the tab, I cannot use controlclick to click on a button that sits outside the tab, but within the same window.

How to overcome this issue?

Show your code.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...