• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Grabbing Mouse Coordinates and W32 Question

## Recommended Posts

Hey there, Could someone please answer a few of my rookie questions? 1.What do I need to change in the windows code so that there are no maximise/minimise functions. I want the window to be maximised when it starts (which I know how to do) but so that the size cannot be changed by the user by clicking that little box in the top right by the exit button. 2.Can someone tell me how to grab the mouse coordinates. 3.If you look at milkshape 3D, there are the 3D windows but at the bottom left there are the mouse coordinates. How can I display the coordinates in this fashion using W32 code. The only thing I know close to this is TextOut(hDC, x, y, string,StrLen); Which I doubt is the way to do it. Thanks for any help you can give. Edited by - Clouds3000 on October 23, 2001 4:33:57 PM

##### Share on other sites
this is an easy way to grab mouse coords.

  POINT mpos;GetCursorPos(&mpos);x = mpos.x;y = mpos.y;

##### Share on other sites
use the following lines to destruct the maximize/minimize boxes. these should be placed somewhere among the window initialization code. check the Win32 help for a complete list of style attributes you can add and remove.

Attr.Style &= ~WS_MAXIMIZEBOX;
Attr.Style &= ~WS_MINIMIZEBOX;

as to cursor pos, evilchicken has made it quite clear and as to TextOut... what''s wrong with that? TextOut is a very nice function - allows you to put text anywhere. just use SetBkMode(hDC, mode) where mode is TRANSPARENT for the window dc to make the background visible from behind the text.

hope this helps

• ### Forum Statistics

• Total Topics
627719
• Total Posts
2978797

• 10
• 9
• 21
• 14
• 12