Click here to Skip to main content
16,008,469 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DIBSections Pin
Chambers28-Oct-01 11:05
Chambers28-Oct-01 11:05 
GeneralRe: DIBSections Pin
Chris Losinger28-Oct-01 11:48
professionalChris Losinger28-Oct-01 11:48 
GeneralRe: DIBSections Pin
Joaquín M López Muñoz28-Oct-01 11:55
Joaquín M López Muñoz28-Oct-01 11:55 
GeneralRe: DIBSections Pin
Christian Graus28-Oct-01 12:06
protectorChristian Graus28-Oct-01 12:06 
GeneralRe: DIBSections Pin
Mike Nordell29-Oct-01 12:19
Mike Nordell29-Oct-01 12:19 
GeneralRe: DIBSections Pin
Christian Graus29-Oct-01 12:51
protectorChristian Graus29-Oct-01 12:51 
Generalargh, dialog resource menu enabling/graying Pin
Kuniva28-Oct-01 10:35
Kuniva28-Oct-01 10:35 
GeneralRe: argh, dialog resource menu enabling/graying Pin
Crercio O. Silva28-Oct-01 10:57
Crercio O. Silva28-Oct-01 10:57 
1) Add a handle to your dialog.h like this:
afx_msg LRESULT OnKickIdle(WPARAM, LPARAM);

2) Includes <afxpriv.h> in the dialog.cpp (for WM_KICKIDLE) message

3) Insert this code into the MESSAGE_MAP
ON_MESSAGE(WM_KICKIDLE, OnKickIdle)

4) Create the function OnKickIdle like this
LRESULT ServerProperties::OnKickIdle(WPARAM, LPARAM)
{
CMenu* pMainMenu = GetMenu();
CCmdUI cmdUI;
UINT n;

for (n = 0; n < pMainMenu->GetMenuItemCount(); ++n)
{
CMenu* pSubMenu = pMainMenu->GetSubMenu(n);
cmdUI.m_nIndexMax = pSubMenu->GetMenuItemCount();
for (UINT i = 0; i < cmdUI.m_nIndexMax;++i)
{
cmdUI.m_nIndex = i;
cmdUI.m_nID = pSubMenu->GetMenuItemID(i);
cmdUI.m_pMenu = pSubMenu;
cmdUI.DoUpdate(this, FALSE);
}
}
return TRUE;
}

5) Add the handles to OnUpdateCmdUI to menu items.

6) Relax, compile it e enjoy. Cool | :cool:

PS: That will work only for menus, there is a different way to handle toolbar.

[]s
GeneralRe: argh, dialog resource menu enabling/graying Pin
Michael Dunn28-Oct-01 13:36
sitebuilderMichael Dunn28-Oct-01 13:36 
Generalthanks Pin
Kuniva28-Oct-01 22:47
Kuniva28-Oct-01 22:47 
GeneralDynamic building of menu in an MFC Application Pin
Stephane Routelous28-Oct-01 9:46
Stephane Routelous28-Oct-01 9:46 
GeneralRe: Dynamic building of menu in an MFC Application Pin
Joaquín M López Muñoz28-Oct-01 11:05
Joaquín M López Muñoz28-Oct-01 11:05 
GeneralOverlay Mode Pin
28-Oct-01 8:52
suss28-Oct-01 8:52 
GeneralMulti Threaded Server Pin
28-Oct-01 5:40
suss28-Oct-01 5:40 
GeneralRe: Multi Threaded Server Pin
Anders Molin28-Oct-01 12:15
professionalAnders Molin28-Oct-01 12:15 
GeneralRe: Multi Threaded Server Pin
28-Oct-01 20:12
suss28-Oct-01 20:12 
GeneralSending messages directly to other windows Pin
Kuniva28-Oct-01 2:39
Kuniva28-Oct-01 2:39 
GeneralRe: Sending messages directly to other windows Pin
#realJSOP28-Oct-01 3:37
professional#realJSOP28-Oct-01 3:37 
Questionrequest code for usefully problem? Pin
Huu Quynh28-Oct-01 1:12
Huu Quynh28-Oct-01 1:12 
QuestionATL equivalent of PreTranslateMessage? Pin
Michael Dunn27-Oct-01 22:40
sitebuilderMichael Dunn27-Oct-01 22:40 
AnswerRe: ATL equivalent of PreTranslateMessage? Pin
Rashid Thadha28-Oct-01 8:36
Rashid Thadha28-Oct-01 8:36 
Questionsetting the font ? Pin
JekYu27-Oct-01 21:01
JekYu27-Oct-01 21:01 
AnswerRe: setting the font ? Pin
l a u r e n27-Oct-01 21:21
l a u r e n27-Oct-01 21:21 
AnswerRe: setting the font ? Pin
Nish Nishant27-Oct-01 21:23
sitebuilderNish Nishant27-Oct-01 21:23 
AnswerRe: setting the font ? Pin
Simon Walton29-Oct-01 0:12
Simon Walton29-Oct-01 0:12 

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.