summaryrefslogtreecommitdiff
path: root/init_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-06-10 13:10:59 -0400
committerPietro Gagliardi <[email protected]>2014-06-10 13:10:59 -0400
commit5b19e6e9a1467da5842727ff90cde50de4ffb831 (patch)
tree2ad8d017cedf184d05dab02d81fcce56ea1327e2 /init_windows.go
parenta3222f248d25f284d5f4b7c0626ab1140bb0db9a (diff)
More go fmt.
Diffstat (limited to 'init_windows.go')
-rw-r--r--init_windows.go47
1 files changed, 23 insertions, 24 deletions
diff --git a/init_windows.go b/init_windows.go
index 993ac39..b8f11a5 100644
--- a/init_windows.go
+++ b/init_windows.go
@@ -4,19 +4,18 @@ package ui
import (
"fmt"
-// "syscall"
"unsafe"
)
var (
- hInstance _HANDLE
- nCmdShow int
+ hInstance _HANDLE
+ nCmdShow int
)
// TODO is this documented?
func getWinMainhInstance() (err error) {
r1, _, err := kernel32.NewProc("GetModuleHandleW").Call(uintptr(_NULL))
- if r1 == 0 { // failure
+ if r1 == 0 { // failure
return err
}
hInstance = _HANDLE(r1)
@@ -26,29 +25,29 @@ func getWinMainhInstance() (err error) {
// this is what MinGW-w64 does (for instance, http://sourceforge.net/p/mingw-w64/code/6604/tree/trunk/mingw-w64-crt/crt/crtexe.c#l320); Burgundy in irc.freenode.net/#winapi said that the Visual C++ runtime does this too
func getWinMainnCmdShow() {
var info struct {
- cb uint32
- lpReserved *uint16
- lpDesktop *uint16
- lpTitle *uint16
- dwX uint32
- dwY uint32
- dwXSize uint32
- dwYSzie uint32
- dwXCountChars uint32
- dwYCountChars uint32
- dwFillAttribute uint32
- dwFlags uint32
- wShowWindow uint16
- cbReserved2 uint16
- lpReserved2 *byte
- hStdInput _HANDLE
- hStdOutput _HANDLE
- hStdError _HANDLE
+ cb uint32
+ lpReserved *uint16
+ lpDesktop *uint16
+ lpTitle *uint16
+ dwX uint32
+ dwY uint32
+ dwXSize uint32
+ dwYSzie uint32
+ dwXCountChars uint32
+ dwYCountChars uint32
+ dwFillAttribute uint32
+ dwFlags uint32
+ wShowWindow uint16
+ cbReserved2 uint16
+ lpReserved2 *byte
+ hStdInput _HANDLE
+ hStdOutput _HANDLE
+ hStdError _HANDLE
}
// does not fail according to MSDN
kernel32.NewProc("GetStartupInfoW").Call(uintptr(unsafe.Pointer(&info)))
- if info.dwFlags & _STARTF_USESHOWWINDOW != 0 {
+ if info.dwFlags&_STARTF_USESHOWWINDOW != 0 {
nCmdShow = int(info.wShowWindow)
} else {
nCmdShow = _SW_SHOWDEFAULT
@@ -82,5 +81,5 @@ func doWindowsInit() (err error) {
return fmt.Errorf("error initializing Common Controls (comctl32.dll): %v", err)
}
// others go here
- return nil // all ready to go
+ return nil // all ready to go
}