我正在尝试从 VB6 控制一些 soulseek 功能 - 问题是 SysTabControl32 - 我如何读出选择了哪个选项卡?API spy 仅返回 SysTabcontrol32 但没有选项卡按钮
问问题
474 次
1 回答
2
我建议尝试TCM_GETCURSEL消息。它应该返回当前选定选项卡的索引。
代码如下所示 - 我从 vbAccelerator 的cTabCtrl改编了它,但尚未对其进行测试。
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
于 2010-03-18T10:33:37.367 回答