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 426,353 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,450 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
Views: 2685 | Replies: 1
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  

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C Forum

All times are GMT -4. The time now is 12:06 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC