Help ! Does anybody know how to keep this window from displaying when a program starts ?
I do not even know what it is so unable to research here on the forum.
Mystery window when program starts
Re: Mystery window when program starts
See: SetTimer example #1.
Re: Mystery window when program starts
@Xtra
@lexikos
Dear Xtra,
So appreciate your response and quite fond of SetTimer... I 'assume' you mean use SetTimer to close the rogue window if it is present... I will try that if necessary...
I was hoping to understand WHAT that window was so I could try to search for a pre-emptive resolution... As of this writing I have no idea what to search on because I have never seen it before and know not what to call it...
To that end, and staying within the confines of this request, I am hoping that lexikos can spare a moment to help me understand... I would hope to know what to avoid or instantiate before it pops up intermitently...
Many thanks.
@lexikos
Dear Xtra,
So appreciate your response and quite fond of SetTimer... I 'assume' you mean use SetTimer to close the rogue window if it is present... I will try that if necessary...
I was hoping to understand WHAT that window was so I could try to search for a pre-emptive resolution... As of this writing I have no idea what to search on because I have never seen it before and know not what to call it...
To that end, and staying within the confines of this request, I am hoping that lexikos can spare a moment to help me understand... I would hope to know what to avoid or instantiate before it pops up intermitently...
Many thanks.
Re: Mystery window when program starts
It's unclear what you are asking. So, this is your own AHK script showing the window?
I guess you should show some code that allows to reproduce the problem...
I guess you should show some code that allows to reproduce the problem...
Re: Mystery window when program starts
Hello @gregster ,
Thanks for taking a crack at this. My code:
The result:
Do you even know what the heck that window is? Seems like some sort of information window. Again, have never seen it before and hoping to give it a 'name'.
As you can see, it is the latest version of AHK_L compiled to 64-Bit running from a network shared folder.
Thanks for taking a crack at this. My code:
Code: Select all
#SingleInstance , Force
#NoEnv
#NoTrayIcon
#Persistent
DetectHiddenWindows , On
Gui , 1:New , , Get Rid Of Extra Window
Gui , 1:Margin , 8 , 8
Gui , 1:Add , Text , xm ym w0320 Center , How do I get rid of that other window at startup ?
Gui , 1:Show
WinGet , id , List , , , Program Manager
Loop %id%
{
this_id := id%A_Index%
WinGetTitle, title, ahk_id %this_id%
If ( title = "" )
continue
WinGet, Style, Style, ahk_id %this_id%
if !( Style & 0x10000000 ) ; WS_VISIBLE
continue
listOfWindows .= title ? title "`n" : ""
}
MsgBox , 4096 , %A_AhkVersion% is 64 %A_Is64bitOS% , % listOfWindows
return
GuiClose:
ExitApp
return
Do you even know what the heck that window is? Seems like some sort of information window. Again, have never seen it before and hoping to give it a 'name'.
As you can see, it is the latest version of AHK_L compiled to 64-Bit running from a network shared folder.
Re: Mystery window when program starts
That's the script's main window (each script has it - it's usually hidden, unless you - for example - double-click the uncompiled script's systray icon, or choose 'Open' from its context menu; or you use some command like ListLines to call it up - the latter works for compiled ones, too.).
Why your compiled script would show it, we'll have to see. From your posted code, I don't see a reason yet.
Is this really your complete code, or does this code really show that window?
Edit: Sorry, I can't reproduce it with the code you showed. There must be something else going on - more relevant code, other scripts... Do you have other code in your script which unhides certain windows?
Why your compiled script would show it, we'll have to see. From your posted code, I don't see a reason yet.
Is this really your complete code, or does this code really show that window?
Edit: Sorry, I can't reproduce it with the code you showed. There must be something else going on - more relevant code, other scripts... Do you have other code in your script which unhides certain windows?
Re: Mystery window when program starts
Hello @gregster,
Yes, that is the complete code. I can not reproduce on my Windows system either. In this case it is running as a published application on a virtual server so that is causing this anomalous behaviour; as noted, intermittently.
Thank you so much for revealing that it is the "script's main window" and referencing "Listlines". I am starting to read and research those hoping there is some command line or other instruction to keep it from popping up in the first place.
Xtra suggested SetTimer which I understand, but that is a brute force method. Would really like to 'tell' the 'Main Window' to just stay away altogether
Again, thank you so much for your time, and I welcome any other thoughts or insights that you can offer.
Yes, that is the complete code. I can not reproduce on my Windows system either. In this case it is running as a published application on a virtual server so that is causing this anomalous behaviour; as noted, intermittently.
Thank you so much for revealing that it is the "script's main window" and referencing "Listlines". I am starting to read and research those hoping there is some command line or other instruction to keep it from popping up in the first place.
Xtra suggested SetTimer which I understand, but that is a brute force method. Would really like to 'tell' the 'Main Window' to just stay away altogether
Again, thank you so much for your time, and I welcome any other thoughts or insights that you can offer.
Re: Mystery window when program starts
I rarely compile or use compiled scripts - perhaps someone else has seen this before.
Btw, closing this main window will also close the complete script, afaik. So if you do something with it, you should just hide it again.
Btw, closing this main window will also close the complete script, afaik. So if you do something with it, you should just hide it again.
Re: Mystery window when program starts
If you click the close button, it is designed to hide rather than close the window. The script will terminate if it is closed by some other means.
You can "permanently" prevent the window from being shown by making it a message-only window:
This also hides it from view by WinTitle and other programs enumerating top-level windows. I'm not entirely sure whether there's any other way to find the window if you don't have the HWND.
You can "permanently" prevent the window from being shown by making it a message-only window:
Code: Select all
DllCall("SetParent", "ptr", A_ScriptHwnd, "ptr", HWND_MESSAGE := -3)
Re: Mystery window when program starts
O H M Y G A W D ! ! !
Thank you so much @lexikos
It worked !!! The main window is NOT showing... I think not at all... At least not so far...
Once again, zero chance I would have solved by myself...
Totally appreciated...
Thank you so much @lexikos
It worked !!! The main window is NOT showing... I think not at all... At least not so far...
Once again, zero chance I would have solved by myself...
Totally appreciated...