Esempio n. 1
0
File: error.go Progetto: wangch/walk
func lastError(win32FuncName string) error {
	if errno := win.GetLastError(); errno != win.ERROR_SUCCESS {
		return newError(fmt.Sprintf("%s: Error %d", win32FuncName, errno))
	}

	return newError(win32FuncName)
}
Esempio n. 2
0
File: form.go Progetto: wangch/walk
func (fb *FormBase) SetOwner(value Form) error {
	fb.owner = value

	var ownerHWnd win.HWND
	if value != nil {
		ownerHWnd = value.Handle()
	}

	win.SetLastError(0)
	if 0 == win.SetWindowLong(
		fb.hWnd,
		win.GWL_HWNDPARENT,
		int32(ownerHWnd)) && win.GetLastError() != 0 {

		return lastError("SetWindowLong")
	}

	return nil
}