Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / November 2005

Tip: Looking for answers? Try searching our database.

systray menu overlaps

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
klee - 19 Nov 2005 14:26 GMT
I wrote an MFC program whose icon, tooltip and menus are available in systray.
When I right-click on the icon, not only my popup menus but also the taskbar
popup menu, such as, "Toolbars", "Adjust Date/Time", etc. are displayed.
If I right-click one more time, then only my menus are displayed. This
happens alternatively. In other words, if I click again, then both menus are
displayed.
I followed the exact steps that were posted on MSDN, such as,
afx_msg LONG CAutoUpdatesDlg::OnSysTrayIconClick( WPARAM wParam, LPARAM
lParam )
{
    switch (lParam){
    case WM_LBUTTONDOWN:
        OnSysTrayInstallupdates();
        break;
    case WM_RBUTTONDOWN:
        ShowTrayPopupMenu();
        break ;
    }
//    PostMessage( WM_NULL, 0, 0 );
    return 0;
}

void CAutoUpdatesDlg::ShowTrayPopupMenu()
{
    CMenu mnTrayPopup;
    mnTrayPopup.LoadMenu(IDR_TRAY_POPUP);

    POINT CurPos;
    GetCursorPos (&CurPos);
    CMenu *mnItem1 = mnTrayPopup.GetSubMenu(0);
    SetForegroundWindow();
    mnItem1->TrackPopupMenu( TPM_RIGHTBUTTON | TPM_RIGHTALIGN,
            CurPos.x, CurPos.y, this );
    PostMessage( WM_NULL, 0, 0 );
}

Is this a VC7 bug? Or am I missing anything?

TIA.
klee - 21 Nov 2005 20:46 GMT
I realized that this is my machine specific. In other words, it only happens
on my XP development machine where all kinds of developement tools are
installed.
I downloaded a program from
http://www.thecodeproject.com/shell/ashsystray.asp?forumid=2978&select=1285812&d
f=100&msg=1285812

and the sample EXE also behaved same. Also Palm Desktop icon too.
However, Outlook2003 icon, Volume Control icon, Winzip icon, McAfee icon and
pcAnywhere icon behave correctly.

When those problematic programs were tested on the test machines, e.g.
Win2000 Server / Win2003 Server / XP, that overlapping doesn't occur.

Anyone know what could cause that problem?

Thanks!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.