ltweight.h

来自「Window Wrapper for WinCE Win32 "Hello Wo」· C头文件 代码 · 共 79 行

H
79
字号
//***************************************************************************
//  LtWeight.h
//***************************************************************************

#if !defined(AFX_LTWEIGHT_H__FA718A27_5CF0_495F_AA73_647E2A616636__INCLUDED_)
#define AFX_LTWEIGHT_H__FA718A27_5CF0_495F_AA73_647E2A616636__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "resource.h"

#define MENU_HEIGHT 26

// Getting and Setting WindowLong: default is GWL_USERDATA
template <class T>
inline T WinGetLong( HWND hwnd, int which = GWL_USERDATA )
{
   return reinterpret_cast<T> ( ::GetWindowLong( hwnd, which ) );
}


class CBaseWindow
{
public:
   CBaseWindow(){hInst=0;}
   ~CBaseWindow(){}

   HWND              hWnd;                // The main window handle
   BOOL              DlgFlag;             // True if object is a dialog window

   static LRESULT CALLBACK BaseWndProc( HWND hwnd, UINT msg,
                                        WPARAM wParam, LPARAM lParam );

protected:

   HINSTANCE         hInst;               // The current instance
   HWND              hwndCB;              // The command bar handle

   HINSTANCE         GetInstance () const { return hInst; }
   virtual LRESULT   WndProc( HWND hwnd, UINT msg,
                              WPARAM wParam, LPARAM lParam,
                              PBOOL pbProcessed ){*pbProcessed = FALSE; return NULL;}
};


class CMainWindow : public CBaseWindow
{
public:
   CMainWindow(){}
   ~CMainWindow(){}

   BOOL InitInstance( HINSTANCE hInstance, int nCmdShow );

protected:
   HWND              CreateRpCommandBar( HWND );
   ATOM              MyRegisterClass( HINSTANCE, LPTSTR );

   virtual LRESULT   WndProc( HWND hwnd, UINT msg,
                              WPARAM wParam, LPARAM lParam,
                              PBOOL pbProcessed );
};


class CAboutWindow : public CBaseWindow
{
public:
   CAboutWindow(){}
   ~CAboutWindow(){}

protected:
   virtual LRESULT   WndProc( HWND hwnd, UINT msg,
                              WPARAM wParam, LPARAM lParam,
                              PBOOL pbProcessed );
};

#endif // !defined(AFX_LTWEIGHT_H__FA718A27_5CF0_495F_AA73_647E2A616636__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?