tags:

views:

48

answers:

1

hi all,

i'm trying to control some soulseek features from VB6 - the problem is the SysTabControl32 - how can i read out which tab is selected? the api spyer only returns the SysTabcontrol32 but no tab button.

thx

+2  A: 

I suggest try the TCM_GETCURSEL message. It should return the index of the currently selected tab.

The code is something like this below - I adapted this from vbAccelerator's cTabCtrl but haven't tested it.

Private Const TCM_FIRST = &H1300 
Private Const TCM_GETCURSEL = (TCM_FIRST + 11)
Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" _
 (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As _
 Long) As Long

Public Function SelectedTab(ByVal hWnd As Long) As Long
    SelectedTab = SendMessageLong(hWnd, TCM_GETCURSEL, 0, 0) + 1
End Property
MarkJ
wqw
@wqw Thanks, slight copy/paste failure there! As I say I haven't tested it. Fuxi, did you try the code out?
MarkJ