All

how to get StripStatusLabel from statusstrip my code is not work
please help me for this case.


[Image link removed by moderator]


my code
//----------------- module -------------------
Option Explicit

Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long


//------------------- forms -------------------

Option Explicit

Const CB_GETLBTEXTLEN = &H149
Const CB_GETLBTEXT = &H148
Const CB_GETCOUNT = &H146
Const CB_ERR = (-1)
Const WM_SETTEXT = &HC
Const WM_GETTEXT = &HD
Const WM_GETTEXTLENGTH = &HE
Const EM_LINEFROMCHAR = &HC9


hWnd = FindWindow(vbNullString, "OBERTHUR PersonIC Matica")
If hWnd > 0 Then
cbo = FindWindowEx(hWnd, ByVal 0&, vbNullString, "")
cbx = FindWindowEx(cbo, ByVal 0&, vbNullString, "Production")
cbo = FindWindowEx(cbx, ByVal 0&, vbNullString, "StatusStrip1")
slength = SendMessage(cbo, WM_GETTEXTLENGTH, 0, 0)
wintext = Space(slength + 1)
If SendMessage(cbo, WM_GETTEXT, slength + 1, ByVal wintext) = CB_ERR Then
End If

End If

//---------------------------------------------------------------