Solved

ClientToScreen is obsolete?

Posted on 2004-04-04
4
630 Views
Last Modified: 2013-11-20
Hello,
I just started learning a little Visual C++.
I have a question about pop up menus and the way to handle them:

----------------------------------
CMenu *m_lMenu;
CPoint m_pPoint;
      
   m_pPoint = point;
   ClientToScreen(&m_pPoint);//  I guess it's old..
   m_lMenu = GetMenu()->GetSubMenu(0);
   m_lMenu->TrackPopupMenu(TPM_CENTERALIGN + TPM_LEFTBUTTON  , m_pPoint.x, m_pPoint.y, this, NULL);

------------------------

The following code creates a pop menu no the mouse pointer, but something confuses me...
the popup menu pops at a way different position on the screen, no where near the mouse.

now, if I remove the ClientToScreen convertion and use the original positions, it will pop near the mouse just fine.

Just wondring ..... Wasn't this suppose to be the right way to do it?
is ClientToScreen obsolete and not used anymore? and the original positions enough? to determine the screen coordinates?
0
Comment
Question by:SiCkness
  • 2
4 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 30 total points
ID: 10755059
ClientToScreen is not obsolete. If this happenes as you describe, point is already in screen coordinates.
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 10883805
You have not specified the event of function where you trap the mouse click.
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11857825
Still awaiting for author feedback
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now