http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Window messages



>
    I am new to Windows programming and have a few questions regarding
Windows with 
DirectX.  I'm using Direct Input to handle mouse and keyboard input, but
have hacked around going through the windows messaging while still doing
tests. The outline of a game loop, from what I gather, is to PeekMessage if
one is present, and handle it, and if not, then go on with your game loop. 
But what Messages do I need to keep the default mouse pointer from
appearing in a fullscreen app.  I do a SetCursor(NULL) to get rid of it
now, but if  I pass it to the DefWindowsProc(), it reappears.  I assume I
need to handle a certain message, but do not know which. Any help would be
appreciated.  In addition to this, if anyone could point me in the
direction of a list of WM messages I am going to need with a fullscreen app
to make Windows happy when various things like multitasking and such happen
I would appreciate it.  I know this list probably consists of quite a few,
but any help is appreciated.  
<

AFAIK, WM_SETCURSOR is a message that is sent just after WM_CREATE, but is
usually passed to the DefWindowProc(). I think that this is a good place to
hide the cursor (and I think that FALSE, i.e. 0, is what it expects, not
NULL, i.e. (void *)0, even if they ultimately do the same thing).

BOOL FAR PASCAL MainWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM
lParam) {
	if(Msg == WM_SETCURSOR) {
		ShowCursor(FALSE); /* hide cursor */
		. . .
		return TRUE;
	}
	else if(Msg == WM_DESTROY) {
		ShowCursor(TRUE); /* show cursor */
		. . .
		return TRUE;
	}
	. . .
}

With DirectX, it is also important to know when your app is activated and
deactivated, but I'm still hacking my way around that one because I gave up
trying to figure out WM_ACTIVATE and WM_ACTIVATEAPP (for some reason, they
don't seem to work as documented, or at all, on my machine).

-[ Neil-Edelman -- dreaded.neil@phreaker.net -- ICQ UIN: 705130
-[ http://neil.freeshell.org/
-[ "Nature makes frequent use of [the infinite] everywhere" -Georg Cantor

=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once

To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html