Building applications — Coding an application 61
Developer’s Guide – RIM 950 Wireless Handheld™
static
void
set_task_pid( void )
{PID pid;
pid.Name = "Example Application";
pid.EnableForeground = true;
pid.Icon = NULL;
RimSetPID( &pid );
}
// Function which creates the main thread
void
PagerMain( void )
{MESSAGE msg;
set_task_pid();
// Yield to let other applications initialize
RimTaskYield();
// Register the application with the Ribbon so an
// icon is shown on the main screen
RibbonRegisterApplication( "Database Sample",
&bitmapSample, 0, 0 );
// Initialization complete: set up LCD and
// enter message loop
for (;;) {
RimGetMessage( &msg );
// respond to events
switch( msg.Device ) {
case DEVICE_SYSTEM:
// handle SYSTEM messages
break;
case DEVICE_TIMER:
// handle TIMER messages
break;
case DEVICE_KEYPAD:
// handle KEYPAD messages
break;
}
}
}