Click here to Skip to main content
15,892,697 members
Articles / Programming Languages / Objective C

Running State Machine Based Win32/WinCE Programs

Rate me:
Please Sign up or sign in to vote.
4.37/5 (9 votes)
17 May 20065 min read 70.9K   1.3K   35  
This article describes how to run state machine application framework based Win32/WinCE programs using the window message hooking technology. (Open source project)
/* UICtrl.c
*/

#include "UICtrl.h"

void UICtrlPostInternalEvent(long event_id,SME_APP_T *pApp){
	SME_EVENT_ID_T nEventId=event_id;
	SME_EVENT_T *pInteralEvent;
	pInteralEvent=SmeCreateIntEvent(nEventId,0,0,SME_EVENT_CAT_UI,pApp);
	SmePostEvent(pInteralEvent);
}

void UICtrlSetSoftkey(SOFTKEY_INFO_T* pSoftkey,
				   unsigned long sklStrId,SME_EVENT_ID_T sklEventId,
				   unsigned long skrStrId,SME_EVENT_ID_T skrEventId){
	pSoftkey->sklStrId=sklStrId;
	pSoftkey->sklEventId=sklEventId;
	pSoftkey->skrStrId=skrStrId;
	pSoftkey->skrEventId=skrEventId;
	pSoftkey->isDefined=TRUE;
}

void UICtrlLeftSoftKeyPress(SOFTKEY_INFO_T* pSoftkey){
	if(pSoftkey->isDefined)
		UICtrlPostInternalEvent(pSoftkey->sklEventId,NULL);
}

void UICtrlRightSoftKeyPress(SOFTKEY_INFO_T* pSoftkey){
	if(pSoftkey->isDefined)
		UICtrlPostInternalEvent(pSoftkey->skrEventId,NULL);
}

void UICtrlOnRightSoftKey(SOFTKEY_INFO_T* pSoftkey, SME_APP_T *pParentApp)
{
	if(pSoftkey->isDefined)
	{
		SME_EVENT_ID_T nEventId=pSoftkey->skrEventId;
		SME_EVENT_T *pInteralEvent;
		pInteralEvent=SmeCreateIntEvent(nEventId,0,0,SME_EVENT_CAT_UI,pParentApp);
		SmePostEvent(pInteralEvent);
	}
}


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


Written By
Web Developer
China China
Jerome. (Free to speak, free to use.)

Comments and Discussions