FROM : Steve Dekorte
DATE : Sun Jan 26 23:03:02 2003
Vince DeMarco wrote:
> Steve Dekorte wrote:
>> How can I programmatically find which web browser is set to be the
>> default in the System/Internet preferences?
> look up the function LSGetApplicationForURL()
Thanks for the response. Should this code work?:
{
char *URL = "file://somefile.htm";
FSRef appRef;
CFURLRef appURL;
CFStringRef urlStr = CFStringCreateWithCString(NULL, URL,
kCFStringEncodingASCII);
CFURLRef inURL = CFURLCreateWithString(NULL, urlStr, NULL);
OSStatus oss = LSGetApplicationForURL(inURL, kLSRolesEditor,
&appRef, &appURL);
CFStringRef s = CFURLGetString(appURL);
printf("appURL = %s\n", [(NSString *)s cString]);
}
I'm getting an access exception on CFURLGetString(). appURL is not NULL.
Cheers,
Steve
OSX freeware and shareware: http://www.dekorte.com/downloads.html
DATE : Sun Jan 26 23:03:02 2003
Vince DeMarco wrote:
> Steve Dekorte wrote:
>> How can I programmatically find which web browser is set to be the
>> default in the System/Internet preferences?
> look up the function LSGetApplicationForURL()
Thanks for the response. Should this code work?:
{
char *URL = "file://somefile.htm";
FSRef appRef;
CFURLRef appURL;
CFStringRef urlStr = CFStringCreateWithCString(NULL, URL,
kCFStringEncodingASCII);
CFURLRef inURL = CFURLCreateWithString(NULL, urlStr, NULL);
OSStatus oss = LSGetApplicationForURL(inURL, kLSRolesEditor,
&appRef, &appURL);
CFStringRef s = CFURLGetString(appURL);
printf("appURL = %s\n", [(NSString *)s cString]);
}
I'm getting an access exception on CFURLGetString(). appURL is not NULL.
Cheers,
Steve
OSX freeware and shareware: http://www.dekorte.com/downloads.html
| Related mails | Author | Date |
|---|---|---|
| Steve Dekorte | Jan 26, 21:28 | |
| Vince DeMarco | Jan 26, 22:11 | |
| Steve Dekorte | Jan 26, 23:03 | |
| Steve Dekorte | Jan 26, 23:39 | |
| Steve Dekorte | Jan 27, 00:00 | |
| Nick Zitzmann | Jan 27, 04:08 | |
| Vince DeMarco | Jan 27, 08:26 | |
| Jérôme Seydoux | Feb 3, 06:00 |






Cocoa mail archive

