Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Enable/Disable/Rename
#12
Menu items must have MFT_OWNERDRAW type (0x100). The dialog must process WM_MEASUREITEM (calculate text width and height) and WM_DRAWITEM (completely draw the item - text, icon, state) messages. Read more in MSDN library.

code to start:
Function dlg_menu_draw
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("dlg_menu_draw" &dlg_menu_draw 0 0 0 0 0 0 0 0 0 "dlg_menu_draw")) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x203000C "*" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_MEASUREITEM
,MEASUREITEMSTRUCT& mi=+lParam
,out 1
,case WM_DRAWITEM
,DRAWITEMSTRUCT& di=+lParam
,out 2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1

;BEGIN MENU
;>&File
,;&New : 100 0x100 0 Cn
,;&Open : 101 0x100 0 Co
,;&Save : 102 0x100 0 Cs
,;Save &As... : 103 0x100
,;-
,;>&Recent : 0 0x100
,,;not implemented : 190 0 1
,,;<
,;-
,;E&xit : 2 0x100 0 AF4
,;<
;&Help : 901 0
;END MENU


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)