Click here to Skip to main content
15,899,475 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Ok, so when is a variable defined? Pin
Senkwe Chanda18-Jan-04 13:01
Senkwe Chanda18-Jan-04 13:01 
GeneralRe: Ok, so when is a variable defined? Pin
Gary R. Wheeler18-Jan-04 15:16
Gary R. Wheeler18-Jan-04 15:16 
GeneralRe: Ok, so when is a variable defined? Pin
Senkwe Chanda18-Jan-04 17:12
Senkwe Chanda18-Jan-04 17:12 
AnswerRe: Ok, so when is a variable defined? Pin
Mike Dimmick18-Jan-04 23:34
Mike Dimmick18-Jan-04 23:34 
GeneralRe: Ok, so when is a variable defined? Pin
Senkwe Chanda19-Jan-04 4:42
Senkwe Chanda19-Jan-04 4:42 
GeneralA Discrete Mathematic problem. Pin
MaJr18-Jan-04 11:36
MaJr18-Jan-04 11:36 
GeneralRe: A Discrete Mathematic problem. Pin
Alexander M.,19-Jan-04 2:14
Alexander M.,19-Jan-04 2:14 
GeneralPopup menu pops up in wrong place Pin
Daniel132418-Jan-04 11:18
Daniel132418-Jan-04 11:18 
I derived a class from CListBox. In that class I added a handler for the right mouse button. When I click the right button, the menu pops up on my desktop. I know why its doing this, because the CPoint passed to the function is relative to the whole screen, not my listbox.

I cant figure out how to tell the menu to popup where my mouse is.
I tried ScreenToClient() but it didnt work.

<br />
void CMyListBox::OnRButtonUp(UINT nFlags, CPoint point) <br />
{<br />
	CMenu Menu;<br />
	Menu.LoadMenu(IDR_POPUP_MENU);<br />
	CMenu *Popup = Menu.GetSubMenu(0);<br />
	ScreenToClient(&point);<br />
	Popup->TrackPopupMenu(TPM_LEFTBUTTON|TPM_RIGHTBUTTON|TPM_LEFTALIGN, <br />
		point.x, point.y, this, NULL);<br />
	Menu.DestroyMenu();<br />
}<br />


Anybody help?

Thanks!
GeneralRe: Popup menu pops up in wrong place Pin
PJ Arends18-Jan-04 16:31
professionalPJ Arends18-Jan-04 16:31 
GeneralRe: Popup menu pops up in wrong place Pin
Michael Dunn18-Jan-04 16:31
sitebuilderMichael Dunn18-Jan-04 16:31 
GeneralRe: Popup menu pops up in wrong place Pin
Roger Allen18-Jan-04 23:51
Roger Allen18-Jan-04 23:51 
GeneralRe: Popup menu pops up in wrong place Pin
Daniel132419-Jan-04 0:51
Daniel132419-Jan-04 0:51 
GeneralRe: Popup menu pops up in wrong place Pin
фил21-Jan-04 4:50
фил21-Jan-04 4:50 
GeneralSetWaitableTimer Pin
Mikey_E18-Jan-04 10:23
professionalMikey_E18-Jan-04 10:23 
GeneralRe: SetWaitableTimer Pin
Mike Dimmick18-Jan-04 23:39
Mike Dimmick18-Jan-04 23:39 
GeneralRe: SetWaitableTimer Pin
Mikey_E19-Jan-04 10:17
professionalMikey_E19-Jan-04 10:17 
GeneralRe: CSleeperThread Pin
Clem8628-Mar-08 2:45
Clem8628-Mar-08 2:45 
QuestionCan My Window Receive Messages Pin
bitpusher18-Jan-04 9:40
bitpusher18-Jan-04 9:40 
Generalstructs Pin
[Anders]18-Jan-04 8:53
[Anders]18-Jan-04 8:53 
GeneralRe: structs Pin
markkuk18-Jan-04 10:18
markkuk18-Jan-04 10:18 
GeneralRe: structs Pin
[Anders]18-Jan-04 11:23
[Anders]18-Jan-04 11:23 
GeneralRe: structs Pin
Ian Darling18-Jan-04 11:30
Ian Darling18-Jan-04 11:30 
GeneralMessage Closed Pin
18-Jan-04 11:37
[Anders]18-Jan-04 11:37 
GeneralRe: structs Pin
Ian Darling18-Jan-04 12:43
Ian Darling18-Jan-04 12:43 
GeneralRe: structs Pin
Jörgen Sigvardsson18-Jan-04 11:20
Jörgen Sigvardsson18-Jan-04 11:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.