A sample thread function:
#define DATAUPDATE1 0 #define DATAUPDATE2 1 void MyThreadFunc() { while (continueToRun) { if (DataAvailable()) ShapeUp_WantUpdate(DATAUPDATE1); ... } }
You can use different values as user data for the call to ShapeUp_WantUpdate() to distinguish different tasks.
A sample of the hook function might look like:
SURESULT __cdecl MyHookFunc(SUHANDLE hWorkspace, int hookType, SUHookData *args) { // Here we are synchronized with the ShapeUp main thread, and we can call // any ShapeUp function. switch (hookType) { case HOOKTYPE_WANTUPDATE: switch (args->userData) { case DATAUPDATE1: ReadData1AndDoSomething(); break; case DATAUPDATE2: ReadData2AndDoSomething(); break; default: break; } break; default: break; } return SURESULT_OK; }