View Single Post
Old 03-09-21, 05:33 PM   #10
themrwho
Torpedoman
 
Join Date: Jul 2010
Posts: 119
Downloads: 141
Uploads: 0


Default

I did some further research into this yesterday, I would like to share results below in case someone out there who has experience with Windows API/MFC/whatever-else-is-in-play-here wants to lend experience.

Found a potential hack as described in the 1st link below - it is essentially sending WM_ACTIVATE message to the window as per official Microsoft documentation in the 2nd URL. I have so far no evidence that this is implemented in the gamecode so I was not super hopeful but was thinking it's probably worth a try, what would I lose.

I still didn't get a chance to implement it in C++ but did look into quickly testing it with a 2 line AHK script as I noticed it is in the AutoHotkey message list (3rd URL).

Test result: basic messaging via AHK does work, at least it works for some messages (e.g.: WM_CLOSE/0x0010 indeed closes SH4 application just fine). Unfortunately sending WM_ACTIVATE via AHK did nothing.

At then end of the day, while I am not anywhere close to fixing the original problem described in the title of this thread, one good (practical) thing came out of all this effort... I discovered that I can message the game window with hide/unhide signals (easiest way would be using AHK and WinHide/WinShow signals). The practical implementation would be: "boss key" or in my case, more like "boss shortcut". During the day sometimes I fire up and play sh4 for short amount of time but the darn window is always on top thus it takes away 50% of my screen estate on a dual screen setup, forcing me to close the game as soon as I need to do something else on that screen. With this boss-shortcut hack, I can now press a key-combo to hide it completely. And, later on, press the same key-combo bring it back maybe 10 minutes later or maybe 5 hours later, after work hours. Less loading time, more playing time!

Links
1) https://stackoverflow.com/a/45496600
2) https://docs.microsoft.com/en-us/win...ev/wm-activate
3) https://www.autohotkey.com/docs/misc...essageList.htm
themrwho is offline   Reply With Quote