Jump to content
  • Advertisement
Sign in to follow this  
MARS_999

Issue with Left mouse down in a Modeless Dialog Box

This topic is 4944 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a modeless dialog box running and when I click the mouse inside of it I get two message pumps? If I read the mouse location I get two identical outputs using a dump to a text file. I am taking control of the mouse when I click down and releasing it when I release the mouse button...

		case WM_LBUTTONDOWN:
		SetCapture(hDlg);
		gameCoord.GetScreenCoordinates(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
		gameCoord.CalulateScreenCoordinates();
		fout << "Screen Coords X " << GET_X_LPARAM(lParam) << "Screen Coords Y " << GET_Y_LPARAM(lParam) << endl;
		fout << "X " << gameCoord.ReturnScreenCoordinates(0) << endl;
		fout << "Y " << gameCoord.ReturnScreenCoordinates(1) << endl;
		fout << "Z " << gameCoord.ReturnScreenCoordinates(2) << endl << endl;
		return true;
		break;

	case WM_LBUTTONUP:
		ReleaseCapture();
		return true;
		break;

Share this post


Link to post
Share on other sites
Advertisement
I believe you need to return 0 instead of 1 after the message is processed. I comfirmed this with my windows code. I hope this helps [smile].

- Drew

Share this post


Link to post
Share on other sites
Quote:
Original post by Drew_Benton
I believe you need to return 0 instead of 1 after the message is processed. I comfirmed this with my windows code. I hope this helps [smile].

- Drew


Sorry but no help with returning Zero instead, I even took out the return and still get two values... Thanks for the idea though. Not sure if there is any difference in using a Modeless dialog box but I am calling these from that window's Proc function... Also just a note I can't use WM_MOUSEWHEEL either says its undefined? I have windows.h included

Share this post


Link to post
Share on other sites
BUMP!! Anyone? If I click my left mouse button or movee the wheel, right click while in the modeless dialog window I am getting two calls to all my ofstream or cout objects... So if I print location X when left mouse button is clicked I get X = 100 X = 100 again? Do I have to take control of the window completely and shut down the main loop? Am I missing some kind of special function for these kinds of windows? Thanks

Share this post


Link to post
Share on other sites
Update, if I run the rendering window in the main window and get rid of the dialog box, and take input from WinMain() Proc() I get only one value at a time instead of two? Does this help anyone who knows more about this than me throw up a flag on what might be wrong? Thanks

Share this post


Link to post
Share on other sites
what do you mean you get two message pumps, a message pump is the actual code that handles\dispatches the messages. Do you mean you get 2 instances of the WM_LBUTTONDOWN?? Its possible that you reflected the message from your main window to your modaless dialog.

Cheers
Chris

Share this post


Link to post
Share on other sites
Quote:
Original post by chollida1
what do you mean you get two message pumps, a message pump is the actual code that handles\dispatches the messages. Do you mean you get 2 instances of the WM_LBUTTONDOWN?? Its possible that you reflected the message from your main window to your modaless dialog.

Cheers
Chris


Ah I think we are on the same page? Yeah it calls WM_LBUTTONDOWN twice from what I can tell due to it prints out the info twice when I do anything in the modaless dialog window. So I am confused on how to fix that? Thanks

Share this post


Link to post
Share on other sites
what's above the WM_LBUTTONDOWN case, perhaps you didn't break out of it?? Perhaps its the WM_MOUSEMOVE or WM_LBUTTONUP case??

Cheers
Chris

Share this post


Link to post
Share on other sites
I'd like to see the decalaration of the Dialog's CALLBACK as well as the main switch statement where these case labels are located...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!