Home > Archive > Smartphone Developer Forum > October 2005 > Changing menu text while program is running
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Changing menu text while program is running
|
|
| Bernd Muent 2005-10-20, 4:04 am |
| Hi,
I've got a menu created from ressource.
There is a menu point "Turn sound off".
When I select it, it turns the sound on. OK. But I like to change the
text to "Turn sound on".
How is this possible? Is it all?
I tried the following without success:
BOOL t=SetDlgItemText(g_hWndMenuBarCurrent,ID
M_SOUND,_T("TEST"));
hR=SendMessage(g_hWndMenuBarCurrent,WM_S
ETTEXT,IDM_SOUND,(LPARAM)(_T("T")));
buttonInfo.pszText=_T("TEST");
hR=SendMessage(g_hWndMenuBarCurrent,TB_S
ETBUTTONINFO,IDM_SOUND,(LPARAM)(LPTBBUTT
ONINFO)&buttonInfo);
hR=SendMessage(g_hWndMenuBarCurrent,WM_S
ETTEXT,IDM_SOUND,(LPARAM)(LPTBBUTTONINFO
)&buttonInfo);
The returned result is always 0. And nothing happen.
The only thing I can do isenable/disable this control by:
buttonInfo.fsState=TBSTATE_INDETERMINATE;
SendMessage(g_hWndMenuBarCurrent,TB_SETB
UTTONINFO,IDM_SOUND,(LPARAM)(LPTBBUTTONI
NFO)&buttonInfo);
buttonInfo.fsState=TBSTATE_ENABLED;
SendMessage(g_hWndMenuBarCurrent,TB_SETB
UTTONINFO,IDM_SOUND,(LPARAM)(LPTBBUTTONI
NFO)&buttonInfo);
Thank you for tips, Bernd
--
BM Computer-Services, Bergmannstr. 66, 10961 Berlin
Webdesign, Internet, Layout und Grafik
Tel.: 030/20649400, mobil 0175/7419517, Fax: 030/20649401
Web: http://www.bmservices.de, eMail: kontakt@bmservices.de
| |
|
|
|
|
|
|
|