accelerator.h

来自「c+++ game uploading now」· C头文件 代码 · 共 42 行

H
42
字号
/**
 @file
 Interface of the Win::Accelerator class
*/
#if !defined _ACCELERATOR_H_
#define _ACCELERATOR_H_
#include "WinException.h"

namespace Win
{
    /**
      realizes the win32 keyboard accelerator. */ 
    class Accelerator
    {
    public:
        /**
           Constructor
           @param hInstance is a handle to the application instance.
           @param lpTableName identifies the accelerator table used.
           @exception throws Win::Exception upon failure.*/
        Accelerator(HINSTANCE hInstance, LPCTSTR lpTableName)
        {
            if(0==(_haccel=::LoadAccelerators(hInstance, lpTableName)))
                throw Win::Exception("Failed to load accelerator table.");
        }

        /**
            type conversion to HACCEL */
        operator HACCEL() 
        { 
            return _haccel; 
        }
    private:

        /**
            accelerator handle */
        HACCEL _haccel;
    };
}
#endif //_ACCELERATOR_H_

⌨️ 快捷键说明

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