Jump to content

Programming for Palm OS/C/HelloWorld

From Wikibooks, open books for an open world
#include <PalmOS.h>

UInt32 PilotMain( UInt16 cmd, void *cmdPBP, UInt16 launchFlags)
{
  EventType  event;
  char       *message = "Hello, world!";

  if ( sysAppLaunchCmdNormalLaunch == cmd)
  {
    WinDrawChars( message, StrLen(message), 55, 74 );

    do {
      EvtGetEvent( &event, evtWaitForever);

      SysHandleEvent( &event);

    } while (event.eType != appStopEvent);
  }

  return 0;
}