Re: Disabling Exposé
Re: Disabling Exposé
- Subject: Re: Disabling Exposé
- From: stephane sudre <email@hidden>
- Date: Thu, 23 Sep 2004 17:36:24 +0200
On Sep 23, 2004, at 4:54 PM, Michael S. Barthelemy wrote:
I need to be able to programatically disable Exposé. I have tried the
standard way of changing the preference information via NSUserDefaults
without success. The changes are being written to the filesystem but
not used. Relaunches of System Preferences still show the old values
regardless of the values in the Preferences plist. Any hints or
pointers would be appreciated.
With the help of class-dump and otool.
To disable the hot keys for instance:
typedef Boolean (*prototype)(long, Boolean);
static Boolean sStatus=TRUE;
static prototype myPrototype=NULL;
sStatus=!sStatus;
if (myPrototype==NULL)
{
CFBundleRef tBundleRef;
CFURLRef tURLRef;
tURLRef=CFURLCreateWithFileSystemPath(kCFAllocatorDefault,CFSTR("/
System/Library/Frameworks/ApplicationServices.framework/Frameworks/
CoreGraphics.framework"),kCFURLPOSIXPathStyle,TRUE);
if (tURLRef!=NULL)
{
tBundleRef=CFBundleCreate(kCFAllocatorDefault,tURLRef);
if (tBundleRef!=NULL)
{
if (CFBundleLoadExecutable(tBundleRef)==TRUE)
{
myPrototype=(prototype)
CFBundleGetFunctionPointerForName(tBundleRef,CFSTR("CGSSetSymbolicHotKey
Enabled"));
}
}
}
}
if (myPrototype!=NULL)
{
int i;
for(i=0;i<256;i++)
{
myPrototype(i,sStatus);
}
}
I let you discover which value needs to be used for i as I don't have
the patience to to the dichotomy.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden