- ProcessSerialNumber psn ;
- Boolean isSame ;
- psn.highLongOfPSN = 0 ;
- psn.lowLongOfPSN = kCurrentProcess ;
- SameProcess( &gAppProcess , &psn , &isSame ) ;
- if ( isSame )
- {
- PostEvent( nullEvent , 0 ) ;
- }
- else
- {
- WakeUpProcess( &gAppProcess ) ;
- }
+ ProcessSerialNumber psn ;
+ Boolean isSame ;
+ psn.highLongOfPSN = 0 ;
+ psn.lowLongOfPSN = kCurrentProcess ;
+ SameProcess( &gAppProcess , &psn , &isSame ) ;
+ if ( isSame )
+ {
+#if TARGET_CARBON
+ EventRef dummyEvent ;
+ OSStatus err = MacCreateEvent(nil, 'WXMC', 'WXMC', GetCurrentEventTime(),
+ kEventAttributeNone, &dummyEvent);
+ if (err == noErr)
+ {
+ err = PostEventToQueue(GetMainEventQueue(), dummyEvent,
+ kEventPriorityHigh);
+ }
+#else
+ PostEvent( nullEvent , 0 ) ;
+#endif
+ }
+ else
+ {
+ WakeUpProcess( &gAppProcess ) ;
+ }