Solved

ClientToScreen is obsolete?

Posted on 2004-04-04
4
638 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to monitor remote shell execution on linux 9 106
tripleUp challenge 7 92
scoreUp challenge 14 69
Message not shown 5 82
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…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

762 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