User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 402,472 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,967 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums

win32 api mouse coordinates weird

Join Date: Feb 2006
Location: Illinois
Posts: 14
Reputation: andrax is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
andrax andrax is offline Offline
Newbie Poster

Help win32 api mouse coordinates weird

  #1  
Feb 10th, 2006
I'm writting a program where I need the coordinates of the mouse when it's clicked inside the client area. For some reason, the coordinates seem to be in base 21, maybe higher (I've seen the character k). I'm not sure why this is happening.

Here's the mouse section of the message loop
case WM_LBUTTONDOWN:
{
	int x = ((int)(short)LOWORD(lParam));
	int y = ((int)(short)HIWORD(lParam));

	char buf[20];
	string s = itoa(x, buf, 21);
	s += ", ";
	s += itoa(y, buf, 21);
	MessageBox(hwnd, s.c_str(), "Distance", MB_OK | MB_APPLMODAL);

	return 0;
}
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 4:16 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC