Added beginning of Windows init code.

This commit is contained in:
Pietro Gagliardi 2014-07-11 09:55:13 -04:00
parent 4eb9e26525
commit a54e3e67de
1 changed files with 40 additions and 0 deletions

40
redo/init_windows.go Normal file
View File

@ -0,0 +1,40 @@
// 11 july 2014
package ui
import (
"fmt"
)
var (
hInstance uintptr
nCmdShow int
hDefaultIcon uintptr
hArrowCursor uintptr
)
func getWinMainParams() (err error) {
hInstance, err = f_GetModuleHandle(nil)
if err != nil {
return fmt.Errorf("error getting hInstance: %v", err)
}
var info s_STARTUPINFOW
f_GetStartupInfoW(&info)
if info.dwFlags & c_STARTF_USESHOWWINDOW != 0 {
nCmdShow = int(info.wShowWindow)
} else {
nCmdShow = c_SW_SHOWDEFAULT
}
return nil
}
func initWindows() error {
if err := getWinMainParams(); err != nil {
return fmt.Errorf("error getting WinMain() parameters: %v", err)
}
return nil
}