## Summary What changed and why? ## Change Type - [ ] Cowork feature - [ ] Bug fix - [ ] Core AI contribution - [ ] Test / hardening - [ ] Performance - [ ] Documentation ## Related Work Cowork Task: Core Repo: http://34.143.229.138/gitea-admin/fsg-ai-core-assets Core AI Issue: Core Task: Related PR: ## Scope What is intentionally included? What is intentionally NOT included? ## Validation - [ ] Unit tests - [ ] Integration tests - [ ] Manual verification - [ ] Regression check Commands / evidence: ## Security Impact Permission / credential / network / customer data impact: ## Compatibility - [ ] No breaking change - [ ] Breaking change documented ## Reviewer Notes Anything Cowork reviewers should pay attention to. --------- Co-authored-by: thanhnv <thanhnv.ip@gmail.com> Co-authored-by: Vu Dam Tuan <vudt15@fpt.com> Reviewed-on: #9
This commit was merged in pull request #9.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Ẩn/hiện cửa sổ console hiện tại — dùng bởi run.bat để không hiện cửa sổ
|
||||
cmd đen suốt phiên chạy app (app là GUI Qt, không cần console), nhưng vẫn
|
||||
hiện lại được nếu app thoát lỗi để người dùng đọc thông báo.
|
||||
|
||||
.PARAMETER Mode
|
||||
0 = ẩn (SW_HIDE), 5 = hiện lại (SW_SHOW).
|
||||
#>
|
||||
param(
|
||||
[int]$Mode = 0
|
||||
)
|
||||
|
||||
Add-Type -Name Win32 -Namespace CoworkLocalNative -MemberDefinition @"
|
||||
[DllImport("user32.dll")] public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
|
||||
[DllImport("kernel32.dll")] public static extern IntPtr GetConsoleWindow();
|
||||
"@
|
||||
|
||||
$hwnd = [CoworkLocalNative.Win32]::GetConsoleWindow()
|
||||
if ($hwnd -ne [IntPtr]::Zero) {
|
||||
[CoworkLocalNative.Win32]::ShowWindow($hwnd, $Mode) | Out-Null
|
||||
}
|
||||
Reference in New Issue
Block a user