[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ClientToScreen is obsolete?

Posted on 2004-04-04
4
Medium Priority
?
644 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
3 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 90 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Integration Management Part 2
Suggested Courses
Course of the Month19 days, 19 hours left to enroll

873 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