AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Window doesn't accept minimize after WinShow / WinActivate

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
thinkstorm



Joined: 17 Aug 2004
Posts: 18

PostPosted: Tue Jun 17, 2008 3:35 pm    Post subject: Window doesn't accept minimize after WinShow / WinActivate Reply with quote

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
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Wed Jun 18, 2008 6:31 pm    Post subject: Re: Window doesn't accept minimize after WinShow / WinActiva Reply with quote

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.

Smile
_________________


Last edited by SKAN on Thu Jun 19, 2008 5:44 am; edited 1 time in total
Back to top
View user's profile Send private message
thinkstorm



Joined: 17 Aug 2004
Posts: 18

PostPosted: Thu Jun 19, 2008 2:28 am    Post subject: Reply with quote

What kind of "Magic Number" do I look for? Where would I find it?
_________________
Cheers,

Thorsten
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Thu Jun 19, 2008 9:36 am    Post subject: Reply with quote



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.

Smile
_________________
Back to top
View user's profile Send private message
thinkstorm



Joined: 17 Aug 2004
Posts: 18

PostPosted: Thu Jun 19, 2008 3:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Thu Jun 19, 2008 6:07 pm    Post subject: Reply with quote

May I know the name of the Application ?. Is it downloadable ? Smile
_________________
Back to top
View user's profile Send private message
thinkstorm



Joined: 17 Aug 2004
Posts: 18

PostPosted: Fri Jun 20, 2008 6:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
thinkstorm



Joined: 17 Aug 2004
Posts: 18

PostPosted: Fri Jun 20, 2008 8:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group