www.pudn.com > rDUNclientBeta1.zip > Window.h
//Window engine [window.h] //Copyright (C) Robert Merrison 2002 //This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License //as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. //This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied //warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. //You should have received a copy of the GNU General Public License along with this program; if not, write to the //Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef _WINDOW_H_ #define _WINDOW_H_ #include#include "debug.h" class cWindow{ public: cWindow( debug_engine* DebugObject = NULL ); virtual ~cWindow(); //Create the window int Create( HINSTANCE hInstance, HICON hIcon, HCURSOR hCursor, char* MenuName, char* ClassName, char* Caption, int x, int y, int Width, int Height, DWORD dwStyle ); //Pump a message off of the queue UINT PumpMessage( void ); //Destroy the window void Destroy( void ); //Static 'dummy' wndproc, required to be static by windows static LRESULT __stdcall StaticWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); //Real wndproc, passes messages on to appropriate handlers virtual LRESULT WndProc( UINT uMsg, WPARAM wParam, LPARAM lParam ); //Accessors int Width( void ){ return m_rcClient.right; }; //Get the width of the client area int Height( void ){ return m_rcClient.bottom; }; //Get the height of the client area RECT ClientRect( void ){ return m_rcClient; }; HWND HWnd( void ){ return m_hWnd; }; protected: //Message handler functions virtual LRESULT OnActivateApp ( bool bActive, DWORD dwThread ); virtual LRESULT OnCreate ( LPCREATESTRUCT createData ); virtual LRESULT OnSetCursor ( DWORD dwHitTest ); virtual LRESULT OnCommand ( WORD wNotificationCode, WORD wIdentifier, HWND hCtrl ); virtual LRESULT OnInitMenu ( HMENU hMenu ); virtual LRESULT OnEraseBkgnd ( HDC hDC ); virtual LRESULT OnPaint ( void ); virtual LRESULT OnDestroy ( void ); virtual LRESULT OnEnterMenuLoop ( bool bTrackPopupMenu ); virtual LRESULT OnExitMenuLoop ( bool bShortcutMenu ); virtual LRESULT OnKeyDown ( DWORD dwKey ); virtual LRESULT OnKeyUp ( DWORD dwKey ); virtual LRESULT OnSize ( WORD wWidth, WORD wHeight ); virtual LRESULT OnMove ( WORD x, WORD y ); virtual LRESULT OnUnknown ( UINT uMsg, WPARAM wParam, LPARAM lParam ); virtual void Log_Debug_Message ( short msg_type, char* message, ... ); //Debug engine interface HWND m_hWnd; //Window handler HINSTANCE* m_phInstance; RECT m_rcClient; //Client rectangle RECT m_rcScreen; //Screen rectangle bool m_bExists; //Has the window already been created? debug_engine* m_DebugObject; char m_Caption[128]; DWORD m_dwStyle; }; #endif