Quantcast
Channel: AutoHotkey Community
Viewing all articles
Browse latest Browse all 579

Ask for Help (v2) • Re: Overriding other app's window style without a flash

$
0
0

I see, then I guess I'd also need to implement all the logic inside that DLL file. Do you know whether it's actually possible, though, not to only apply styles, but update window size/position, and, crucially, do all that before a window is shown?


Yes, the SetWinEventHookEx approach is doable, but the DLL needs to be written in a language other than AHK (C++ typically).

SetWinEventHook lets an application hook into its own windows to let that application handle the event. It runs code in the application which uses the same language as the application was written in. SetWinEventHookEx is a lower-level hook that basically runs a DLL on an event. The DLL needs to be in machine code so basically you need a true compiled language to get to that machine code.

You could probably create the DLL in C++ then use something like MCode in AHK to package and wrap it all in AHK. Because machine code is ready to go code, AHK can put it into memory and execute it. This is often done when you want the high level easy of using AHK but need speed, so you have AHK execute stuff like a machine code function. Although, it would be much easier to just have the DLL as a separate file for using SetWinEventHookEx.

At least that is my understanding, I am no expert only somewhat familiar.

Unless you are already pretty proficient in something like C++, I would look at trying to work out the kinks in the approach of running the application minimized, making changes, and then restoring the window.

FG

Statistics: Posted by FanaticGuru — 33 minutes ago



Viewing all articles
Browse latest Browse all 579

Trending Articles