Add archived Siemens software

This commit is contained in:
2026-08-26 12:46:05 +03:00
parent aa7dbcf33d
commit 9990eed34c
125 changed files with 1227 additions and 19 deletions
+24 -1
View File
@@ -80,6 +80,9 @@ public static class ScreenshotWindowApi {
[DllImport("user32.dll")]
public static extern bool PostMessage(IntPtr hWnd, uint message, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll")]
public static extern bool PrintWindow(IntPtr hWnd, IntPtr hdc, uint flags);
}
"@
@@ -434,7 +437,27 @@ try {
$screenshotPath = Join-Path $OutputDirectory "$Name.png"
$borderInset = 2
if ($ScreenshotTool.Length -gt 0 -and (Test-Path -LiteralPath $ScreenshotTool)) {
if ($ScreenshotTool -eq "printwindow") {
$bitmap = [System.Drawing.Bitmap]::new($window.Width, $window.Height, [System.Drawing.Imaging.PixelFormat]::Format32bppArgb)
try {
$graphics = [System.Drawing.Graphics]::FromImage($bitmap)
$deviceContext = $graphics.GetHdc()
try {
if (-not [ScreenshotWindowApi]::PrintWindow($window.Handle, $deviceContext, 2)) {
throw "PrintWindow failed for window '$($window.Title)'."
}
}
finally {
$graphics.ReleaseHdc($deviceContext)
$graphics.Dispose()
}
$bitmap.Save($screenshotPath, [System.Drawing.Imaging.ImageFormat]::Png)
}
finally {
$bitmap.Dispose()
}
}
elseif ($ScreenshotTool.Length -gt 0 -and (Test-Path -LiteralPath $ScreenshotTool)) {
$screenshotToolName = [System.IO.Path]::GetFileName($ScreenshotTool)
if ($screenshotToolName -ieq "winapp.exe") {
$winappExitCode = 1