Archived

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

snisarenko

Window programming questions

Recommended Posts

I have a few questions about programming a window. How would I implement (or modify Nehe''s code) to : 1. Make a non-resizable window. When cursor comes to the edge it does not turn into a resizing arrow. 2. Window only has a close button at the top right corner. 3. How to make the mouse coursor dissappear in windowed mode and give all of the mouse control to my window ?

Share this post


Link to post
Share on other sites
So if I do what u said in the window function then WINDOWS shouldn't send me the resize message, right ???????

If I do ShowCursor(true) in the middle of my program after i called ShowCursor(false) in the begining, will it show up ?

Also, if I do ShowCursor(true), will it show up in fullsreen?

[edited by - snisarenko on December 24, 2002 10:42:08 PM]

[edited by - snisarenko on December 24, 2002 10:42:58 PM]

Share this post


Link to post
Share on other sites
Well if you cant resize then no...it wont send a resize message...um...ShowCursor has a counter ie if you call it with false twice, you will have to call it with two trues to make it come back up. Show cursor works for fullscreen and windowed mode.

brian

Share this post


Link to post
Share on other sites
Since i am bothering you anyways (sorry for being so inquisitive)
Help me out with one more thing

In windowed mode i did ShowCursor(FALSE). But it Still shows up when it goes outside the window. So how would i make it dissappear totally? Like in Unreal Tournament or Queake 3 when u play in windowed mode the cursor totaly dissapears.

Share this post


Link to post
Share on other sites
Im not sure but it might have something to do with DirectInput exclusive mode...i could be way off. Another thing you could do is intercept mouse move messages and move the cursor back inside the window...which is more of a hack but if you want continuous movement thats probably all you are looking for anyway.

Brian

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites