Hello friends,
I am trying to get a popup menu on the right button click event. Code is as follows
//---------------------------------------------------------------------------------------------------------------
HMODULE mod = GetModuleHandle (NULL);
POINT point;
GetCursorPos(&p oint);
HMENU menu = LoadMenu(mod, MAKEINTRESOURCE (IDM_TRAY));
HMENU hmenuTrackPopup = GetSubMenu(menu , 0);
SetForegroundWi ndow( );
int retval = TrackPopupMenu( menu, TPM_BOTTOMALIGN |TPM_RETURNCMD ,point.x, point.y,0,this->m_hWnd,NULL) ;
PostMessage(WM_ NULL, 0, 0);
DestroyMenu(men u);
//--------------------------------------------------------------------------------------------------------
my menu functionality is working correct but it is not displaying correct.
Image of menu is in the attachment
Anybody can give answer?
I will be very thankful for answers.
I am trying to get a popup menu on the right button click event. Code is as follows
//---------------------------------------------------------------------------------------------------------------
HMODULE mod = GetModuleHandle (NULL);
POINT point;
GetCursorPos(&p oint);
HMENU menu = LoadMenu(mod, MAKEINTRESOURCE (IDM_TRAY));
HMENU hmenuTrackPopup = GetSubMenu(menu , 0);
SetForegroundWi ndow( );
int retval = TrackPopupMenu( menu, TPM_BOTTOMALIGN |TPM_RETURNCMD ,point.x, point.y,0,this->m_hWnd,NULL) ;
PostMessage(WM_ NULL, 0, 0);
DestroyMenu(men u);
//--------------------------------------------------------------------------------------------------------
my menu functionality is working correct but it is not displaying correct.
Image of menu is in the attachment
Anybody can give answer?
I will be very thankful for answers.