Solved

ClientToScreen is obsolete?

Posted on 2004-04-04
4
632 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 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

18 Experts available now in Live!

Get 1:1 Help Now