Files
HackBrowserData/cmd/hack-browser-data/main_windows.go
T
Roger 0ed920f846 docs: trim code comments to the why (#676)
Comments that restated names or narrated the code are gone, and multi-line ones are cut to a line of why.
Only comments change: each edited Go file has the same token stream as before. winapi and abe come later.
2026-11-02 00:03:03 +08:00

30 lines
682 B
Go

//go:build windows
package main
import (
"os"
"github.com/inconshreveable/mousetrap"
"github.com/spf13/cobra"
"golang.org/x/sys/windows"
"github.com/moond4rk/hackbrowserdata/internal/winapi"
)
// configureDoubleClickMode lets a double-click from Explorer run the tool with its console hidden (issue #344).
func configureDoubleClickMode() {
if !mousetrap.StartedByExplorer() {
return
}
cobra.MousetrapHelpText = ""
winapi.HideConsoleWindow()
}
// exitBy ends the process with the status Windows gives a console process that Ctrl-C or closing the console ends.
func exitBy(os.Signal) {
status := uint32(windows.STATUS_CONTROL_C_EXIT)
os.Exit(int(int32(status)))
}