CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Context Menu

  1. #1
    Join Date
    Jan 2001
    Location
    Singapore
    Posts
    200

    Context Menu

    I have created a CFormView which displays some graphics and using a timer, the graphics will be constanly updated.

    As i need to have a context menu, I have used the CMenu::TrackPopupMenu() function to display the menu that i have created. However i have a problem with this. When the menu is displayed by calling the TrackPopupMenu() function, the graphics in the CFormView does not get refreshed. When the menu is closed, the CFormView will be updated again but when the menu is being displayed the graphics will not be updated.

    It seems that the menu is being displayed very much like a domodal dialog box......Is there a solution to this problem???

  2. #2
    Join Date
    Feb 2002
    Posts
    5,757
    One solution is a UI thread.

    Kuphryn

  3. #3
    Join Date
    Jan 2001
    Location
    Singapore
    Posts
    200
    Originally posted by kuphryn
    One solution is a UI thread.

    Kuphryn
    Wat is a UI thread??

  4. #4
    Join Date
    May 2002
    Location
    Romania
    Posts
    22

    CM

    Hello Lim,
    I just want to know if you found a solution for that.
    thx.

  5. #5
    Join Date
    Jan 2001
    Location
    Singapore
    Posts
    200

    Re: CM

    Originally posted by adiior
    Hello Lim,
    I just want to know if you found a solution for that.
    thx.
    Not i still have no idea how to solve it. Someone suggested that using the TPM_NONOTIFY and TPM_RETURNCMD flags will force the menu to act modally but i don't think these 2 flags existed and i never set these 2 flags anyway

  6. #6
    Join Date
    Dec 2002
    Posts
    1,050
    SetTimer uses WM_TIMER so you're not going to be able to
    process these while the context menu is up, really don't think
    there is a way to modify the behavior.

    Instead of using SetTimer, maybe you could try the multimedia
    timers instead, they don't rely on messaging. Just check the
    msdn for any of these functions, they'll bring you to the timer
    section. It'll be a quick change to the code to see if this will do
    it for you.

    timeSetEvent
    'TimeProc'
    timeBeginPeriod
    timeEndPeriod

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured