AppKit C# Wrapper for MacOS

[AppKit C# Wrapper for MacOS]

using MonoMac.AppKit;


namespace Blazor_MacOS_UI
{
    internal class NativeUtils
    {
        public static string GetActiveWindowTitle()
        {
            NSWorkspace sharedWorkspace = NSWorkspace.SharedWorkspace;
            NSRunningApplication currentApp = NSRunningApplication.CurrentApplication;

            // Get the process identifier of the frontmost (foreground) application
            int processIdentifier = currentApp.ProcessIdentifier;

            // Get the NSRunningApplication for the frontmost application
            NSRunningApplication frontmostApp = NSRunningApplication.GetRunningApplication(processIdentifier);

            // Get the localized name (title) of the frontmost application's main window
            string foregroundWindowTitle = frontmostApp.LocalizedName;

            return foregroundWindowTitle;
        }

    }
}

Mac Boot Menu

It’s been so long since I used Mac + Bootcamp, I forgot to boot holding Alt to bring up the Mac or Windows boot menu.

[Upgrade MacOS]

The highest version of MacOS that I can upgrade to on my Mac Mini is Catalina 10.15.7.

That means I can’t use Xcode from the App Store.

I can’t install MS Office from the App Store.

[Visual Studio For Mac]

[Install Brew]

brew install --cask dotnet-sdk

dotnet --version

dotnet new winforms
(That doesn’t exist on MacOS)

Hackintosh – [Getting started with OpenCore]