Archived

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

mdfmKoRn

DirectX Window not holding focus

Recommended Posts

S1CA    1418
1. Make sure the window occupies ALL of the screen area - even though D3D may be using all of the screen, if you create a small window, the window which has focus is still that small size! IIRC you should use a POPUP style with NO system menus etc.


2. In your window procedure, there are some messages to respond to (only do these if your app is fullscreen):


// tell Windows that any click in a non-client area of the
// window IS a click in the client area (i.e. inside your window
// rather than on the border/outside)
case WM_NCHITTEST:
return HTCLIENT;

// stop moves/sizes/screensavers etc and system menu clicks
case WM_SYSCOMMAND:
switch( wParam )
{
case SC_MOVE:
case SC_SIZE:
case SC_MAXIMIZE:
case SC_KEYMENU:
case SC_MONITORPOWER:
case SC_SCREENSAVE:
return 1; // tell Windows it can''t do it
break;
}
break;


--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites