lighter.c
来自「A comprehensive code to regulate the LCD」· C语言 代码 · 共 50 行
C
50 行
#include "Lighter.h"
#include "Lighter.bid"
/*===============================================================================
FUNCTION DEFINITIONS
=============================================================================== */
int AEEClsCreateInstance(AEECLSID ClsId, IShell *pIShell, IModule *po, void **ppObj)
{
*ppObj = NULL;
if( ClsId == AEECLSID_LIGHTER )
{
// Create the applet and make room for the applet structure
if( AEEApplet_New(sizeof(Lighter),
ClsId,
pIShell,
po,
(IApplet**)ppObj,
(AEEHANDLER)Lighter_HandleEvent,
(PFNFREEAPPDATA)Lighter_FreeAppData) ) // the FreeAppData function is called after sending EVT_APP_STOP to the HandleEvent function
{
//Initialize applet data, this is called before sending EVT_APP_START
// to the HandleEvent function
if(Lighter_InitAppData((Lighter*)*ppObj))
{
//Data initialized successfully
return(AEE_SUCCESS);
}
else
{
//Release the applet. This will free the memory allocated for the applet when
// AEEApplet_New was called.
IAPPLET_Release((IApplet*)*ppObj);
return EFAILED;
}
} // end AEEApplet_New
}
return(EFAILED);
}
static boolean Lighter_HandleEvent(Lighter* pMe, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{
switch (eCode)
{
case EVT_APP_START:
// 镱滹桉
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?