Load Splash Screen Immediately
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- cory.freeman@nortonhealthcare.org
- Posts: 4
- Last visit: Thu Mar 07, 2024 7:16 am
Load Splash Screen Immediately
Has anyone been able to get a Splash screen to load as soon as your gui .exe is clicked? Basically my GUI takes 5-8 seconds to load (gathering data) and I want to have a splash screen load during that time so users don't click the .exe again and again. Any help is appreciated.
Re: Load Splash Screen Immediately
i do this in the load event of my main form.
Code: Select all
$mainForm_load = {
$CM2012CmdletModule = ($Env:SMS_ADMIN_UI_PATH.Substring(0, $Env:SMS_ADMIN_UI_PATH.Length - 5) + '\ConfigurationManager.psd1')
if (Test-Path -Path $CM2012CmdletModule)
{
$splashScreen = Show-SplashScreen -passtrue $true
import-module $CM2012CmdletModule -force -erroraction SilentlyContinue
$splashScreen.Close()
} else
{
(New-Object -ComObject WScript.Shell).popup("The SCCM module wasn't detected on this computer. Please make sure the SCCM module is installed (SCCM Console required) and restart this Client Center.", 0, 'ERROR: No SCCM module detected!', 0)
return
}
}
function Show-SplashScreen {
# form code here
}