1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
11 type Wndclassex struct {
45 WS_MINIMIZE = 0x20000000
46 WS_VISIBLE = 0x10000000
47 WS_DISABLED = 0x8000000
48 WS_CLIPSIBLINGS = 0x4000000
49 WS_CLIPCHILDREN = 0x2000000
50 WS_MAXIMIZE = 0x1000000
51 WS_CAPTION = WS_BORDER | WS_DLGFRAME
53 WS_DLGFRAME = 0x400000
57 WS_THICKFRAME = 0x40000
60 WS_MINIMIZEBOX = 0x20000
61 WS_MAXIMIZEBOX = 0x10000
62 WS_TILED = WS_OVERLAPPED
63 WS_ICONIC = WS_MINIMIZE
64 WS_SIZEBOX = WS_THICKFRAME
65 // Common Window Styles
66 WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX
67 WS_TILEDWINDOW = WS_OVERLAPPEDWINDOW
68 WS_POPUPWINDOW = WS_POPUP | WS_BORDER | WS_SYSMENU
69 WS_CHILDWINDOW = WS_CHILD
71 WS_EX_CLIENTEDGE = 0x200
73 // Some windows messages
79 // Some button control styles
82 // Some color constants
86 // Default window position
87 CW_USEDEFAULT = 0x80000000 - 0x100000000
89 // Show window default style
94 // Some globally known cursors
95 IDC_ARROW = MakeIntResource(32512)
96 IDC_IBEAM = MakeIntResource(32513)
97 IDC_WAIT = MakeIntResource(32514)
98 IDC_CROSS = MakeIntResource(32515)
100 // Some globally known icons
101 IDI_APPLICATION = MakeIntResource(32512)
102 IDI_HAND = MakeIntResource(32513)
103 IDI_QUESTION = MakeIntResource(32514)
104 IDI_EXCLAMATION = MakeIntResource(32515)
105 IDI_ASTERISK = MakeIntResource(32516)
106 IDI_WINLOGO = MakeIntResource(32517)
107 IDI_WARNING = IDI_EXCLAMATION
109 IDI_INFORMATION = IDI_ASTERISK
112 //sys GetModuleHandle(modname *uint16) (handle uint32, errno int) = GetModuleHandleW
113 //sys RegisterClassEx(wndclass *Wndclassex) (atom uint16, errno int) = user32.RegisterClassExW
114 //sys CreateWindowEx(exstyle uint32, classname *uint16, windowname *uint16, style uint32, x int32, y int32, width int32, height int32, wndparent uint32, menu uint32, instance uint32, param uintptr) (hwnd uint32, errno int) = user32.CreateWindowExW
115 //sys DefWindowProc(hwnd uint32, msg uint32, wparam int32, lparam int32) (lresult int32) = user32.DefWindowProcW
116 //sys DestroyWindow(hwnd uint32) (errno int) = user32.DestroyWindow
117 //sys PostQuitMessage(exitcode int32) = user32.PostQuitMessage
118 //sys ShowWindow(hwnd uint32, cmdshow int32) (wasvisible bool) = user32.ShowWindow
119 //sys UpdateWindow(hwnd uint32) (errno int) = user32.UpdateWindow
120 //sys GetMessage(msg *Msg, hwnd uint32, MsgFilterMin uint32, MsgFilterMax uint32) (ret int32, errno int) [failretval==-1] = user32.GetMessageW
121 //sys TranslateMessage(msg *Msg) (done bool) = user32.TranslateMessage
122 //sys DispatchMessage(msg *Msg) (ret int32) = user32.DispatchMessageW
123 //sys LoadIcon(instance uint32, iconname *uint16) (icon uint32, errno int) = user32.LoadIconW
124 //sys LoadCursor(instance uint32, cursorname *uint16) (cursor uint32, errno int) = user32.LoadCursorW
125 //sys SetCursor(cursor uint32) (precursor uint32, errno int) = user32.SetCursor
126 //sys SendMessage(hwnd uint32, msg uint32, wparam int32, lparam int32) (lresult int32) = user32.SendMessageW
127 //sys PostMessage(hwnd uint32, msg uint32, wparam int32, lparam int32) (errno int) = user32.PostMessageW
129 func MakeIntResource(id uint16) *uint16 {
130 return (*uint16)(unsafe.Pointer(uintptr(id)))