Using OnMessage to hide windows before they are displayed

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
blue_fields
Posts: 20
Joined: 16 Feb 2023, 11:07

Using OnMessage to hide windows before they are displayed

Post by blue_fields » 24 Mar 2023, 23:01

Hey everyone,

I'm finding the OnMessage documentation hard to wrap my head around, but I think it's what I need to get the functionality I'm looking for.

Does anyone know what the code would look like to have the OnMessage command intercept a WM_CREATE message for a specific pid or some sort of process/window identifier? (ideally other than window title, because I'm trying to hide an instance of Acrobat that is continually opening and closing files with different titles)

Thank you!!

User avatar
boiler
Posts: 16923
Joined: 21 Dec 2014, 02:44

Re: Using OnMessage to hide windows before they are displayed

Post by boiler » 24 Mar 2023, 23:35

OnMessage monitors messages sent to the script’s own windows — its main window or its GUI windows — not those of other applications.

XMCQCX
Posts: 230
Joined: 14 Oct 2020, 23:44

Re: Using OnMessage to hide windows before they are displayed

Post by XMCQCX » 25 Mar 2023, 01:59

You need to use Window Shell Hooks or Window Event Hooks. You can try the WinHook Class by FanaticGuru or look for "RegisterWindowMessage" and "SetWinEventHook" on the forum to see examples.
viewtopic.php?f=6&t=59149

Post Reply

Return to “Ask for Help (v2)”