- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are using Win32 api, you should catch WM_MENUSELECT message in your window procedure. Get menu item info from this message it (load resource text for menu item) and then update status bar text.
This is part of my code called on WM_MENUSELECT message
recursive subroutine ShowMenuHelpInStatusBar(hWnd,wParam,lParam)
! called from mainwndproc when WM_MENUSELECT is called
! displays menu help on statusbar
use dfwina
integer*4 hWnd
integer*4 wParam,lParam
character*256 text
Item=INT4(LOWORD(wParam))
iFlags=INT4(HIWORD(wParam))
if ((iFlags == -1) .AND. (lParam == 0)) then ! menu has been closed
nStringID = 0
else
if (IAND(iFlags,MF_POPUP) /= 0) then ! Popup menu
nStringID = 0
else
if (IAND(iFlags,MF_SYSMENU) /=0) then ! System menu
nStringID = IDS_SYSMENU
else
if (Item /= 0) then
nStringID = Item ! String ID == Command ID
else
! menu item separator
nStringID = 0
endif
endif
endif
endif
! Load the string if we have an ID
if (nStringID/=0) then
iret=LoadString(GetWindowLong(hWnd,GWL_HINSTANCE),Item, text,len(text))
if (iret > 0) then
Text=Text(:iret)//""C
iret=SendMessage(hWndStatusBar,SB_SETTEXT,IOR(0,SBT_NOBORDERS),LOC(Text))
endif
endif
return
end
I put text to be shown in statusbar in to the "prompt" control when editing menu in resource editor, to be available through LoadString
I do not use QuickWin.
Jakub
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page