V0.0.1.x is up
there.
This is version 0.0.2.x:Added: At great expense I had a custom icon designed just for this program ... I'm not sure the graphic artist entered into the spirit of the request
(Then again, since it's a CLI only program did I waste my money?)
Added: Can set optional text to display, limited to 30 characters.
Added: Can set background colour.
Changed: It now takes one command line argument which is a config file.
Usage: Main difference with this version is it just takes a config file as the argument, eg.
BlankIt.exe test.iniThis means, for example, you no longer need a number of long lines in a batch file. You can have any number of config files and just call the one you want.
If you run the program without any arguments, a example config file called BlankIt.ini will be created - you can then edit it, rename it, or use it as is if you want Notepad.exe to open, (
BlankIt.exe BlankIt.ini).
Here's the contents of the example:
[Settings]
Program="C:\Windows\System32\notepad.exe"
Timeout=10
Colour=000000
Text=Wait for it!
Program is the program to run, full path required unless it's in the same directory as BlankIt.exe.
Timeout is the maximum time in seconds the blank screen will be displayed if the Process.WaitForIdleInput fails or the program has no GUI. Maximum value is 180 seconds, if it's more than that or the equivalent of 0 then the default will be 15.
Colour is a RGB hex value, here's a
list. If it's input incorrectly, (ie. not a valid hex value), then it will default to black, (000000). The text colour will be white for all values 7FFFFF and below, and black for all values 800000 and above.
Text can be left empty, ie. no text will be displayed. The limit is 30 characters which fits in the width of a 1680 pixel screen, and honestly if you need to display more than 30 characters, chances are there might not be enough time to read them all.
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=BlankIt.ico
#AutoIt3Wrapper_Outfile=BlankIt.exe
#AutoIt3Wrapper_Change2CUI=y
#AutoIt3Wrapper_Res_Fileversion=0.0.2.30
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.10.2
Name: BlankIt.au3
Author: 4wd
Script Function:
Blanks screen until called programs GUI opens and is ready for input.
Requires:
Ascend4nt's Process Function UDF: http://www.autoitscript.com/forum/topic/115352-process-thread-dll-functions-udfs/
Yashied's WinAPIEx UDF: http://www.autoitscript.com/forum/topic/98712-winapiex-udf/
#ce ----------------------------------------------------------------------------
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WinAPIEx.au3>
#include <WindowsConstants.au3>
#include "[includes]\_ProcessFunctions.au3"
Opt('MustDeclareVars', 1)
Const $iAccess = 0x00001000
If $CmdLine[0] = 0 Then _Usage
()
Local $sIniFile = $CmdLine[1] _Usage()
_GetINI($sIniFile)
#Region ### START Koda GUI section ### Form=
#forcedef $iTextCol, $iColour, $sText
#EndRegion ### END Koda GUI section ###
_Main()
_Exit()
Global $sProgram, $sPath, $iTimeout, $iColour, $sText, $iTextCol $sProgram = IniRead($sFile, "Settings", "Program", "") _Exit()
$sProgram = $sPath & $sProgram
$iTimeout = IniRead($sFile, "Settings", "Timeout", "15") If $iTimeout < 1 Or $iTimeout > 180 Then $iTimeout = 15 $iTimeout *= 1000
$iColour = "0x" & IniRead($sFile, "Settings", "Colour", "000000") $iColour = "0x" & Hex($iColour, 6) $iColour = "0x000000"
$iTextCol = 0x000000
$iTextCol = 0xFFFFFF
Local $hProcess = _ProcessOpen
($iPID, $iAccess) _ProcessWaitForInputIdle($hProcess, $iTimeout)
_ProcessCloseHandle($hProcess)
Local $Data = _WinAPI_EnumProcessWindows
($iPID) _WinAPI_SetFocus($Data[1][0])
Local $aDemo[4][2] = [["Program", '"C:\Windows\System32\notepad.exe"'],["Timeout", 10],["Colour", "000000"],["Text", "Wait for it!"]] _Exit()
And that's pretty much it until someone says something.