0

After using [NSRunningApplication unhide] the window of application does not unminimize. If I use[NSRunningApplication activateWithOptions: NSApplicationActivateIgnoringOtherApps] only application's menu appears on top. Also, if I manually hide application, [NSRunningApplication isHidden] always return false.

Am I missing something here?

To clarify what I want to do: I need to bring application to foreground by process Id. If application is not minimized, "activateWithOptions" works well, but if it is minimized, nothing really happens and "unhide" does nothing.

Xerxzes
  • 11
  • 1
  • You can hide an app and you can minimize a window. You can't unminimize an app or unhide a window. Did you try option `NSApplicationActivateAllWindows`? – Willeke Feb 01 '19 at 13:05
  • `NSApplicationActivateAllWindows ` produces the same result as `NSApplicationActivateIgnoringOtherApps`: Only app's menu appear on top. So, if I am getting you right, all I do is unhide an app, but window stays minimized. The question is then: how do I unminimize a window using something similar to `NSRunningApplication `? – Xerxzes Feb 01 '19 at 13:48
  • You can't, there is no `NSRunningApplicationWindow` class. See [Getting the main window of an app via an NSRunningApplication instance](https://stackoverflow.com/questions/1981453/getting-the-main-window-of-an-app-via-an-nsrunningapplication-instance/1981519#1981519) and [OSX / Objective C Window Management: manipulate the frames & visibility of other applications](https://stackoverflow.com/questions/17010638/osx-objective-c-window-management-manipulate-the-frames-visibility-of-other) – Willeke Feb 03 '19 at 23:15

0 Answers0