I have had a lot of trouble with this one! I use a window class (a C++ class) that I built myself. Here's a declaration of the class:
// Window.h: interface for the Window class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_Window_H__77FCF0A0_C131_11D3_A1DD_0050BAB009EE__INCLUDED_)
#define AFX_Window_H__77FCF0A0_C131_11D3_A1DD_0050BAB009EE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class Window
{
public:
enum ZOrder {
Top,
TopMost,
Normal,
Bottom,
};
typedef struct Size {
int nWidth;
int nHeight;
};
typedef struct Position {
int nX;
int nY;
};
public:
Window();
virtual ~Window();
// Expose the object.
HWND GetHandle();
// Create and destroy the window.
virtual void Create(LPCSTR, DWORD, DWORD, int, int, int, int, int);
virtual void Destroy();
// Set the size, position, and z-order.
void SetSize(int, int);
void SetPosition(int, int);
void SetZOrder(ZOrder);
// Get the size, position, and z-order.
Size GetSize();
Position GetPosition();
ZOrder GetZOrder();
// Set the show state of the window.
void Show();
void Hide();
void Restore();
void Minimize();
void Maximize();
// Directly modify style attributes (advanced).
void SetStyle(LONG);
// Set and destroy a WM_TIMER.
UINT SetTimer(UINT, UINT);
void KillTimer(UINT);
// Retrieves windows with a specific relationship.
Window* GetOwner();
Window* GetChild(UINT);
// Retrieves the child ID of the window.
UINT GetID();
// The Windows window callback procedure.
static LRESULT Procedure(HWND, UINT, WPARAM, LPARAM);
protected:
// Handle window messages.
virtual LRESULT OnMessage();
inline LRESULT Default();
protected:
HWND m_hWnd;
UINT m_nMsg;
WPARAM m_wParam;
LPARAM m_lParam;
};
LRESULT Window:: Procedure(HWND, UINT, WPARAM, LPARAM);
#endif // !defined(AFX_Window_H__77FCF0A0_C131_11D3_A1DD_0050BAB009EE__INCLUDED_)
The Window:: Procedure is a static function that is assigned in a generic WNDCLASS structure. It implements all message-handling for the class via virtual Window:: OnMessage(), but I won't spoil the fun by telling you how it's done!

(Gurus, don't spoil it for the newbies!)
The Problem:
Whenever I use DX in fullscreen mode, the program crashes Windows (I mean the keyboard and everything locks up!!), but windowed mode works fine.
TIP: DX is initialized properly.
Can anybody figure out what's wrong with this?
P.S. Anybody who can figure it out gets the source code for the class! (as if anyone really wanted it anyway...) I already have the problem solved but wanted to see if anyone else could figure it out.
- null_pointer
Edited by - null_pointer on 1/13/00 9:41:31 AM