www.gusucode.com > 老调重提,面向对象技术在SDK中的应用C++源码程序 > 老调重提,面向对象技术在SDK中的应用/sdkdemo/SDKDemo/LWinEx.cpp
///////////////////////////////////////////////////////////////////////////// // // File Name : LWinEx.cpp // // Description : // // Author : L.F. // Date : // ///////////////////////////////////////////////////////////////////////////// #include "StdAfx.h" #include "resource.h" #include "LWinEx.hpp" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // Global ///////////////////////////////////////////////////////////////////////////// // Construction and destruction CLWinEx::CLWinEx() { } CLWinEx::~CLWinEx() { } ///////////////////////////////////////////////////////////////////////////// // Method implementation ///////////////////////////////////////////////////////////////////////////// // Virtual function override VOID CLWinEx::OnCommand( HWND hWnd, WORD wID, WORD wNotifyCode ) { if ( wID == IDM_FILE_EXIT ) { MessageBox( m_hwnd, TEXT( "MENU EXIT" ), TEXT( "COMMAND" ), MB_ICONINFORMATION ); } } VOID CLWinEx::OnPaint( HDC hdc ) { RECT rc; GetClientRect( m_hwnd, & rc ); DrawText( hdc, TEXT( "HELLO ! MY WINDOW CLASS " ), -1, & rc, DT_SINGLELINE | DT_CENTER | DT_VCENTER ); }