SUB SetMenuIcon(BYVAL FrmHwnd AS LONG, IconName AS ASCIIZ,_
BYVAL MainMenuNumber AS LONG,_
BYVAL MenuItemNumber AS LONG)
LOCAL MemIcon AS ICONINFO
LOCAL mMenu AS LONG
LOCAL SubMenu AS LONG
LOCAL MenuItemID AS LONG
LOCAL hIcon AS LONG
LOCAL hBmp AS LONG
hIcon = LoadImage(OS_INSTANCE, IconName, %IMAGE_ICON, _
GetSystemMetrics(%SM_CXMENUCHECK), _
GetSystemMetrics(%SM_CYMENUCHECK), _
%LR_LOADTRANSPARENT)
GetIconInfo hIcon, MemIcon
hBmp = MemIcon.hBmColor
mMenu = GetMenu(FrmHwnd)
SubMenu = GetSubMenu(mMenu, MainMenuNumber)
MenuItemID = GetMenuItemID(SubMenu, MenuItemNumber)
CALL SetMenuItemBitmaps(mMenu, MenuItemID, 0&, hBmp, hBmp)
END SUB
'****************************************
' применение для иконок в ресурсах
'****************************************
'...
MENU ATTACH X_MENU, hDlgM
SetMenuIcon hDlgM, "xopen", 0&, 0&
SetMenuIcon hDlgM, "xnew", 0&, 1&
SetMenuIcon hDlgM, "xsave", 0&, 3&
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 15