Sign in to follow this  
Followers 0
highend

Hide itself from taskbar?

3 posts in this topic

Hi,

I'm trying to write a simple script that checks if a process is still running and depending on the result, it copies a string to the clipboard. The application that shall make use of this (compiled) script is XYplorer, a file manager with scripting capabilities. It has one major drawback: It isn't able to run script commands in the background that are able to wait until they are finished before it executes the next command. Executing a script normally (not backgrounded) blocks it's user interface so you have to wait until the script has finished.

What would work: Using a while loop that checks if a special string (that are created by the compiled autoit script) is in the clipboard. If it detects the right one, it leaves the loop. So I'd like to let my XYplorer script execute the "run" command every second to let my autoit script do it's work, check for the given process name and write a new string to the clipboard.

E.g.:

$CheckProcess = "<xypath>\.Tools\CheckProcess\CheckProcess.exe";
$ProcessName = "notepad.exe";


$WaitForProcess = "-1";
while($WaitForProcess == -1){
  run """$CheckProcess"" ""$ProcessName""";
  $WaitForProcess = strpos("<clipboard>", "$ProcessName=false");
  wait 1000;
}

This is the autoit script:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#AutoIt3Wrapper_Res_Icon_Add=D:\Tools\.AutoIt\App\Icons\au3.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#comments-start
Receive a process name as a parameter and write $ProcessName=true/false to the clipboard.
    Optional: Receive a process name as a parameter and write true/false to a temp file.
#comments-end
If $CmdLine[0] = 0 Then
   ;MsgBox(0, "Script error", "No process name was supplied, aborted!")
   $ProcessName = "" ; Set variable to empty
   Exit
Else
   $ProcessName = $CmdLine[1] ; Get the name of the first (and only) parameter, the process name
EndIf
If ProcessExists($ProcessName) Then
   ClipPut($ProcessName & "=true")
Else
   ClipPut($ProcessName & "=false")
EndIf

How do I have to modify my autoit script, that it doesn't pop up in the taskbar every second (which is very annoying)?

Tia,

Highend

Share this post


Link to post
Share on other sites



Thank you John, works perfectly.

Share this post


Link to post
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
Sign in to follow this  
Followers 0