📄 app.c
字号:
//======================================================
//颇老: App.c
//
//林力: 览侩橇肺弊伐 备炼眉 积己 窃荐 棺 荤侩磊 裹困 捞亥飘
// 贸府 窃荐 备泅
//
//汲疙:
// 局敲复 备炼眉 积己矫 傈开 按眉甫 葛胆傅窍扁 困茄
// 览侩橇肺弊伐 备炼眉 积己 窃荐 棺 荤侩磊 裹困 捞亥飘
// 贸府 窃荐 备泅
//
//累己磊:
// 2006.02. 冠蛮刮(eacs@paran.com)
//=======================================================
#include "std.h"
#include "App.h"
#include "port_test.h"
#include "port_test.bid"
static boolean AppHandleEvent(port_test *pMe, AEEEvent eCode,uint16 wParam, uint32 dwParam);
static boolean AppKeyHandleEvent(port_test *pMe, uint16 vKey, uint32 bitFlags);
int AEEClsCreateInstance(AEECLSID ClsId, IShell *pIShell, IModule *po, void **ppObj)
{
*ppObj = NULL;
if(AEECLSID_PORT_TEST == ClsId)
{
if(AEEApplet_New(sizeof(port_test),ClsId,pIShell,po,(IApplet **)ppObj,
(AEEHANDLER)AppHandleEvent,(PFNFREEAPPDATA)port_test_Free))
{
if(port_test_Init((port_test *)*ppObj))
{
return(AEE_SUCCESS);
}
else
{
IAPPLET_Release((IApplet *)*ppObj);
return(EFAILED);
}
}
}
return(EFAILED);
}
static boolean AppHandleEvent(port_test *pMe, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{
int i = pMe->eventSize;
if(eCode == EVT_KEY)
return AppKeyHandleEvent(pMe, wParam, dwParam);
do
{
--i;
if(pMe->pEventEntry[i].eCode == eCode)
return pMe->pEventEntry[i].pfnEventHandler((AEEApplet *)pMe, wParam, dwParam);
}while(i);
return FALSE;
}
static boolean AppKeyHandleEvent(port_test *pMe, uint16 vKey, uint32 bitFlags)
{
int i = pMe->keyEventSize;
do
{
--i;
if(pMe->pKeyEventEntry[i].vKey == vKey)
{
int ret;
if((ret = port_test_PreTranslateKey(&vKey, &bitFlags)) == -1)
return pMe->pKeyEventEntry[i].pfnKeyEventHandler((AEEApplet *)pMe);
else
return ret;
}
}while(i);
return(FALSE);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -