1// Copyright 2010-2012 The W32 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.
4
5package w32
6
7import (
8	"unsafe"
9)
10
11// From MSDN: Windows Data Types
12// http://msdn.microsoft.com/en-us/library/s3f49ktz.aspx
13// http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751.aspx
14// ATOM                  WORD
15// BOOL                  int32
16// BOOLEAN               byte
17// BYTE                  byte
18// CCHAR                 int8
19// CHAR                  int8
20// COLORREF              DWORD
21// DWORD                 uint32
22// DWORDLONG             ULONGLONG
23// DWORD_PTR             ULONG_PTR
24// DWORD32               uint32
25// DWORD64               uint64
26// FLOAT                 float32
27// HACCEL                HANDLE
28// HALF_PTR              struct{} // ???
29// HANDLE                PVOID
30// HBITMAP               HANDLE
31// HBRUSH                HANDLE
32// HCOLORSPACE           HANDLE
33// HCONV                 HANDLE
34// HCONVLIST             HANDLE
35// HCURSOR               HANDLE
36// HDC                   HANDLE
37// HDDEDATA              HANDLE
38// HDESK                 HANDLE
39// HDROP                 HANDLE
40// HDWP                  HANDLE
41// HENHMETAFILE          HANDLE
42// HFILE                 HANDLE
43// HFONT                 HANDLE
44// HGDIOBJ               HANDLE
45// HGLOBAL               HANDLE
46// HHOOK                 HANDLE
47// HICON                 HANDLE
48// HINSTANCE             HANDLE
49// HKEY                  HANDLE
50// HKL                   HANDLE
51// HLOCAL                HANDLE
52// HMENU                 HANDLE
53// HMETAFILE             HANDLE
54// HMODULE               HANDLE
55// HPALETTE              HANDLE
56// HPEN                  HANDLE
57// HRESULT               int32
58// HRGN                  HANDLE
59// HSZ                   HANDLE
60// HWINSTA               HANDLE
61// HWND                  HANDLE
62// INT                   int32
63// INT_PTR               uintptr
64// INT8                  int8
65// INT16                 int16
66// INT32                 int32
67// INT64                 int64
68// LANGID                WORD
69// LCID                  DWORD
70// LCTYPE                DWORD
71// LGRPID                DWORD
72// LONG                  int32
73// LONGLONG              int64
74// LONG_PTR              uintptr
75// LONG32                int32
76// LONG64                int64
77// LPARAM                LONG_PTR
78// LPBOOL                *BOOL
79// LPBYTE                *BYTE
80// LPCOLORREF            *COLORREF
81// LPCSTR                *int8
82// LPCTSTR               LPCWSTR
83// LPCVOID               unsafe.Pointer
84// LPCWSTR               *WCHAR
85// LPDWORD               *DWORD
86// LPHANDLE              *HANDLE
87// LPINT                 *INT
88// LPLONG                *LONG
89// LPSTR                 *CHAR
90// LPTSTR                LPWSTR
91// LPVOID                unsafe.Pointer
92// LPWORD                *WORD
93// LPWSTR                *WCHAR
94// LRESULT               LONG_PTR
95// PBOOL                 *BOOL
96// PBOOLEAN              *BOOLEAN
97// PBYTE                 *BYTE
98// PCHAR                 *CHAR
99// PCSTR                 *CHAR
100// PCTSTR                PCWSTR
101// PCWSTR                *WCHAR
102// PDWORD                *DWORD
103// PDWORDLONG            *DWORDLONG
104// PDWORD_PTR            *DWORD_PTR
105// PDWORD32              *DWORD32
106// PDWORD64              *DWORD64
107// PFLOAT                *FLOAT
108// PHALF_PTR             *HALF_PTR
109// PHANDLE               *HANDLE
110// PHKEY                 *HKEY
111// PINT_PTR              *INT_PTR
112// PINT8                 *INT8
113// PINT16                *INT16
114// PINT32                *INT32
115// PINT64                *INT64
116// PLCID                 *LCID
117// PLONG                 *LONG
118// PLONGLONG             *LONGLONG
119// PLONG_PTR             *LONG_PTR
120// PLONG32               *LONG32
121// PLONG64               *LONG64
122// POINTER_32            struct{} // ???
123// POINTER_64            struct{} // ???
124// POINTER_SIGNED        uintptr
125// POINTER_UNSIGNED      uintptr
126// PSHORT                *SHORT
127// PSIZE_T               *SIZE_T
128// PSSIZE_T              *SSIZE_T
129// PSTR                  *CHAR
130// PTBYTE                *TBYTE
131// PTCHAR                *TCHAR
132// PTSTR                 PWSTR
133// PUCHAR                *UCHAR
134// PUHALF_PTR            *UHALF_PTR
135// PUINT                 *UINT
136// PUINT_PTR             *UINT_PTR
137// PUINT8                *UINT8
138// PUINT16               *UINT16
139// PUINT32               *UINT32
140// PUINT64               *UINT64
141// PULONG                *ULONG
142// PULONGLONG            *ULONGLONG
143// PULONG_PTR            *ULONG_PTR
144// PULONG32              *ULONG32
145// PULONG64              *ULONG64
146// PUSHORT               *USHORT
147// PVOID                 unsafe.Pointer
148// PWCHAR                *WCHAR
149// PWORD                 *WORD
150// PWSTR                 *WCHAR
151// QWORD                 uint64
152// SC_HANDLE             HANDLE
153// SC_LOCK               LPVOID
154// SERVICE_STATUS_HANDLE HANDLE
155// SHORT                 int16
156// SIZE_T                ULONG_PTR
157// SSIZE_T               LONG_PTR
158// TBYTE                 WCHAR
159// TCHAR                 WCHAR
160// UCHAR                 uint8
161// UHALF_PTR             struct{} // ???
162// UINT                  uint32
163// UINT_PTR              uintptr
164// UINT8                 uint8
165// UINT16                uint16
166// UINT32                uint32
167// UINT64                uint64
168// ULONG                 uint32
169// ULONGLONG             uint64
170// ULONG_PTR             uintptr
171// ULONG32               uint32
172// ULONG64               uint64
173// USHORT                uint16
174// USN                   LONGLONG
175// WCHAR                 uint16
176// WORD                  uint16
177// WPARAM                UINT_PTR
178type (
179	ATOM            uint16
180	BOOL            int32
181	COLORREF        uint32
182	DWM_FRAME_COUNT uint64
183	HACCEL          HANDLE
184	HANDLE          uintptr
185	HBITMAP         HANDLE
186	HBRUSH          HANDLE
187	HCURSOR         HANDLE
188	HDC             HANDLE
189	HDROP           HANDLE
190	HDWP            HANDLE
191	HENHMETAFILE    HANDLE
192	HFONT           HANDLE
193	HGDIOBJ         HANDLE
194	HGLOBAL         HANDLE
195	HGLRC           HANDLE
196	HICON           HANDLE
197	HIMAGELIST      HANDLE
198	HINSTANCE       HANDLE
199	HKEY            HANDLE
200	HKL             HANDLE
201	HMENU           HANDLE
202	HMODULE         HANDLE
203	HMONITOR        HANDLE
204	HPEN            HANDLE
205	HRESULT         int32
206	HRGN            HANDLE
207	HRSRC           HANDLE
208	HTHUMBNAIL      HANDLE
209	HWND            HANDLE
210	LPCVOID         unsafe.Pointer
211	PVOID           unsafe.Pointer
212	QPC_TIME        uint64
213)
214
215// http://msdn.microsoft.com/en-us/library/windows/desktop/dd162805.aspx
216type POINT struct {
217	X, Y int32
218}
219
220// http://msdn.microsoft.com/en-us/library/windows/desktop/dd162897.aspx
221type RECT struct {
222	Left, Top, Right, Bottom int32
223}
224
225// http://msdn.microsoft.com/en-us/library/windows/desktop/ms633577.aspx
226type WNDCLASSEX struct {
227	Size       uint32
228	Style      uint32
229	WndProc    uintptr
230	ClsExtra   int32
231	WndExtra   int32
232	Instance   HINSTANCE
233	Icon       HICON
234	Cursor     HCURSOR
235	Background HBRUSH
236	MenuName   *uint16
237	ClassName  *uint16
238	IconSm     HICON
239}
240
241// http://msdn.microsoft.com/en-us/library/windows/desktop/ms644958.aspx
242type MSG struct {
243	Hwnd    HWND
244	Message uint32
245	WParam  uintptr
246	LParam  uintptr
247	Time    uint32
248	Pt      POINT
249}
250
251// http://msdn.microsoft.com/en-us/library/windows/desktop/dd145037.aspx
252type LOGFONT struct {
253	Height         int32
254	Width          int32
255	Escapement     int32
256	Orientation    int32
257	Weight         int32
258	Italic         byte
259	Underline      byte
260	StrikeOut      byte
261	CharSet        byte
262	OutPrecision   byte
263	ClipPrecision  byte
264	Quality        byte
265	PitchAndFamily byte
266	FaceName       [LF_FACESIZE]uint16
267}
268
269// http://msdn.microsoft.com/en-us/library/windows/desktop/ms646839.aspx
270type OPENFILENAME struct {
271	StructSize      uint32
272	Owner           HWND
273	Instance        HINSTANCE
274	Filter          *uint16
275	CustomFilter    *uint16
276	MaxCustomFilter uint32
277	FilterIndex     uint32
278	File            *uint16
279	MaxFile         uint32
280	FileTitle       *uint16
281	MaxFileTitle    uint32
282	InitialDir      *uint16
283	Title           *uint16
284	Flags           uint32
285	FileOffset      uint16
286	FileExtension   uint16
287	DefExt          *uint16
288	CustData        uintptr
289	FnHook          uintptr
290	TemplateName    *uint16
291	PvReserved      unsafe.Pointer
292	DwReserved      uint32
293	FlagsEx         uint32
294}
295
296// http://msdn.microsoft.com/en-us/library/windows/desktop/bb773205.aspx
297type BROWSEINFO struct {
298	Owner        HWND
299	Root         *uint16
300	DisplayName  *uint16
301	Title        *uint16
302	Flags        uint32
303	CallbackFunc uintptr
304	LParam       uintptr
305	Image        int32
306}
307
308// http://msdn.microsoft.com/en-us/library/windows/desktop/aa373931.aspx
309type GUID struct {
310	Data1 uint32
311	Data2 uint16
312	Data3 uint16
313	Data4 [8]byte
314}
315
316// http://msdn.microsoft.com/en-us/library/windows/desktop/ms221627.aspx
317type VARIANT struct {
318	VT         uint16 //  2
319	WReserved1 uint16 //  4
320	WReserved2 uint16 //  6
321	WReserved3 uint16 //  8
322	Val        int64  // 16
323}
324
325// http://msdn.microsoft.com/en-us/library/windows/desktop/ms221416.aspx
326type DISPPARAMS struct {
327	Rgvarg            uintptr
328	RgdispidNamedArgs uintptr
329	CArgs             uint32
330	CNamedArgs        uint32
331}
332
333// http://msdn.microsoft.com/en-us/library/windows/desktop/ms221133.aspx
334type EXCEPINFO struct {
335	WCode             uint16
336	WReserved         uint16
337	BstrSource        *uint16
338	BstrDescription   *uint16
339	BstrHelpFile      *uint16
340	DwHelpContext     uint32
341	PvReserved        uintptr
342	PfnDeferredFillIn uintptr
343	Scode             int32
344}
345
346// http://msdn.microsoft.com/en-us/library/windows/desktop/dd145035.aspx
347type LOGBRUSH struct {
348	LbStyle uint32
349	LbColor COLORREF
350	LbHatch uintptr
351}
352
353// http://msdn.microsoft.com/en-us/library/windows/desktop/dd183565.aspx
354type DEVMODE struct {
355	DmDeviceName       [CCHDEVICENAME]uint16
356	DmSpecVersion      uint16
357	DmDriverVersion    uint16
358	DmSize             uint16
359	DmDriverExtra      uint16
360	DmFields           uint32
361	DmOrientation      int16
362	DmPaperSize        int16
363	DmPaperLength      int16
364	DmPaperWidth       int16
365	DmScale            int16
366	DmCopies           int16
367	DmDefaultSource    int16
368	DmPrintQuality     int16
369	DmColor            int16
370	DmDuplex           int16
371	DmYResolution      int16
372	DmTTOption         int16
373	DmCollate          int16
374	DmFormName         [CCHFORMNAME]uint16
375	DmLogPixels        uint16
376	DmBitsPerPel       uint32
377	DmPelsWidth        uint32
378	DmPelsHeight       uint32
379	DmDisplayFlags     uint32
380	DmDisplayFrequency uint32
381	DmICMMethod        uint32
382	DmICMIntent        uint32
383	DmMediaType        uint32
384	DmDitherType       uint32
385	DmReserved1        uint32
386	DmReserved2        uint32
387	DmPanningWidth     uint32
388	DmPanningHeight    uint32
389}
390
391// http://msdn.microsoft.com/en-us/library/windows/desktop/dd183376.aspx
392type BITMAPINFOHEADER struct {
393	BiSize          uint32
394	BiWidth         int32
395	BiHeight        int32
396	BiPlanes        uint16
397	BiBitCount      uint16
398	BiCompression   uint32
399	BiSizeImage     uint32
400	BiXPelsPerMeter int32
401	BiYPelsPerMeter int32
402	BiClrUsed       uint32
403	BiClrImportant  uint32
404}
405
406// http://msdn.microsoft.com/en-us/library/windows/desktop/dd162938.aspx
407type RGBQUAD struct {
408	RgbBlue     byte
409	RgbGreen    byte
410	RgbRed      byte
411	RgbReserved byte
412}
413
414// http://msdn.microsoft.com/en-us/library/windows/desktop/dd183375.aspx
415type BITMAPINFO struct {
416	BmiHeader BITMAPINFOHEADER
417	BmiColors *RGBQUAD
418}
419
420// http://msdn.microsoft.com/en-us/library/windows/desktop/dd183371.aspx
421type BITMAP struct {
422	BmType       int32
423	BmWidth      int32
424	BmHeight     int32
425	BmWidthBytes int32
426	BmPlanes     uint16
427	BmBitsPixel  uint16
428	BmBits       unsafe.Pointer
429}
430
431// http://msdn.microsoft.com/en-us/library/windows/desktop/dd183567.aspx
432type DIBSECTION struct {
433	DsBm        BITMAP
434	DsBmih      BITMAPINFOHEADER
435	DsBitfields [3]uint32
436	DshSection  HANDLE
437	DsOffset    uint32
438}
439
440// http://msdn.microsoft.com/en-us/library/windows/desktop/dd162607.aspx
441type ENHMETAHEADER struct {
442	IType          uint32
443	NSize          uint32
444	RclBounds      RECT
445	RclFrame       RECT
446	DSignature     uint32
447	NVersion       uint32
448	NBytes         uint32
449	NRecords       uint32
450	NHandles       uint16
451	SReserved      uint16
452	NDescription   uint32
453	OffDescription uint32
454	NPalEntries    uint32
455	SzlDevice      SIZE
456	SzlMillimeters SIZE
457	CbPixelFormat  uint32
458	OffPixelFormat uint32
459	BOpenGL        uint32
460	SzlMicrometers SIZE
461}
462
463// http://msdn.microsoft.com/en-us/library/windows/desktop/dd145106.aspx
464type SIZE struct {
465	CX, CY int32
466}
467
468// http://msdn.microsoft.com/en-us/library/windows/desktop/dd145132.aspx
469type TEXTMETRIC struct {
470	TmHeight           int32
471	TmAscent           int32
472	TmDescent          int32
473	TmInternalLeading  int32
474	TmExternalLeading  int32
475	TmAveCharWidth     int32
476	TmMaxCharWidth     int32
477	TmWeight           int32
478	TmOverhang         int32
479	TmDigitizedAspectX int32
480	TmDigitizedAspectY int32
481	TmFirstChar        uint16
482	TmLastChar         uint16
483	TmDefaultChar      uint16
484	TmBreakChar        uint16
485	TmItalic           byte
486	TmUnderlined       byte
487	TmStruckOut        byte
488	TmPitchAndFamily   byte
489	TmCharSet          byte
490}
491
492// http://msdn.microsoft.com/en-us/library/windows/desktop/dd183574.aspx
493type DOCINFO struct {
494	CbSize       int32
495	LpszDocName  *uint16
496	LpszOutput   *uint16
497	LpszDatatype *uint16
498	FwType       uint32
499}
500
501// http://msdn.microsoft.com/en-us/library/windows/desktop/bb775514.aspx
502type NMHDR struct {
503	HwndFrom HWND
504	IdFrom   uintptr
505	Code     uint32
506}
507
508// http://msdn.microsoft.com/en-us/library/windows/desktop/bb774743.aspx
509type LVCOLUMN struct {
510	Mask       uint32
511	Fmt        int32
512	Cx         int32
513	PszText    *uint16
514	CchTextMax int32
515	ISubItem   int32
516	IImage     int32
517	IOrder     int32
518}
519
520// http://msdn.microsoft.com/en-us/library/windows/desktop/bb774760.aspx
521type LVITEM struct {
522	Mask       uint32
523	IItem      int32
524	ISubItem   int32
525	State      uint32
526	StateMask  uint32
527	PszText    *uint16
528	CchTextMax int32
529	IImage     int32
530	LParam     uintptr
531	IIndent    int32
532	IGroupId   int32
533	CColumns   uint32
534	PuColumns  uint32
535}
536
537// http://msdn.microsoft.com/en-us/library/windows/desktop/bb774754.aspx
538type LVHITTESTINFO struct {
539	Pt       POINT
540	Flags    uint32
541	IItem    int32
542	ISubItem int32
543	IGroup   int32
544}
545
546// http://msdn.microsoft.com/en-us/library/windows/desktop/bb774771.aspx
547type NMITEMACTIVATE struct {
548	Hdr       NMHDR
549	IItem     int32
550	ISubItem  int32
551	UNewState uint32
552	UOldState uint32
553	UChanged  uint32
554	PtAction  POINT
555	LParam    uintptr
556	UKeyFlags uint32
557}
558
559// http://msdn.microsoft.com/en-us/library/windows/desktop/bb774773.aspx
560type NMLISTVIEW struct {
561	Hdr       NMHDR
562	IItem     int32
563	ISubItem  int32
564	UNewState uint32
565	UOldState uint32
566	UChanged  uint32
567	PtAction  POINT
568	LParam    uintptr
569}
570
571// http://msdn.microsoft.com/en-us/library/windows/desktop/bb774780.aspx
572type NMLVDISPINFO struct {
573	Hdr  NMHDR
574	Item LVITEM
575}
576
577// http://msdn.microsoft.com/en-us/library/windows/desktop/bb775507.aspx
578type INITCOMMONCONTROLSEX struct {
579	DwSize uint32
580	DwICC  uint32
581}
582
583// http://msdn.microsoft.com/en-us/library/windows/desktop/bb760256.aspx
584type TOOLINFO struct {
585	CbSize     uint32
586	UFlags     uint32
587	Hwnd       HWND
588	UId        uintptr
589	Rect       RECT
590	Hinst      HINSTANCE
591	LpszText   *uint16
592	LParam     uintptr
593	LpReserved unsafe.Pointer
594}
595
596// http://msdn.microsoft.com/en-us/library/windows/desktop/ms645604.aspx
597type TRACKMOUSEEVENT struct {
598	CbSize      uint32
599	DwFlags     uint32
600	HwndTrack   HWND
601	DwHoverTime uint32
602}
603
604// http://msdn.microsoft.com/en-us/library/windows/desktop/ms534067.aspx
605type GdiplusStartupInput struct {
606	GdiplusVersion           uint32
607	DebugEventCallback       uintptr
608	SuppressBackgroundThread BOOL
609	SuppressExternalCodecs   BOOL
610}
611
612// http://msdn.microsoft.com/en-us/library/windows/desktop/ms534068.aspx
613type GdiplusStartupOutput struct {
614	NotificationHook   uintptr
615	NotificationUnhook uintptr
616}
617
618// http://msdn.microsoft.com/en-us/library/windows/desktop/dd162768.aspx
619type PAINTSTRUCT struct {
620	Hdc         HDC
621	FErase      BOOL
622	RcPaint     RECT
623	FRestore    BOOL
624	FIncUpdate  BOOL
625	RgbReserved [32]byte
626}
627
628// http://msdn.microsoft.com/en-us/library/windows/desktop/aa363646.aspx
629type EVENTLOGRECORD struct {
630	Length              uint32
631	Reserved            uint32
632	RecordNumber        uint32
633	TimeGenerated       uint32
634	TimeWritten         uint32
635	EventID             uint32
636	EventType           uint16
637	NumStrings          uint16
638	EventCategory       uint16
639	ReservedFlags       uint16
640	ClosingRecordNumber uint32
641	StringOffset        uint32
642	UserSidLength       uint32
643	UserSidOffset       uint32
644	DataLength          uint32
645	DataOffset          uint32
646}
647
648// http://msdn.microsoft.com/en-us/library/windows/desktop/ms685996.aspx
649type SERVICE_STATUS struct {
650	DwServiceType             uint32
651	DwCurrentState            uint32
652	DwControlsAccepted        uint32
653	DwWin32ExitCode           uint32
654	DwServiceSpecificExitCode uint32
655	DwCheckPoint              uint32
656	DwWaitHint                uint32
657}
658type PROCESSENTRY32 struct {
659	DwSize              uint32
660	CntUsage            uint32
661	Th32ProcessID       uint32
662	Th32DefaultHeapID   uintptr
663	Th32ModuleID        uint32
664	CntThreads          uint32
665	Th32ParentProcessID uint32
666	PcPriClassBase      int32
667	DwFlags             uint32
668	SzExeFile           [MAX_PATH]uint16
669}
670
671// http://msdn.microsoft.com/en-us/library/windows/desktop/ms684225.aspx
672type MODULEENTRY32 struct {
673	Size         uint32
674	ModuleID     uint32
675	ProcessID    uint32
676	GlblcntUsage uint32
677	ProccntUsage uint32
678	ModBaseAddr  *uint8
679	ModBaseSize  uint32
680	HModule      HMODULE
681	SzModule     [MAX_MODULE_NAME32 + 1]uint16
682	SzExePath    [MAX_PATH]uint16
683}
684
685// http://msdn.microsoft.com/en-us/library/windows/desktop/ms724284.aspx
686type FILETIME struct {
687	DwLowDateTime  uint32
688	DwHighDateTime uint32
689}
690
691// http://msdn.microsoft.com/en-us/library/windows/desktop/ms682119.aspx
692type COORD struct {
693	X, Y int16
694}
695
696// http://msdn.microsoft.com/en-us/library/windows/desktop/ms686311.aspx
697type SMALL_RECT struct {
698	Left, Top, Right, Bottom int16
699}
700
701// http://msdn.microsoft.com/en-us/library/windows/desktop/ms682093.aspx
702type CONSOLE_SCREEN_BUFFER_INFO struct {
703	DwSize              COORD
704	DwCursorPosition    COORD
705	WAttributes         uint16
706	SrWindow            SMALL_RECT
707	DwMaximumWindowSize COORD
708}
709
710// http://msdn.microsoft.com/en-us/library/windows/desktop/bb773244.aspx
711type MARGINS struct {
712	CxLeftWidth, CxRightWidth, CyTopHeight, CyBottomHeight int32
713}
714
715// http://msdn.microsoft.com/en-us/library/windows/desktop/aa969500.aspx
716type DWM_BLURBEHIND struct {
717	DwFlags                uint32
718	fEnable                BOOL
719	hRgnBlur               HRGN
720	fTransitionOnMaximized BOOL
721}
722
723// http://msdn.microsoft.com/en-us/library/windows/desktop/aa969501.aspx
724type DWM_PRESENT_PARAMETERS struct {
725	cbSize             uint32
726	fQueue             BOOL
727	cRefreshStart      DWM_FRAME_COUNT
728	cBuffer            uint32
729	fUseSourceRate     BOOL
730	rateSource         UNSIGNED_RATIO
731	cRefreshesPerFrame uint32
732	eSampling          DWM_SOURCE_FRAME_SAMPLING
733}
734
735// http://msdn.microsoft.com/en-us/library/windows/desktop/aa969502.aspx
736type DWM_THUMBNAIL_PROPERTIES struct {
737	dwFlags               uint32
738	rcDestination         RECT
739	rcSource              RECT
740	opacity               byte
741	fVisible              BOOL
742	fSourceClientAreaOnly BOOL
743}
744
745// http://msdn.microsoft.com/en-us/library/windows/desktop/aa969503.aspx
746type DWM_TIMING_INFO struct {
747	cbSize                 uint32
748	rateRefresh            UNSIGNED_RATIO
749	qpcRefreshPeriod       QPC_TIME
750	rateCompose            UNSIGNED_RATIO
751	qpcVBlank              QPC_TIME
752	cRefresh               DWM_FRAME_COUNT
753	cDXRefresh             uint32
754	qpcCompose             QPC_TIME
755	cFrame                 DWM_FRAME_COUNT
756	cDXPresent             uint32
757	cRefreshFrame          DWM_FRAME_COUNT
758	cFrameSubmitted        DWM_FRAME_COUNT
759	cDXPresentSubmitted    uint32
760	cFrameConfirmed        DWM_FRAME_COUNT
761	cDXPresentConfirmed    uint32
762	cRefreshConfirmed      DWM_FRAME_COUNT
763	cDXRefreshConfirmed    uint32
764	cFramesLate            DWM_FRAME_COUNT
765	cFramesOutstanding     uint32
766	cFrameDisplayed        DWM_FRAME_COUNT
767	qpcFrameDisplayed      QPC_TIME
768	cRefreshFrameDisplayed DWM_FRAME_COUNT
769	cFrameComplete         DWM_FRAME_COUNT
770	qpcFrameComplete       QPC_TIME
771	cFramePending          DWM_FRAME_COUNT
772	qpcFramePending        QPC_TIME
773	cFramesDisplayed       DWM_FRAME_COUNT
774	cFramesComplete        DWM_FRAME_COUNT
775	cFramesPending         DWM_FRAME_COUNT
776	cFramesAvailable       DWM_FRAME_COUNT
777	cFramesDropped         DWM_FRAME_COUNT
778	cFramesMissed          DWM_FRAME_COUNT
779	cRefreshNextDisplayed  DWM_FRAME_COUNT
780	cRefreshNextPresented  DWM_FRAME_COUNT
781	cRefreshesDisplayed    DWM_FRAME_COUNT
782	cRefreshesPresented    DWM_FRAME_COUNT
783	cRefreshStarted        DWM_FRAME_COUNT
784	cPixelsReceived        uint64
785	cPixelsDrawn           uint64
786	cBuffersEmpty          DWM_FRAME_COUNT
787}
788
789// http://msdn.microsoft.com/en-us/library/windows/desktop/dd389402.aspx
790type MilMatrix3x2D struct {
791	S_11, S_12, S_21, S_22 float64
792	DX, DY                 float64
793}
794
795// http://msdn.microsoft.com/en-us/library/windows/desktop/aa969505.aspx
796type UNSIGNED_RATIO struct {
797	uiNumerator   uint32
798	uiDenominator uint32
799}
800
801// http://msdn.microsoft.com/en-us/library/windows/desktop/ms632603.aspx
802type CREATESTRUCT struct {
803	CreateParams uintptr
804	Instance     HINSTANCE
805	Menu         HMENU
806	Parent       HWND
807	Cy, Cx       int32
808	Y, X         int32
809	Style        int32
810	Name         *uint16
811	Class        *uint16
812	dwExStyle    uint32
813}
814
815// http://msdn.microsoft.com/en-us/library/windows/desktop/dd145065.aspx
816type MONITORINFO struct {
817	CbSize    uint32
818	RcMonitor RECT
819	RcWork    RECT
820	DwFlags   uint32
821}
822
823// http://msdn.microsoft.com/en-us/library/windows/desktop/dd145066.aspx
824type MONITORINFOEX struct {
825	MONITORINFO
826	SzDevice [CCHDEVICENAME]uint16
827}
828
829// http://msdn.microsoft.com/en-us/library/windows/desktop/dd368826.aspx
830type PIXELFORMATDESCRIPTOR struct {
831	Size                   uint16
832	Version                uint16
833	DwFlags                uint32
834	IPixelType             byte
835	ColorBits              byte
836	RedBits, RedShift      byte
837	GreenBits, GreenShift  byte
838	BlueBits, BlueShift    byte
839	AlphaBits, AlphaShift  byte
840	AccumBits              byte
841	AccumRedBits           byte
842	AccumGreenBits         byte
843	AccumBlueBits          byte
844	AccumAlphaBits         byte
845	DepthBits, StencilBits byte
846	AuxBuffers             byte
847	ILayerType             byte
848	Reserved               byte
849	DwLayerMask            uint32
850	DwVisibleMask          uint32
851	DwDamageMask           uint32
852}
853
854// http://msdn.microsoft.com/en-us/library/windows/desktop/ms646270(v=vs.85).aspx
855type INPUT struct {
856	Type uint32
857	Mi   MOUSEINPUT
858	Ki   KEYBDINPUT
859	Hi   HARDWAREINPUT
860}
861
862// http://msdn.microsoft.com/en-us/library/windows/desktop/ms646273(v=vs.85).aspx
863type MOUSEINPUT struct {
864	Dx          int32
865	Dy          int32
866	MouseData   uint32
867	DwFlags     uint32
868	Time        uint32
869	DwExtraInfo uintptr
870}
871
872// http://msdn.microsoft.com/en-us/library/windows/desktop/ms646271(v=vs.85).aspx
873type KEYBDINPUT struct {
874	WVk         uint16
875	WScan       uint16
876	DwFlags     uint32
877	Time        uint32
878	DwExtraInfo uintptr
879}
880
881// http://msdn.microsoft.com/en-us/library/windows/desktop/ms646269(v=vs.85).aspx
882type HARDWAREINPUT struct {
883	UMsg    uint32
884	WParamL uint16
885	WParamH uint16
886}
887
888type KbdInput struct {
889	typ uint32
890	ki  KEYBDINPUT
891}
892
893type MouseInput struct {
894	typ uint32
895	mi  MOUSEINPUT
896}
897
898type HardwareInput struct {
899	typ uint32
900	hi  HARDWAREINPUT
901}
902