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]
If Not FileExists($sIniFile) Then
_Usage()
Else
_GetINI($sIniFile)
EndIf
#Region ### START Koda GUI section ### Form=
GUICreate("Blank", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
#forcedef $iTextCol, $iColour, $sText
GUICtrlSetDefColor($iTextCol)
GUISetFont(48, 600)
GUICtrlCreateLabel($sText, 10, Int(@DesktopHeight/2 - 34), @DesktopWidth - 20, 68, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUISetBkColor($iColour)
#EndRegion ### END Koda GUI section ###
_Main()
_Exit()
Func _GetINI($sFile)
Global $sProgram, $sPath, $iTimeout, $iColour, $sText, $iTextCol
$sProgram = IniRead($sFile, "Settings", "Program", "")
If Not FileExists($sProgram) Then
ConsoleWrite("Error: Executable does not exist!" & @CRLF & " Check configuration file" & @CRLF)
_Exit()
Else
If StringInStr($sProgram, "\") > 0 Then
$sPath = StringLeft($sProgram, StringInStr($sProgram, "\", 0, -1))
Else
$sPath = @ScriptDir & "\"
$sProgram = $sPath & $sProgram
EndIf
EndIf
$iTimeout = IniRead($sFile, "Settings", "Timeout", "15")
If $iTimeout < 1 Or $iTimeout > 180 Then $iTimeout = 15
$iTimeout *= 1000
$iColour = "0x" & IniRead($sFile, "Settings", "Colour", "000000")
If IsNumber(Dec($iColour)) Then
If Dec($iColour) >= 0 And Dec($iColour) <= 0xFFFFFF Then
$iColour = "0x" & Hex($iColour, 6)
EndIf
Else
$iColour = "0x000000"
EndIf
If $iColour > 0x7FFFFF Then
$iTextCol = 0x000000
Else
$iTextCol = 0xFFFFFF
EndIf
$sText = StringLeft(IniRead($sFile, "Settings", "Text", ""), 30)
EndFunc ;==>_GetINI
Func _Main()
Local $iPID = Run($sProgram, $sPath)
If $iPID <> 0 Then
GUISetState(@SW_SHOW)
Local $hProcess = _ProcessOpen($iPID, $iAccess)
If $hProcess <> 0 Then
_ProcessWaitForInputIdle($hProcess, $iTimeout)
_ProcessCloseHandle($hProcess)
Else
Sleep($iTimeout)
EndIf
Sleep(150)
GUISetState(@SW_HIDE)
Local $Data = _WinAPI_EnumProcessWindows($iPID)
If IsArray($Data) Then
If $Data[0][0] > 0 Then
_WinAPI_SetFocus($Data[1][0])
EndIf
EndIf
EndIf
EndFunc ;==>_Main
Func _Usage()
Local $aDemo[4][2] = [["Program", '"C:\Windows\System32\notepad.exe"'],["Timeout", 10],["Colour", "000000"],["Text", "Wait for it!"]]
ConsoleWrite("Usage: BlankIt.exe <config file>" & @CRLF & @CRLF)
ConsoleWrite("Where: <config file> = .ini containing command parameters" & @CRLF & @CRLF)
ConsoleWrite(" An example config file called BlankIt.ini has been" & @CRLF)
ConsoleWrite(" generated." & @CRLF)
IniWriteSection("BlankIt.ini", "Settings", $aDemo, 0)
_Exit()
EndFunc ;==>_Usage
Func _Exit()
Exit
EndFunc ;==>_Exit
And that's pretty much it until someone says something.