Created
October 27, 2017 20:38
-
-
Save ccgus/7903cfd19605d1399f9cd8bc9d413d37 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSWorkspace *workspace = [NSWorkspace sharedWorkspace]; | |
NSDictionary *activeAppDict = [workspace activeApplication]; | |
ProcessSerialNumber psn; | |
psn.highLongOfPSN = [[activeAppDict objectForKey:@"NSApplicationProcessSerialNumberHigh"] intValue]; | |
psn.lowLongOfPSN = [[activeAppDict objectForKey:@"NSApplicationProcessSerialNumberLow"] intValue]; | |
SetFrontProcess( &psn ); | |
// this .. causes a bit o' recursion for some reason. | |
//ProcessSerialNumber xpsn = { 0, kCurrentProcess }; | |
//SetFrontProcess( & xpsn ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment