Click here to Skip to main content
15,892,005 members
Articles / Programming Languages / C++

Create Cross-platform Thread-Independent Event Loops

Rate me:
Please Sign up or sign in to vote.
4.89/5 (5 votes)
12 May 20076 min read 45.8K   687   28  
This article discloses what is behind the GetMessage() and PostThreadMessage() Windows API, and implements them on Linux and Windows platforms using basic operation system functions.
/*
FILE:EventId.h
NOTE: The State Machine Wizard will add mapping macros between /*{{ and /*}}. Do NOT modify manually.
*/

#ifndef EVENTID_H
#define EVENTID_H

#include "sme.h"

#ifdef __cplusplus
extern "C" {
#endif

enum
{
	/*{{SME_EVENT_ID_LIST_DECLARE*/
	// External event
	EXT_EVENT_ID_POWER=1,
	EXT_EVENT_ID_PAUSE_RESUME=2,
	/*}}SME_EVENT_ID_LIST_DECLARE*/
};

#ifdef __cplusplus
}
#endif

#endif

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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
United States United States
Alex "Question is more important than the answer."

Comments and Discussions