Created
July 17, 2015 04:16
-
-
Save yamamushi/362342652b12aabcb16b to your computer and use it in GitHub Desktop.
macsupport.m
This file contains 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
#import "macsupport.h" | |
/* Portions of CPS.h */ | |
typedef struct CPSProcessSerNum | |
{ | |
UInt32 lo; | |
UInt32 hi; | |
} CPSProcessSerNum; | |
extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); | |
extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 | |
_arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); | |
extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); | |
void CustomSDLMain() | |
{ | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
[ NSApplication sharedApplication ]; | |
[ NSApp setMainMenu:[[NSMenu alloc] init] ]; | |
{ | |
CPSProcessSerNum PSN; | |
/* Tell the dock about us */ | |
if (!CPSGetCurrentProcess(&PSN)) | |
if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) | |
if (!CPSSetFrontProcess(&PSN)) | |
[NSApplication sharedApplication]; | |
} | |
[pool release]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment