i have successfully wrote the function but in VB.NET
Public Sub updateBanner(ByVal roomName As String, ByVal text As String)
Me.sendWMCommandToRoomName(roomName, WMCommand.palAdminConsole)
Dim hwnds As Integer() = WinAPIService.getWindowHwndsByText("Console - " & roomName)
If (hwnds.Length > 0) Then
Dim hwnd As Integer = hwnds(0)
WinAPIService.hideHwnd(hwnd)
Dim bannerHwnd As Integer = WinAPIService.FindWindowEx(hwnd, 0&, "Edit", vbNullString)
Call WinAPIService.SendMessageString(bannerHwnd, WinAPIService.WM_SETTEXT, 0&, New StringBuilder(text))
Dim hwndButton As Integer = WinAPIService.findHwndByParentHwnd(hwnd, "Button", 17) 'Support all international versions
Call WinAPIService.SendMessage(hwndButton, WinAPIService.WM_KEYDOWN, WinAPIService.VK_SPACE, 0&)
Call WinAPIService.SendMessage(hwndButton, WinAPIService.WM_KEYUP, WinAPIService.VK_SPACE, 0&)
business.util.Methods.delay(1000)
WinAPIService.closeByHwnd(hwnd)
End If
End Sub