Hi,

I want to set some status on status bar of outlook window whenever
someone clicks on my outlook explorer button.

This is my code snippet. Here I could get handle to status bar of
Outlook window, but I couldn't pass WM_SetText event to that handle.

--------------------------------------------------------------------------------------------------------------------------------------------------
    Public Declare Function SendMessageSTRING Lib "user32" Alias
"SendMessageA" _
(ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As
Integer, ByVal lParam As String) As Integer

 Private Declare Function FindWindow Lib "user32" Alias
"FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As
String) As Integer

    <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)
> _
Private Shared Function FindWindowEx(ByVal parentHandle As IntPtr, _
                                     ByVal childAfter As IntPtr, _
                                     ByVal lclassName As String, _
                                     ByVal windowTitle As String) As
IntPtr
    End Function

Sub Button_OnClick()
Dim Outlookwnd As IntPtr = FindWindow("rctrl_renwnd32" & vbNullChar,
"Inbox - Microsoft Outlook")
Dim statushwnd As IntPtr = FindWindowEx(Outlookwnd, Nothing,
"msctls_statusbar32", "")
Dim status As String = "Changing Status ..."
Dim retValOfSendMessage As Integer = SendMessageSTRING(statushwnd,
&HC, 0, status)
End Sub
--------------------------------------------------------------------------------------------------------------------------------------------------
Every time I get retValOfSendMessage = 1 & not 0. What may be wrong?

Thanks in advance

Reply via email to