Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
SendMessageString ...Maybe !!??
I have created a Window ( Button Class) using the ' CreateWindowEx ' API and
would like to dinamically change its Caption . I have been trying the ' Send MessageString' API but without any luck :( Here is part of my code : Sub CreateButton() lngBtnHndl = CreateWindowEx(0, "Button", "Test !", WS_CHILD, _ ActiveWindow.Width * 3 / 4, 0, 50, 25, Application.hwnd, 0, 0, 0) SetParent lngBtnHndl, Application.hwnd ShowWindow lngBtnHndl, SW_NORMAL End Sub Any one any ideas ? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
SendMessageString ...Maybe !!??
Hi,
Have you tried the SetWindowText API? Declare Function SetWindowText& Lib "user32" Alias "SetWindowTextA" ( ByVal hwnd as Long, ByVal lpString As String ) then Dim result as long result = SetWindowText( lngBtnHndl , "Hello" ) if result = 0 then msgbox "cannot set caption" end if -- Regards, Sébastien "RAFAAJ2000" wrote: I have created a Window ( Button Class) using the ' CreateWindowEx ' API and would like to dinamically change its Caption . I have been trying the ' Send MessageString' API but without any luck :( Here is part of my code : Sub CreateButton() lngBtnHndl = CreateWindowEx(0, "Button", "Test !", WS_CHILD, _ ActiveWindow.Width * 3 / 4, 0, 50, 25, Application.hwnd, 0, 0, 0) SetParent lngBtnHndl, Application.hwnd ShowWindow lngBtnHndl, SW_NORMAL End Sub Any one any ideas ? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|