Making an MFC application Mac OS X aware

mrt303xx at aol.com mrt303xx at aol.com
Wed Sep 26 08:06:14 CDT 2018


I want to do things differently or I guess in a Mac-like. I have the Wine version, but not if it is running Mac. If we are running on a Mac, then I would like to call a function that creates and installs the menu bar at the top of the application like Mac apps do. Currently, it sits in the application window. I would use a different background and font for Mac


Tarie



-----Original Message-----
From: Ken Thomases <ken at codeweavers.com>
To: mrt303xx <mrt303xx at aol.com>
Cc: wine-devel <wine-devel at winehq.org>
Sent: Mon, Sep 24, 2018 2:23 pm
Subject: Re: Making an MFC application Mac OS X aware

On Sep 24, 2018, at 10:52 AM, mrt303xx at aol.com wrote:
> 
> Is there any way to call functions in WINE to help an application act more natively on the Mac OS?

Do you mean you want to check if you're running on macOS and, if so, your own code will do things differently?  Or do you mean you want Wine to automatically behave more like a native Mac app?

For the former, Wine's ntdll exports a function, wine_get_host_version, which you can use to detect the host OS.  Use GetProcAddress() to obtain the function pointer.  The pointed-to function has the following signature:

void CDECL wine_get_host_version( const char **sysname, const char **release );

It is safe to pass NULL for either or both parameters.

The function is a wrapper around the uname() system function.  On macOS, if you provide sysname, it will store a pointer to the string "Darwin" to *sysname.


If you were asking about the latter, then Wine is already trying to behave as much like a native Mac app as it can while still being compatible with Windows apps.  What behavior are you looking to change?

-Ken


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20180926/7007354d/attachment-0001.html>


More information about the wine-devel mailing list