Click here to Skip to main content
16,010,673 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: STL to: Cin, Cout, ifstream & ofstream Pin
Michael P Butler2-Dec-01 1:42
Michael P Butler2-Dec-01 1:42 
GeneralRe: STL to: Cin, Cout, ifstream & ofstream Pin
Igor Sukhov2-Dec-01 6:05
Igor Sukhov2-Dec-01 6:05 
GeneralRe: STL to: Cin, Cout, ifstream & ofstream Pin
Erik Funkenbusch3-Dec-01 9:28
Erik Funkenbusch3-Dec-01 9:28 
GeneralRe: STL to: Cin, Cout, ifstream & ofstream Pin
valikac3-Dec-01 12:45
valikac3-Dec-01 12:45 
QuestionMRU list, how do i use it ? Pin
robbied1-Dec-01 16:10
robbied1-Dec-01 16:10 
AnswerRe: MRU list, how do i use it ? Pin
Igor Sukhov2-Dec-01 6:17
Igor Sukhov2-Dec-01 6:17 
GeneralRe: MRU list, how do i use it ? Pin
robbied2-Dec-01 7:12
robbied2-Dec-01 7:12 
GeneralChecking a menu item Pin
IGx891-Dec-01 14:47
IGx891-Dec-01 14:47 
I'm using the CSystemTray class from http://www.codeproject.com/shell/systemtray.asp , and I can't figure out how to check a menu item from the tray icon's pop-up menu. I can set the default menu item, but I can't set the checked state! Here's the function I use:

[code]
BOOL CSystemTray::CheckMenuItem(UINT uItem, BOOL CheckState, BOOL bByPos)
{
#ifdef _WIN32_WCE
return FALSE;
#else

HMENU hMenu = ::LoadMenu(m_hInstance, MAKEINTRESOURCE(m_tnd.uID));
if (!hMenu)
return FALSE;

HMENU hSubMenu = ::GetSubMenu(hMenu, 0);
if (!hSubMenu)
return FALSE;

::CheckMenuItem(hSubMenu,uItem,MF_UNCHECKED);

return TRUE;
#endif
}
[/code]

The following code works fine:

[code]
BOOL CSystemTray::SetMenuDefaultItem(UINT uItem, BOOL bByPos)
{
#ifdef _WIN32_WCE
return FALSE;
#else
if ((m_DefaultMenuItemID == uItem) && (m_DefaultMenuItemByPos == bByPos))
return TRUE;

m_DefaultMenuItemID = uItem;
m_DefaultMenuItemByPos = bByPos;

HMENU hMenu = ::LoadMenu(m_hInstance, MAKEINTRESOURCE(m_tnd.uID));
if (!hMenu)
return FALSE;

HMENU hSubMenu = ::GetSubMenu(hMenu, 0);
if (!hSubMenu)
return FALSE;

::SetMenuDefaultItem(hSubMenu, m_DefaultMenuItemID, m_DefaultMenuItemByPos);

return TRUE;
#endif
}
[/code]
GeneralRe: Checking a menu item Pin
Tim Smith1-Dec-01 14:56
Tim Smith1-Dec-01 14:56 
GeneralRe: Checking a menu item Pin
IGx892-Dec-01 8:38
IGx892-Dec-01 8:38 
GeneralCView Pin
Pham Viet Tung1-Dec-01 13:48
Pham Viet Tung1-Dec-01 13:48 
GeneralRe: CView Pin
Nish Nishant1-Dec-01 15:30
sitebuilderNish Nishant1-Dec-01 15:30 
GeneralInsight on STL Containers & One Specific Question Pin
valikac1-Dec-01 12:53
valikac1-Dec-01 12:53 
GeneralRe: Insight on STL Containers & One Specific Question Pin
Chris Hafey1-Dec-01 17:08
Chris Hafey1-Dec-01 17:08 
GeneralRe: Insight on STL Containers & One Specific Question Pin
Todd Smith2-Dec-01 5:29
Todd Smith2-Dec-01 5:29 
GeneralRe: Insight on STL Containers & One Specific Question Pin
valikac3-Dec-01 12:48
valikac3-Dec-01 12:48 
GeneralFinding the keyboard and mouse Pin
Winstone1-Dec-01 11:10
Winstone1-Dec-01 11:10 
GeneralRe: Finding the keyboard and mouse Pin
Nish Nishant1-Dec-01 15:34
sitebuilderNish Nishant1-Dec-01 15:34 
GeneralRe: Finding the keyboard and mouse Pin
Hadi Rezaee1-Dec-01 19:06
Hadi Rezaee1-Dec-01 19:06 
GeneralRe: Finding the keyboard and mouse Pin
Nish Nishant1-Dec-01 21:21
sitebuilderNish Nishant1-Dec-01 21:21 
QuestionName of Internet Connection ? Pin
ColinDavies1-Dec-01 9:18
ColinDavies1-Dec-01 9:18 
QuestionIs there an API to add a header/footer to a PDF? Pin
Nish Nishant1-Dec-01 8:58
sitebuilderNish Nishant1-Dec-01 8:58 
AnswerRe: Is there an API to add a header/footer to a PDF? Pin
Rick York1-Dec-01 9:25
mveRick York1-Dec-01 9:25 
GeneralRe: Is there an API to add a header/footer to a PDF? Pin
Nish Nishant1-Dec-01 9:29
sitebuilderNish Nishant1-Dec-01 9:29 
Generaldll example problem Pin
Kuniva1-Dec-01 8:32
Kuniva1-Dec-01 8:32 

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.