I just put this in VP's main.m file. Someone else might find it useful:
NSWorkspace *workspace = [NSWorkspace sharedWorkspace]; NSArray *launchedApplications = [workspace launchedApplications];
for (NSDictionary *junk in launchedApplications) { if ([@"com.flyingmeat.VoodooPad_Pro" isEqualToString:[junk objectForKey:@"NSApplicationBundleIdentifier"]]) { NSLog(@"It's already running you moron"); ProcessSerialNumber psn; psn.highLongOfPSN = [[junk objectForKey:@"NSApplicationProcessSerialNumberHigh"] intValue]; psn.lowLongOfPSN = [[junk objectForKey:@"NSApplicationProcessSerialNumberLow"] intValue]; SetFrontProcess( &psn ); NSBeep(); sleep(.5f); // let the beep actually happen. return 0; } }
#endif