示例#1
0
文件: key.cpp 项目: Jesna/jucpp
	bool Hotkey::UnRegister()
	{
		if(_Identity==0) return 0;
		if(!::UnregisterHotKey(0,_Identity)) return 0;
		Function<bool,MSG*> cb;
		cb.Bind(this,&Hotkey::_CallBack);
		MsgLoop::DelMsgHook(cb);
		return 1;
	}
示例#2
0
文件: key.cpp 项目: Jesna/jucpp
	bool Hotkey::Register(WORD id,int key,bool shift,bool ctrl,bool alt,bool win){
		if(_Identity) return 0;
		if(id==0) return 0;
		UINT mod = 0;
		if(shift) mod |= MOD_SHIFT;
		if(alt) mod |= MOD_ALT;
		if(ctrl) mod |= MOD_CONTROL;
		if(win) mod |= MOD_WIN;
		if(::RegisterHotKey(0,id,mod,key)){
			_Identity = id;
			Function<bool,MSG*> func;
			func.Bind(this,&Hotkey::_CallBack);
			MsgLoop::AddMsgHook(func);
			return 1;
		}
		return false;
	}
示例#3
0
文件: key.cpp 项目: Jesna/jucpp
	bool AccelTable::Stop()
	{
		Function<bool,MSG*> cb;
		cb.Bind(this,&AccelTable::_CallBack);
		return MsgLoop::DelMsgHook(cb);
	}
示例#4
0
文件: key.cpp 项目: Jesna/jucpp
	bool AccelTable::Start()
	{
		Function<bool,MSG*> func;
		func.Bind(this,&AccelTable::_CallBack);
		return MsgLoop::AddMsgHook(func);
	}