1. Hey! Guest! The XXX GMC Jam will take place between August 24th, 12:00 UTC (Friday noon) and August 27th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

(macOS, C++) how to get active window's title bar text?

Discussion in 'Advanced Programming Discussion' started by Samuel Venable, Aug 5, 2018.

  1. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    880
    The title of this topic is what I need as one of the last steps to finishing the Mac port to my DialogModule extension. I'd rather not make use of CoCoa because I heard Apple will be replacing that soon. All I need to know is the function name and required header. Then I'll look it up and try to do the rest. I've looked everywhere online about this and there seems to be next to no documentation on macOS C++ development.

    Everything I could find seems to be about either Swift or Objective-C. But I am using C++, as it is much better than Apple's crap-languages. I've tried doing it with AppleScript run from a popen call as well but without success, it always returns "Mac_Runner", and not the actual title bar text, just the application bundle's executable name.

    Thanks!
    Samuel
     
  2. Tthecreator

    Tthecreator Your Creator!

    Joined:
    Jun 20, 2016
    Posts:
    697
    mm if all fails you might need to pass window_get_caption(); into your dll from game maker or do you need to do some more manipulation on the window?
     
  3. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    880
    This is a library that I am also using outside of the GameMaker world, so I need everything to be done within the dylib itself.
     
  4. Tthecreator

    Tthecreator Your Creator!

    Joined:
    Jun 20, 2016
    Posts:
    697
    Well Apple is Apple I guess and when they want you to something their way they will make sure it goes their way.
    They just don't have these kind of frameworks for cpp. You might need to cobble some weird objective-c/cacao library and call that from your cpp library.

    It seems you can just compile your cpp code using objective-c (https://stackoverflow.com/questions/2710507/mixing-objective-c-and-c) So maybe that is an option? Just have one .mm file act as wrapper for these critical functions you absolutely need? It seems to be the only option I can think of at this point. (unless you like reverse engineering Apple products;))
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice