WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Control Manager
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Using cSetTabItem to Move through Tabbed Dialogs

Keywords:	 cSetTabItem cWndInfo tabbed dialogs

Question:

In Windows 95 - Control Panel/Passwords, I have a problem obtaining the handle of the "User Profile" tab. Sometimes it does and sometimes it doesn't. Even the Windows Analysis script sometimes lists the tab and its attributes and sometimes it doesn't. Does anyone have any ideas why this is and how to fix it? Thanks.

Answer:

Things to keep in mind:
  1. Before you even try to access any controls on that tab, you MUST select the tab, using the Control Manager's cSetTabItem function to set the tab item before going after handles.

  2. In many of the tabbed dialogs, the windows are not even brought into existence until the tab is selected.

  3. When you click on a tab in a tabbed dialog, this changes the contents of some controls.

Sample code to select a specific tab.

AddExtender( 'wwctl44i.dll' )
Run( 'rundll32.exe', 'shell32.dll,Control_RunDLL mmsys.cpl' )
title = 'Sounds and Audio Devices Properties'
ret = WinWaitExist( title, 5 )
If ret == 0
   Message( 'Notice', 'Window Not Found: ': title)
   Exit
EndIf
; select the third tab
parenthwnd = DllHwnd( title )
systabwnd = cWndbyclass( parenthwnd, 'SysTabControl32' )
cSetTabItem( systabwnd, 3 )

; confirm correct tab
audiohwnd = cWndbyseq( parenthwnd, 1 )
thistitle = cWndinfo( audiohwnd, 0 )
If thistitle != 'Audio'
   Message( 'Error', 'Incorrect tab title' )
   Exit
EndIf

Article ID:   W12519
Filename:   Tabbed Dialogs.txt
File Created: 2017:07:28:13:58:28
Last Updated: 2010:01:07:10:42:45