Prompting an app running in tray to create first window

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
potscrubber
Posts: 36
Joined: 09 Sep 2017, 01:51
Location: Aotearoa
Contact:

Prompting an app running in tray to create first window

Post by potscrubber » 19 Jan 2023, 02:23

Hello folks

My AHK acript is working with a 3rd party app, which stays resident and has an icon in the tray. I use a hotkey to have this app show and hide it's window.

WinShow, WinActivate and WinHide all work fine with it - but only for subsequent show/hide actions. When the app is first run, I have to "manually" create/show the window first (by clicking on the tray icon), for subsequent WinShow, WinActivate's to work.

Until recently, I could just execute the app again and it wouldn't create a second process instance, but would show it's window. A recent update changed that and now I end up with multiple processes (bad).

Does anyone know any general way to prompt an app to create it's main window via post or sendmessage?

Many thanks for any help.

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Prompting an app running in tray to create first window

Post by swagfag » 19 Jan 2023, 03:32

use spy++ and observe what messages are generated when u click on the tray icon. then try send-/postmessaging some of them and see if it does something

potscrubber
Posts: 36
Joined: 09 Sep 2017, 01:51
Location: Aotearoa
Contact:

Re: Prompting an app running in tray to create first window

Post by potscrubber » 19 Jan 2023, 04:34

Thanks for that swagfag, I just learnt something (Spy++).

Unfortunately, when focusing it's message capture on the aforementioned app main window or dominant ClassNN, it's as barren as a salt lake: not a single message. Compared to the voluminous flood of messages when focused on the Notepad window.

Are there any other methods I can probe this app? I managed to scrape it's menu wParam's with a GetMenu function I found, but nothing here creates the first window.

Thanks for any help!

potscrubber
Posts: 36
Joined: 09 Sep 2017, 01:51
Location: Aotearoa
Contact:

Re: Prompting an app running in tray to create first window

Post by potscrubber » 19 Jan 2023, 21:51

I also found this helpful function / class. Not sure yet if it works in Win 11.

Post Reply

Return to “Ask for Help (v1)”