AutoHotkey Community

It is currently May 26th, 2012, 8:15 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: June 17th, 2008, 4:35 pm 
Offline

Joined: August 17th, 2004, 7:05 pm
Posts: 38
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


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 18th, 2008, 7:31 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
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.

:)

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Last edited by SKAN on June 19th, 2008, 6:44 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 3:28 am 
Offline

Joined: August 17th, 2004, 7:05 pm
Posts: 38
What kind of "Magic Number" do I look for? Where would I find it?

_________________
Cheers,

Thorsten


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 10:36 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Image

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.

:)

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 4:04 pm 
Offline

Joined: August 17th, 2004, 7:05 pm
Posts: 38
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 7:07 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
May I know the name of the Application ?. Is it downloadable ? :)

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2008, 7:10 pm 
Offline

Joined: August 17th, 2004, 7:05 pm
Posts: 38
It's X1, a desktop search engine. There is a 30-day trial downloadable on the website http://www.x1.com

_________________
Cheers,

Thorsten


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2008, 9:55 pm 
Offline

Joined: August 17th, 2004, 7:05 pm
Posts: 38
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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, poserpro, sjc1000, Yahoo [Bot] and 58 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group