| View previous topic :: View next topic |
| Author |
Message |
thinkstorm
Joined: 17 Aug 2004 Posts: 18
|
Posted: Tue Jun 17, 2008 3:35 pm Post subject: Window doesn't accept minimize after WinShow / WinActivate |
|
|
Hello,
I have a hidden application window (X1.exe), Style 0x06CF0000. The window is neither maximized nor minimized.
When I use something like
| Code: | SetTitleMatchMode, 1
WinShow, X1 - ahk_class TDesktopMainForm
WinActivate
|
The window shows and gets activated (one would expect, right? :)), now with Style 0x16CF0000. But then it doesn't show in the task bar, and the minimize or close system icons (upper right window corner) as well as ALT-SPACE n etc. don't work. The window is basically stuck.
On the other hand, when I open the window through the system tray icon, the window does show in the task bar, Style 0x16CF0000. Also: when I use Process Explorer by SysInternals I can press the "Bring To Front" button, which works fine.
So which codes am I missing? Which PostMessage code do I need to send? _________________ Cheers,
Thorsten |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6264
|
Posted: Wed Jun 18, 2008 6:31 pm Post subject: Re: Window doesn't accept minimize after WinShow / WinActiva |
|
|
| thinkstorm wrote: | | The window is basically stuck. |
Many such tray apps behave strange when not activated from tray menu.
| Quote: | | Which PostMessage code do I need to send? |
You may try opening the exe in ResHacker and see if there are any magic numbers under Menu.
 _________________

Last edited by SKAN on Thu Jun 19, 2008 5:44 am; edited 1 time in total |
|
| Back to top |
|
 |
thinkstorm
Joined: 17 Aug 2004 Posts: 18
|
Posted: Thu Jun 19, 2008 2:28 am Post subject: |
|
|
What kind of "Magic Number" do I look for? Where would I find it? _________________ Cheers,
Thorsten |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6264
|
Posted: Thu Jun 19, 2008 9:36 am Post subject: |
|
|
As seen in the above screenshot, 65405 is the magic number that can quit any running AHK script.
See the following post where I use these numbers to control all running AHK scripts from one master script.
However, this would apply only to those tray apps that has a GUI and regular drawn Menu.
 _________________
 |
|
| Back to top |
|
 |
thinkstorm
Joined: 17 Aug 2004 Posts: 18
|
Posted: Thu Jun 19, 2008 3:04 pm Post subject: |
|
|
Ah, got it!
Now the problem is, that I don't want to EXIT the program -- if I select "exit" from the menu, it will actually shut down the application. If I select "minimize" or "close" from the ALT-SPACE menu (or use the title-bar system buttons), the application will get shoved back into the system notification area.
Tricky problem, this.... _________________ Cheers,
Thorsten |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6264
|
Posted: Thu Jun 19, 2008 6:07 pm Post subject: |
|
|
May I know the name of the Application ?. Is it downloadable ?  _________________
 |
|
| Back to top |
|
 |
thinkstorm
Joined: 17 Aug 2004 Posts: 18
|
Posted: Fri Jun 20, 2008 6:10 pm Post subject: |
|
|
It's X1, a desktop search engine. There is a 30-day trial downloadable on the website http://www.x1.com _________________ Cheers,
Thorsten |
|
| Back to top |
|
 |
thinkstorm
Joined: 17 Aug 2004 Posts: 18
|
Posted: Fri Jun 20, 2008 8:55 pm Post subject: |
|
|
Got it (Thanks to Molotov from the Microsoft Sysinternals forum!!!!): The problem was that the TDesktopMainForm is simply the wrong window class - the right class was TApplication. Silly me.
Here's the code:
| Code: | RestoreX1Window()
{
DetectHiddenWindows, On
SetTitleMatchMode, 1
WinGet, hwnd, ID, X1 - ahk_class TApplication
If hwnd
{
WinRestore, ahk_id %hwnd%
;SendMessage, 0x112, 0xf120,,,ahk_id %hwnd%
} else {
Run, C:\Program Files\X1\X1.exe
}
} |
_________________ Cheers,
Thorsten |
|
| Back to top |
|
 |
|