Window programming questions

Started by
15 comments, last by snisarenko 21 years, 3 months ago
To keep the cursor inside your window use the SetCapture and ClipCursor functions. I am not shore how they work as i have not used them yet but the win docs say they are used by paint progs to keep the cursor inside the window while drawing lines etc. there is an eg. in the ''win32 programmers reference'' that demonstrates what to do. enter ''Drawing Lines with the Mouse'' into the index to find it.

you could also use GetCursorPos(POINT) and SetCursorPos(320,240) to keep it ''under your control''

dose that help/confuse you?


- Jono AH
- JonoRule #1: If you build it, they will come -- to hack and cheat.
Advertisement
Thanks, thats just what i needed.

One more question before I make your brain melt. How do I get the coordinates of my window in windowed mode ?
GetWindowRect for the outer coordinates
GetClientRect for the coordinates of the part without borders and titlebar and that stuff

"take a look around" - limp bizkit
www.google.com
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

Does it return a POINT ?
Or do I have to put a POINT as a paramater ?
it accepts a *POINT, so you put a &POINT into it.
but when you declare it you just do POINT myPoint. not POINT* pmyPoint. the POINT will contain a x and a y value.

.lick
Well the function accepts the window pointer and a rectangle object.
so i do this
GetWindowRect(hWnd,windowRectangle);

During runtime it gives me a memory access error.

[edited by - snisarenko on December 25, 2002 3:03:47 PM]
Never Mind. I got it.

Thanks for replies everyone!!!!!!!!

This topic is closed to new replies.

Advertisement