Beispiel #1
0
// IconType: 1 - ICON_BIG; 0 - ICON_SMALL
func (w *WindowBase) SetIcon(iconType int, icon *Icon) {
	if iconType > 1 {
		panic("IconType is invalid")
	}

	win.SendMessage(w.hwnd, win.WM_SETICON, uintptr(iconType), uintptr(icon.Handle()))
}
Beispiel #2
0
// 退出程序
func win_handler_quit(browser *cef.Browser, args []cef.V8Value) (result interface{}) {
	h := win.HWND(browser.GetWindowHandle())
	win.SendMessage(h, win.WM_CLOSE, 0, 0)
	//win.PostQuitMessage(0);
	os.Exit(1)

	return
}
Beispiel #3
0
// 关闭窗口
func win_handler_close(browser *cef.Browser, args []cef.V8Value) (result interface{}) {
	h := win.HWND(browser.GetWindowHandle())
	win.SendMessage(h, win.WM_CLOSE, 0, 0)

	return
}
Beispiel #4
0
func (w *WindowBase) GetWindowText() string {
	textLength := win.SendMessage(w.hwnd, win.WM_GETTEXTLENGTH, 0, 0)
	buf := make([]uint16, textLength+1)
	win.SendMessage(w.hwnd, win.WM_GETTEXT, uintptr(textLength+1), uintptr(unsafe.Pointer(&buf[0])))
	return syscall.UTF16ToString(buf)
}
Beispiel #5
0
func (w *WindowBase) Close() {
	win.SendMessage(w.hwnd, win.WM_CLOSE, 0, 0)
}