Jump to content

Close running background application


Recommended Posts

Hi there,

I will use BGINFO as INFO tool for our customer and the default /TASKBAR switch will not work because i am working with WMI Querys.

BGINFO is a little bit scrapy and this Bug is only with WMI Query, when it runs without them it´s fine but then i don´t need AUTOIT. :)

I start my AUTOIT BGINFO script as an scheduled task after 1 Min. when user has logged in and by some it runs fine and by others the BGINFO stands open in Background and that is not user likely.

Here my script:

$SCRIPT = "C:\ProgramData\SysinternalsSuite\BGInfo\Bginfo.exe C:\ProgramData\SysinternalsSuite\BGInfo\local.bgi /TASKBAR /SILENT /NOLICPROMPT"
Run ($SCRIPT)
$TITLE = "BGInfo"
WinWait($TITLE,"",5)
Call ("_Middle",$TITLE)
Sleep(500)
WinWaitActive($TITLE)
ControlSend($TITLE,"","","!{F4}")
 

I send an ALT F4 to the Program but when this application is open and another program is overlayed them it will not close or minimize to taskbar.

What can i do the Close the BGINFO in Background or when another Application is running over the Window of BGINFO?

with best regards.

André

 

Link to comment
Share on other sites

Sorry but this make no sense. I will not END the BGINFO.EXE, i will only minimize the running Window of the Application. 

ALT + F4 is pressing X in the Window and then BGINFO go to TASKBAR but this doesn´t work in Background of open Window.

Link to comment
Share on other sites

  • Moderators

Apologies, I saw ALT+F4 (not to mention your title Close background application) and thought you were trying to close the process. If the window is visible as you state, you can grab the information with the AutoIt Window Info Tool (in the same directory where you installed AutoIt), and then use WinSetState to minimize it. If this does not minimize it to the task bar (haven't used BGINFO in years), you can still grab the window and then use ControlSend to send your ALT+F4. ControlSend sends to that particular window, whether it is on top or not.

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...