Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"