Click here to Skip to main content
15,888,454 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to creat a graphical back ground and button on a dialog class in MFC? Pin
flow555517-Mar-04 2:58
flow555517-Mar-04 2:58 
AnswerRe: How to creat a graphical back ground and button on a dialog class in MFC? Pin
David Crow17-Mar-04 4:33
David Crow17-Mar-04 4:33 
GeneralSharing data among Threads Pin
Cedric Moonen17-Mar-04 2:44
Cedric Moonen17-Mar-04 2:44 
GeneralRe: Sharing data among Threads Pin
GuimaSun17-Mar-04 3:13
GuimaSun17-Mar-04 3:13 
GeneralRe: Sharing data among Threads Pin
Cedric Moonen17-Mar-04 3:31
Cedric Moonen17-Mar-04 3:31 
GeneralURL opens application Pin
Florin Ochiana17-Mar-04 1:49
Florin Ochiana17-Mar-04 1:49 
QuestionHow to use CheckMenuItem()???????? Pin
Anonymous17-Mar-04 1:46
Anonymous17-Mar-04 1:46 
AnswerRe: How to use CheckMenuItem()???????? Pin
Florin Ochiana17-Mar-04 2:00
Florin Ochiana17-Mar-04 2:00 
You have to have a function that would execute the code when the users selects the menu item.

Let's say it's

ON_COMMAND(ID_YOURMENUITEM, TestFn)

Maybe you want to use a global variable that will tell you the state of that item.

bool testVar;

void TestFn() {
CMenu *m_MainMenu;
// let's say you have your menu in m_MainMenu

if (testVar) {
testVar = false;
m_MainMenu->GetSubMenu(1)->GetSubMenu(x)->CheckMenuItem(n, MF_BYPOSITION | MF_UNCHECKED);
} else {
testVar = true;
m_MainMenu->GetSubMenu(1)->GetSubMenu(x)->CheckMenuItem(n, MF_BYPOSITION | MF_CHECKED);
}
}

where n is the position of your item in the menu

-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.

GeneralRe: How to use CheckMenuItem()???????? Pin
Anonymous17-Mar-04 2:10
Anonymous17-Mar-04 2:10 
GeneralRe: How to use CheckMenuItem()???????? Pin
Florin Ochiana17-Mar-04 2:19
Florin Ochiana17-Mar-04 2:19 
GeneralThank u very much!! Pin
Anonymous17-Mar-04 2:39
Anonymous17-Mar-04 2:39 
AnswerRe: How to use CheckMenuItem()???????? Pin
Maximilien17-Mar-04 2:33
Maximilien17-Mar-04 2:33 
Generalcin >> question Pin
ns17-Mar-04 1:16
ns17-Mar-04 1:16 
GeneralRe: cin >> question Pin
David Crow17-Mar-04 2:27
David Crow17-Mar-04 2:27 
GeneralRe: cin >> question Pin
Anonymous17-Mar-04 22:11
Anonymous17-Mar-04 22:11 
GeneralRe: cin >> question Pin
David Crow19-Mar-04 3:25
David Crow19-Mar-04 3:25 
GeneralProperty sheets and pages Pin
Anonymous17-Mar-04 0:56
Anonymous17-Mar-04 0:56 
GeneralRe: Property sheets and pages Pin
Nirav Doshi17-Mar-04 1:28
Nirav Doshi17-Mar-04 1:28 
GeneralRe: Property sheets and pages Pin
thowra17-Mar-04 1:52
thowra17-Mar-04 1:52 
GeneralDetecting if a print job failed Pin
tcss16-Mar-04 23:58
tcss16-Mar-04 23:58 
GeneralRe: Detecting if a print job failed Pin
Blake Miller17-Mar-04 7:45
Blake Miller17-Mar-04 7:45 
GeneralRe: Detecting if a print job failed Pin
tcss17-Mar-04 20:20
tcss17-Mar-04 20:20 
GeneralGDI+ and bitmap resources Pin
bouli16-Mar-04 23:10
bouli16-Mar-04 23:10 
GeneralRe: GDI+ and bitmap resources Pin
Anonymous16-Mar-04 23:31
Anonymous16-Mar-04 23:31 
GeneralRe: GDI+ and bitmap resources Pin
bouli17-Mar-04 0:34
bouli17-Mar-04 0:34 

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.