Carbon is no good on 10.5 and later on 64-bit. Github user dportabella found a workaround in Cocoa[1], and I added code to make it handle the events from the dock, like the carbon version did. [1] https://github.com/signal11/hidapi/issues/14
Made a Mac Application Bundle (TestGUI.app) for this application. Handle dock actions properly for Quit and Show (single click) events.