Click here to Skip to main content
15,886,919 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: ActiveX Control Test Container unavailable in VS2008? Pin
Pat Brenner (MSFT)18-Mar-10 9:53
Pat Brenner (MSFT)18-Mar-10 9:53 
QuestionUpdating toolbar button text & creating dropdown buttons Pin
itzuke28-Sep-09 22:37
itzuke28-Sep-09 22:37 
QuestionHow to move a window only use WM_XXX message without MoveWindow or SetWindowPos? Pin
hawkgao012928-Sep-09 20:25
hawkgao012928-Sep-09 20:25 
AnswerRe: How to move a window only use WM_XXX message without MoveWindow or SetWindowPos? Pin
hawkgao012928-Sep-09 21:20
hawkgao012928-Sep-09 21:20 
QuestionCImageList and CTreeViewControl Pin
Nicolai M27-Sep-09 9:23
Nicolai M27-Sep-09 9:23 
AnswerRe: CImageList and CTreeViewControl Pin
Nicolai M27-Sep-09 12:52
Nicolai M27-Sep-09 12:52 
AnswerRe: CImageList and CTreeViewControl Pin
Nicolai M27-Sep-09 20:46
Nicolai M27-Sep-09 20:46 
Question[WTL] Enable/disable menu items with UIEnable (problem) Pin
itzuke23-Sep-09 5:35
itzuke23-Sep-09 5:35 
class MyDlg 
	: public CDialogImpl<MyDlg>,
	  public CUpdateUI<MyDlg>,
	  public CIdleHandler,
{

//...
BEGIN_UPDATE_UI_MAP(MyDlg)
  UPDATE_ELEMENT(ID_FILE_PAUSE, UPDUI_MENUPOPUP)
  UPDATE_ELEMENT(ID_FILE_CANCEL, UPDUI_MENUPOPUP)
END_UPDATE_UI_MAP()

BEGIN_MSG_MAP(MyDlg)
  //...
  COMMAND_ID_HANDLER_EX(ID_FILE_PAUSE, OnPopupFileMenu)
  COMMAND_ID_HANDLER_EX(ID_FILE_CANCEL, OnPopupFileMenu)
  //...
  CHAIN_MSG_MAP(CUpdateUI<MyDlg>)
END_MSG_MAP


Here's the improtant part ofOnPopuFileMenu:
LRESULT MyDlg::OnPopupFileMenu(UINT /*wParam*/, int /*LOWORD(wParam)*/, HWND /*lParam*/)
{
	//...
	UIEnable(ID_FILE_SEND, nEnableSend);
	UIEnable(ID_FILE_PAUSE, nEnablePause);
	UIEnable(ID_FILE_CANCEL, nEnableCancel);
	UIEnable(ID_FILE_REMOVE, nEnableRemove);

	return 0;
}


My goal is to call the OnPopupFileMenu when the head of the File menu is clicked (File) and to enable/disable some items from the file menu. But this does not happen.
What happens is that when I click File->Cancel (for example) the OnPopupFileMenu method is called and only then.
I achieved my goal by handling the raw WM_ENTERMENULOOP, but I don't like it this way, I want to use WTL's functionallity instead.

P.S.: I'm not sure whether I should have UPDATE_ELEMENT(and a corresponding COMMAND_ID_HANLER_EX) for each menu item I want to update, or a single one can do the job (because at each call of OnPopupFileMenu I know the state of all items in the menu).

Thanks for _any_ pointers.
AnswerRe: [WTL] Enable/disable menu items with UIEnable (problem) Pin
Stuart Dootson23-Sep-09 11:47
professionalStuart Dootson23-Sep-09 11:47 
AnswerRe: [WTL] Enable/disable menu items with UIEnable (problem) Pin
Michael Dunn13-Oct-09 8:40
sitebuilderMichael Dunn13-Oct-09 8:40 
QuestionSTL Map Pin
VVVimal22-Sep-09 4:10
VVVimal22-Sep-09 4:10 
AnswerRe: STL Map Pin
Michael Dunn22-Sep-09 12:54
sitebuilderMichael Dunn22-Sep-09 12:54 
AnswerRe: STL Map Pin
Andy Moore23-Sep-09 5:19
Andy Moore23-Sep-09 5:19 
QuestionSYSTEMTIME Pin
VVVimal14-Sep-09 19:17
VVVimal14-Sep-09 19:17 
AnswerRe: SYSTEMTIME Pin
Stuart Dootson15-Sep-09 0:18
professionalStuart Dootson15-Sep-09 0:18 
AnswerRe: SYSTEMTIME Pin
BlueSkycpp26-Oct-09 18:47
BlueSkycpp26-Oct-09 18:47 
QuestionCompare two different STL list Pin
VVVimal13-Sep-09 21:56
VVVimal13-Sep-09 21:56 
AnswerRe: Compare two different STL list Pin
Stuart Dootson13-Sep-09 23:07
professionalStuart Dootson13-Sep-09 23:07 
QuestionPreventing multiple instances of COM singleton??? Pin
kb-boxer30-Aug-09 20:52
kb-boxer30-Aug-09 20:52 
AnswerRe: Preventing multiple instances of COM singleton??? Pin
«_Superman_»30-Aug-09 21:20
professional«_Superman_»30-Aug-09 21:20 
GeneralRe: Preventing multiple instances of COM singleton??? Pin
kb-boxer31-Aug-09 0:23
kb-boxer31-Aug-09 0:23 
QuestionHow can I hide the WTL Dialog scrollbar in SmartPhone? Pin
Kiss Rain17-Aug-09 17:29
Kiss Rain17-Aug-09 17:29 
QuestionWhat should I do that I want to develop a MenuBar or ToolBar using ATL? [modified] Pin
Nothend11-Aug-09 19:37
Nothend11-Aug-09 19:37 
QuestionWhere to get more information about windows shell? Pin
mr.dot9-Aug-09 7:51
mr.dot9-Aug-09 7:51 
AnswerRe: Where to get more information about windows shell? [modified] Pin
Richard MacCutchan8-Sep-09 0:59
mveRichard MacCutchan8-Sep-09 0:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.