ProcessCommand
Processes internal menu/button commands
BOOL ProcessCommand( int nCmd, DWORD dwCmdType = PCMD_ORIGIN_INTERNAL, DWORD wParam = 0, DWORD lParam = 0 )
TRUE if successful, FALSE otherwise
EX1
#include <Control.h> #include <OC_Res.h> void OriginObject_ProcessCommand_Ex1(Menu* pmenu, int nId = IDR_CM_WKS) { Worksheet wks = Project.ActiveLayer(); HINSTANCE hInstOutil = GetModuleHandle(MODULE_OU); if(pmenu->Load(hInstOutil, nId, 1)) { HWND hMenu = pmenu->GetSafeHmenu(); if(hMenu) wks.AddInternalMenu(hMenu, nId, 1); int nCmd = pmenu->TrackPopupResMenu(0, 0, 0, GetWindow()); //Screen co-ordinates wks.GetPage().ProcessCommand(nCmd); } }
origin.h