G
gv
Please help
using vb.net 2003, on XP sp2 machine
the length in the panel of the statusbar seams to be correct, but having
problems
returning text using "SB_GETTEXT"
please help
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Int32
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA"
(ByVal hWnd1 As Int32, _
ByVal hWnd2 As Int32, ByVal lpsz1 As String, ByVal lpsz2 As
String) As Int32
Private Declare Function SendMessageGetChild Lib "user32" Alias
"SendMessageA" (ByVal hwnd As Int32, _
ByVal wMsg As Int32, ByVal wParam As Int32, ByVal
lParam As String) As Int32
Private Const WM_USER = &H400&
Private Const SB_GETTEXTLENGTH = (WM_USER + 3)
Private Const SB_GETPARTS = (WM_USER + 6)
Private Const SB_GETTEXT = (WM_USER + 2)
Private Const WM_SETTEXT = &HC
Private Const WM_GETTEXT = &HD
Private Const WM_GETTEXTLENGTH = &HE
Public Function GetchildText()
Try
Dim WindowStatusbar As Int32
Dim ChildStatusbar As Int32
Dim getstring As Int32
Dim StatusbarParts As Int32
Dim childtxtLen As Int32
Dim buffer As String
WindowStatusbar = FindWindow("BioViewAnalysis", vbNullString)
If WindowStatusbar <> 0 Then
ChildStatusbar = FindWindowEx(WindowStatusbar, 0&,
"msctls_statusbar32", vbNullString)
StatusbarParts = SendMessageGetChild(ChildStatusbar,
SB_GETPARTS, 0, 0)
'Panel 1
childtxtLen = SendMessageGetChild(ChildStatusbar,
SB_GETTEXTLENGTH, 1, 0)
childtxtLen = childtxtLen And &HFFFF&
buffer = New String(Chr(0), childtxtLen)
SendMessageGetChild(ChildStatusbar, SB_GETTEXT, 1, buffer)
MessageBox.Show("Length of Statusbar Panel text is: " &
childtxtLen & vbCrLf & _
"The text = " & buffer)
End If
Catch ex As Exception
End Try
End Function
using vb.net 2003, on XP sp2 machine
the length in the panel of the statusbar seams to be correct, but having
problems
returning text using "SB_GETTEXT"
please help
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Int32
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA"
(ByVal hWnd1 As Int32, _
ByVal hWnd2 As Int32, ByVal lpsz1 As String, ByVal lpsz2 As
String) As Int32
Private Declare Function SendMessageGetChild Lib "user32" Alias
"SendMessageA" (ByVal hwnd As Int32, _
ByVal wMsg As Int32, ByVal wParam As Int32, ByVal
lParam As String) As Int32
Private Const WM_USER = &H400&
Private Const SB_GETTEXTLENGTH = (WM_USER + 3)
Private Const SB_GETPARTS = (WM_USER + 6)
Private Const SB_GETTEXT = (WM_USER + 2)
Private Const WM_SETTEXT = &HC
Private Const WM_GETTEXT = &HD
Private Const WM_GETTEXTLENGTH = &HE
Public Function GetchildText()
Try
Dim WindowStatusbar As Int32
Dim ChildStatusbar As Int32
Dim getstring As Int32
Dim StatusbarParts As Int32
Dim childtxtLen As Int32
Dim buffer As String
WindowStatusbar = FindWindow("BioViewAnalysis", vbNullString)
If WindowStatusbar <> 0 Then
ChildStatusbar = FindWindowEx(WindowStatusbar, 0&,
"msctls_statusbar32", vbNullString)
StatusbarParts = SendMessageGetChild(ChildStatusbar,
SB_GETPARTS, 0, 0)
'Panel 1
childtxtLen = SendMessageGetChild(ChildStatusbar,
SB_GETTEXTLENGTH, 1, 0)
childtxtLen = childtxtLen And &HFFFF&
buffer = New String(Chr(0), childtxtLen)
SendMessageGetChild(ChildStatusbar, SB_GETTEXT, 1, buffer)
MessageBox.Show("Length of Statusbar Panel text is: " &
childtxtLen & vbCrLf & _
"The text = " & buffer)
End If
Catch ex As Exception
End Try
End Function