Full Code of tadvi/winc for AI

master 33fdab6e7e58 cached
114 files
394.0 KB
128.7k tokens
4003 symbols
1 requests
Download .txt
Showing preview only (420K chars total). Download the full file or copy to clipboard to get everything.
Repository: tadvi/winc
Branch: master
Commit: 33fdab6e7e58
Files: 114
Total size: 394.0 KB

Directory structure:
gitextract_bzexg7vw/

├── .gitignore
├── AUTHORS
├── LICENSE
├── README.md
├── app.go
├── bitmap.go
├── brush.go
├── buttons.go
├── canvas.go
├── color.go
├── combobox.go
├── commondlgs.go
├── controlbase.go
├── controller.go
├── dialog.go
├── edit.go
├── event.go
├── eventdata.go
├── eventmanager.go
├── examples/
│   ├── sample_contextmenu/
│   │   ├── app.manifest
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   ├── sample_control/
│   │   ├── main.go
│   │   └── topform.go
│   ├── sample_docking/
│   │   ├── app.manifest
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   ├── sample_hello/
│   │   └── main.go
│   ├── sample_image/
│   │   ├── app.manifest
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   ├── sample_imagebox/
│   │   ├── app.manifest
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   ├── sample_listview/
│   │   ├── app.manifest
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   ├── sample_minimal/
│   │   └── main.go
│   ├── sample_scrollview/
│   │   ├── app.manifest
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   ├── sample_slider/
│   │   ├── app.manifest
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   ├── sample_splitview/
│   │   ├── app.manifest
│   │   ├── layout.json
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   ├── sample_tab/
│   │   ├── app.manifest
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   └── sample_treeview/
│       ├── app.manifest
│       ├── main.go
│       ├── release.bat
│       └── rsrc.syso
├── font.go
├── form.go
├── globalvars.go
├── go.mod
├── icon.go
├── imagelist.go
├── imageview.go
├── imageviewbox.go
├── init.go
├── keyboard.go
├── label.go
├── layout.go
├── listview.go
├── menu.go
├── mousecontrol.go
├── msghandlerregistry.go
├── panel.go
├── path.go
├── pen.go
├── progressbar.go
├── rect.go
├── resizer.go
├── scrollview.go
├── slider.go
├── tabview.go
├── toolbar.go
├── tooltip.go
├── treeview.go
├── utils.go
├── w32/
│   ├── comctl32.go
│   ├── comdlg32.go
│   ├── constants.go
│   ├── gdi32.go
│   ├── gdiplus.go
│   ├── idispatch.go
│   ├── istream.go
│   ├── iunknown.go
│   ├── kernel32.go
│   ├── ole32.go
│   ├── oleaut32.go
│   ├── shcore.go
│   ├── shell32.go
│   ├── shlwapi.go
│   ├── toolbar.go
│   ├── typedef.go
│   ├── user32.go
│   ├── utils.go
│   ├── uxtheme.go
│   └── vars.go
└── wndproc.go

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out


================================================
FILE: AUTHORS
================================================
# This is the official list of 'Winc' authors for copyright purposes.

# Names should be added to this file as
#   Name or Organization <email address>
# The email address is not required for organizations.

# Please keep the list sorted.

# Contributors
# ============

Tad Vizbaras <tad@etasoft.com>


================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2019 winc Authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
# winc

Common library for Go GUI apps on Windows. It is for Windows OS only. This makes library smaller than some other UI libraries for Go.

Design goals: minimalism and simplicity.

## Dependencies

No other dependencies except Go standard library.

## Building

If you want to package icon files and other resources into binary **rsrc** tool is recommended:

	rsrc -manifest app.manifest -ico=app.ico,application_edit.ico,application_error.ico -o rsrc.syso

Here app.manifest is XML file in format:
```
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="App" type="win32"/>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
        </dependentAssembly>
    </dependency>
</assembly>
```

Most Windows applications do not display command prompt. Build your Go project with flag to indicate that it is Windows GUI binary:

	go build -ldflags="-H windowsgui"

## Samples

Best way to learn how to use the library is to look at the included **examples** projects.

## Setup

1. Make sure you have a working Go installation and build environment, see more for details on page below.
   http://golang.org/doc/install

2. go get github.com/tadvi/winc

## Icons

When rsrc is used to pack icons into binary it displays IDs of the packed icons.
```
rsrc -manifest app.manifest -ico=app.ico,lightning.ico,edit.ico,application_error.ico -o rsrc.syso
Manifest ID:  1
Icon  app.ico  ID:  10
Icon  lightning.ico  ID:  13
Icon  edit.ico  ID:  16
Icon  application_error.ico  ID:  19
```

Use IDs to reference packed icons.

```
const myIcon = 13

btn.SetResIcon(myIcon) // Set icon on the button.
```

Included source **examples** use basic building via `release.bat` files. Note that icon IDs are order dependent. So if you change they order in -ico flag then icon IDs will be different. If you want to keep order the same, just add new icons to the end of -ico comma separated list.

## Layout Manager

SimpleDock is default layout manager.

Current design of docking and split views allows building simple apps but if you need to have multiple split views in few different directions you might need to create your own layout manager.

Important point is to have **one** control inside SimpleDock set to dock as **Fill**. Controls that are not set to any docking get placed using SetPos() function. So you can have Panel set to dock at the Top and then have another dock to arrange controls inside that Panel or have controls placed using SetPos() at fixed positions.

![Example layout with two toolbars and status bar](dock_topbottom.png)

This is basic layout. Instead of toolbars and status bar you can have Panel or any other control that can resize. Panel can have its own internal Dock that will arrange other controls inside of it.

![Example layout with two toolbars and navigation on the left](dock_topleft.png)

This is layout with extra control(s) on the left. Left side is usually treeview or listview.

The rule is simple: you either dock controls using SimpleDock OR use SetPos() to set them at fixed positions. That's it.

At some point **winc** may get more sophisticated layout manager.

## Dialog Screens

Dialog screens are not based on Windows resource files (.rc). They are just windows with controls placed at fixed coordinates. This works fine for dialog screens up to 10-14 controls.

# Minimal Demo

```
package main

import (
	"github.com/tadvi/winc"
)

func main() {
	mainWindow := winc.NewForm(nil)
	mainWindow.SetSize(400, 300)  // (width, height)
	mainWindow.SetText("Hello World Demo")

	edt := winc.NewEdit(mainWindow)
	edt.SetPos(10, 20)
	// Most Controls have default size unless SetSize is called.
	edt.SetText("edit text")

	btn := winc.NewPushButton(mainWindow)
	btn.SetText("Show or Hide")
	btn.SetPos(40, 50)	// (x, y)
	btn.SetSize(100, 40) // (width, height)
	btn.OnClick().Bind(func(e *winc.Event) {
		if edt.Visible() {
			edt.Hide()
		} else {
			edt.Show()
		}
	})

	mainWindow.Center()
	mainWindow.Show()
	mainWindow.OnClose().Bind(wndOnClose)

	winc.RunMainLoop() // Must call to start event loop.
}

func wndOnClose(arg *winc.Event) {
	winc.Exit()
}
```

![Hello World](examples/hello.png)

Result of running sample_minimal.

## Create Your Own

It is good practice to create your own controls based on existing structures and event model.
Library contains some of the controls built that way: IconButton (button.go), ErrorPanel (panel.go), MultiEdit (edit.go), etc.
Please look at existing controls as examples before building your own.

When designing your own controls keep in mind that types have to be converted from Go into Win32 API and back.
This is usually due to string UTF8 and UTF16 conversions. But there are other types of conversions too.

When developing your own controls you might also need to:

	import "github.com/tadvi/winc/w32"

w32 has Win32 API low level constants and functions.

Look at **sample_control** for example of custom built window.

## Companion Package

[Go package for Windows Systray icon, menu and notifications](https://github.com/tadvi/systray)

## Credits

This library is built on

[AllenDang/gform Windows GUI framework for Go](https://github.com/AllenDang/gform)

**winc** takes most design decisions from **gform** and adds many more controls and code samples to it.




================================================
FILE: app.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"runtime"
	"unsafe"

	"github.com/tadvi/winc/w32"
)

var (
	// resource compilation tool assigns app.ico ID of 3
	// rsrc -manifest app.manifest -ico app.ico -o rsrc.syso
	AppIconID = 3
)

func init() {
	runtime.LockOSThread()

	gAppInstance = w32.GetModuleHandle("")
	if gAppInstance == 0 {
		panic("Error occurred in App.Init")
	}

	// Initialize the common controls
	var initCtrls w32.INITCOMMONCONTROLSEX
	initCtrls.DwSize = uint32(unsafe.Sizeof(initCtrls))
	initCtrls.DwICC =
		w32.ICC_LISTVIEW_CLASSES | w32.ICC_PROGRESS_CLASS | w32.ICC_TAB_CLASSES |
			w32.ICC_TREEVIEW_CLASSES | w32.ICC_BAR_CLASSES

	w32.InitCommonControlsEx(&initCtrls)
}

// SetAppIconID sets recource icon ID for the apps windows.
func SetAppIcon(appIconID int) {
	AppIconID = appIconID
}

func GetAppInstance() w32.HINSTANCE {
	return gAppInstance
}

func PreTranslateMessage(msg *w32.MSG) bool {
	// This functions is called by the MessageLoop. It processes the
	// keyboard accelerator keys and calls Controller.PreTranslateMessage for
	// keyboard and mouse events.

	processed := false

	if (msg.Message >= w32.WM_KEYFIRST && msg.Message <= w32.WM_KEYLAST) ||
		(msg.Message >= w32.WM_MOUSEFIRST && msg.Message <= w32.WM_MOUSELAST) {

		if msg.Hwnd != 0 {
			if controller := GetMsgHandler(msg.Hwnd); controller != nil {
				// Search the chain of parents for pretranslated messages.
				for p := controller; p != nil; p = p.Parent() {

					if processed = p.PreTranslateMessage(msg); processed {
						break
					}
				}
			}
		}
	}

	return processed
}

// RunMainLoop processes messages in main application loop.
func RunMainLoop() int {
	var m w32.MSG

	for w32.GetMessage(&m, 0, 0, 0) != 0 {

		if !PreTranslateMessage(&m) {
			w32.TranslateMessage(&m)
			w32.DispatchMessage(&m)
		}
	}

	w32.GdiplusShutdown()
	return int(m.WParam)
}

// PostMessages processes recent messages. Sometimes helpful for instant window refresh.
func PostMessages() {
	var m w32.MSG
	for i := 0; i < 10; i++ {
		if w32.GetMessage(&m, 0, 0, 0) != 0 {
			if !PreTranslateMessage(&m) {
				w32.TranslateMessage(&m)
				w32.DispatchMessage(&m)
			}
		}
	}
}

func Exit() {
	w32.PostQuitMessage(0)
}


================================================
FILE: bitmap.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"errors"
	"unsafe"

	"github.com/tadvi/winc/w32"
)

type Bitmap struct {
	handle        w32.HBITMAP
	width, height int
}

func assembleBitmapFromHBITMAP(hbitmap w32.HBITMAP) (*Bitmap, error) {
	var dib w32.DIBSECTION
	if w32.GetObject(w32.HGDIOBJ(hbitmap), unsafe.Sizeof(dib), unsafe.Pointer(&dib)) == 0 {
		return nil, errors.New("GetObject for HBITMAP failed")
	}

	return &Bitmap{
		handle: hbitmap,
		width:  int(dib.DsBmih.BiWidth),
		height: int(dib.DsBmih.BiHeight),
	}, nil
}

func NewBitmapFromFile(filepath string, background Color) (*Bitmap, error) {
	var gpBitmap *uintptr
	var err error

	gpBitmap, err = w32.GdipCreateBitmapFromFile(filepath)
	if err != nil {
		return nil, err
	}
	defer w32.GdipDisposeImage(gpBitmap)

	var hbitmap w32.HBITMAP
	// Reverse RGB to BGR to satisfy gdiplus color schema.
	hbitmap, err = w32.GdipCreateHBITMAPFromBitmap(gpBitmap, uint32(RGB(background.B(), background.G(), background.R())))
	if err != nil {
		return nil, err
	}

	return assembleBitmapFromHBITMAP(hbitmap)
}

func NewBitmapFromResource(instance w32.HINSTANCE, resName *uint16, resType *uint16, background Color) (*Bitmap, error) {
	var gpBitmap *uintptr
	var err error
	var hRes w32.HRSRC

	hRes, err = w32.FindResource(w32.HMODULE(instance), resName, resType)
	if err != nil {
		return nil, err
	}
	resSize := w32.SizeofResource(w32.HMODULE(instance), hRes)
	pResData := w32.LockResource(w32.LoadResource(w32.HMODULE(instance), hRes))
	resBuffer := w32.GlobalAlloc(w32.GMEM_MOVEABLE, resSize)
	pResBuffer := w32.GlobalLock(resBuffer)
	w32.MoveMemory(pResBuffer, pResData, resSize)

	stream := w32.CreateStreamOnHGlobal(resBuffer, false)

	gpBitmap, err = w32.GdipCreateBitmapFromStream(stream)
	if err != nil {
		return nil, err
	}
	defer stream.Release()
	defer w32.GlobalUnlock(resBuffer)
	defer w32.GlobalFree(resBuffer)
	defer w32.GdipDisposeImage(gpBitmap)

	var hbitmap w32.HBITMAP
	// Reverse gform.RGB to BGR to satisfy gdiplus color schema.
	hbitmap, err = w32.GdipCreateHBITMAPFromBitmap(gpBitmap, uint32(RGB(background.B(), background.G(), background.R())))
	if err != nil {
		return nil, err
	}

	return assembleBitmapFromHBITMAP(hbitmap)
}

func (bm *Bitmap) Dispose() {
	if bm.handle != 0 {
		w32.DeleteObject(w32.HGDIOBJ(bm.handle))
		bm.handle = 0
	}
}

func (bm *Bitmap) GetHBITMAP() w32.HBITMAP {
	return bm.handle
}

func (bm *Bitmap) Size() (int, int) {
	return bm.width, bm.height
}

func (bm *Bitmap) Height() int {
	return bm.height
}

func (bm *Bitmap) Width() int {
	return bm.width
}


================================================
FILE: brush.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"github.com/tadvi/winc/w32"
)

var DefaultBackgroundBrush = NewSystemColorBrush(w32.COLOR_BTNFACE)

type Brush struct {
	hBrush   w32.HBRUSH
	logBrush w32.LOGBRUSH
}

func NewSolidColorBrush(color Color) *Brush {
	lb := w32.LOGBRUSH{LbStyle: w32.BS_SOLID, LbColor: w32.COLORREF(color)}
	hBrush := w32.CreateBrushIndirect(&lb)
	if hBrush == 0 {
		panic("Faild to create solid color brush")
	}

	return &Brush{hBrush, lb}
}

func NewSystemColorBrush(colorIndex int) *Brush {
	//lb := w32.LOGBRUSH{LbStyle: w32.BS_SOLID, LbColor: w32.COLORREF(colorIndex)}
	lb := w32.LOGBRUSH{LbStyle: w32.BS_NULL}
	hBrush := w32.GetSysColorBrush(colorIndex)
	if hBrush == 0 {
		panic("GetSysColorBrush failed")
	}
	return &Brush{hBrush, lb}
}

func NewHatchedColorBrush(color Color) *Brush {
	lb := w32.LOGBRUSH{LbStyle: w32.BS_HATCHED, LbColor: w32.COLORREF(color)}
	hBrush := w32.CreateBrushIndirect(&lb)
	if hBrush == 0 {
		panic("Faild to create solid color brush")
	}

	return &Brush{hBrush, lb}
}

func NewNullBrush() *Brush {
	lb := w32.LOGBRUSH{LbStyle: w32.BS_NULL}
	hBrush := w32.CreateBrushIndirect(&lb)
	if hBrush == 0 {
		panic("Failed to create null brush")
	}

	return &Brush{hBrush, lb}
}

func (br *Brush) GetHBRUSH() w32.HBRUSH {
	return br.hBrush
}

func (br *Brush) GetLOGBRUSH() *w32.LOGBRUSH {
	return &br.logBrush
}

func (br *Brush) Dispose() {
	if br.hBrush != 0 {
		w32.DeleteObject(w32.HGDIOBJ(br.hBrush))
		br.hBrush = 0
	}
}


================================================
FILE: buttons.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"fmt"

	"github.com/tadvi/winc/w32"
)

type Button struct {
	ControlBase
	onClick EventManager
}

func (bt *Button) OnClick() *EventManager {
	return &bt.onClick
}

func (bt *Button) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_COMMAND:
		bt.onClick.Fire(NewEvent(bt, nil))
		/*case w32.WM_LBUTTONDOWN:
			w32.SetCapture(bt.Handle())
		case w32.WM_LBUTTONUP:
			w32.ReleaseCapture()*/
		/*case win.WM_GETDLGCODE:
		println("GETDLGCODE")*/
	}
	return w32.DefWindowProc(bt.hwnd, msg, wparam, lparam)
	//return bt.W32Control.WndProc(msg, wparam, lparam)
}

func (bt *Button) Checked() bool {
	result := w32.SendMessage(bt.hwnd, w32.BM_GETCHECK, 0, 0)
	return result == w32.BST_CHECKED
}

func (bt *Button) SetChecked(checked bool) {
	wparam := w32.BST_CHECKED
	if !checked {
		wparam = w32.BST_UNCHECKED
	}
	w32.SendMessage(bt.hwnd, w32.BM_SETCHECK, uintptr(wparam), 0)
}

// SetIcon sets icon on the button. Recommended icons are 32x32 with 32bit color depth.
func (bt *Button) SetIcon(ico *Icon) {
	w32.SendMessage(bt.hwnd, w32.BM_SETIMAGE, w32.IMAGE_ICON, uintptr(ico.handle))
}

func (bt *Button) SetResIcon(iconID uint16) {
	if ico, err := NewIconFromResource(GetAppInstance(), iconID); err == nil {
		bt.SetIcon(ico)
		return
	}
	panic(fmt.Sprintf("missing icon with icon ID: %d", iconID))
}

type PushButton struct {
	Button
}

func NewPushButton(parent Controller) *PushButton {
	pb := new(PushButton)

	pb.InitControl("BUTTON", parent, 0, w32.BS_PUSHBUTTON|w32.WS_TABSTOP|w32.WS_VISIBLE|w32.WS_CHILD)
	RegMsgHandler(pb)

	pb.SetFont(DefaultFont)
	pb.SetText("Button")
	pb.SetSize(100, 22)

	return pb
}

// SetDefault is used for dialogs to set default button.
func (pb *PushButton) SetDefault() {
	pb.SetAndClearStyleBits(w32.BS_DEFPUSHBUTTON, w32.BS_PUSHBUTTON)
}

// IconButton does not display text, requires SetResIcon call.
type IconButton struct {
	Button
}

func NewIconButton(parent Controller) *IconButton {
	pb := new(IconButton)

	pb.InitControl("BUTTON", parent, 0, w32.BS_ICON|w32.WS_TABSTOP|w32.WS_VISIBLE|w32.WS_CHILD)
	RegMsgHandler(pb)

	pb.SetFont(DefaultFont)
	// even if text would be set it would not be displayed
	pb.SetText("")
	pb.SetSize(100, 22)

	return pb
}

type CheckBox struct {
	Button
}

func NewCheckBox(parent Controller) *CheckBox {
	cb := new(CheckBox)

	cb.InitControl("BUTTON", parent, 0, w32.WS_TABSTOP|w32.WS_VISIBLE|w32.WS_CHILD|w32.BS_AUTOCHECKBOX)
	RegMsgHandler(cb)

	cb.SetFont(DefaultFont)
	cb.SetText("CheckBox")
	cb.SetSize(100, 22)

	return cb
}

type RadioButton struct {
	Button
}

func NewRadioButton(parent Controller) *RadioButton {
	rb := new(RadioButton)

	rb.InitControl("BUTTON", parent, 0, w32.WS_TABSTOP|w32.WS_VISIBLE|w32.WS_CHILD|w32.BS_AUTORADIOBUTTON)
	RegMsgHandler(rb)

	rb.SetFont(DefaultFont)
	rb.SetText("RadioButton")
	rb.SetSize(100, 22)

	return rb
}

type GroupBox struct {
	Button
}

func NewGroupBox(parent Controller) *GroupBox {
	gb := new(GroupBox)

	gb.InitControl("BUTTON", parent, 0, w32.WS_CHILD|w32.WS_VISIBLE|w32.WS_GROUP|w32.BS_GROUPBOX)
	RegMsgHandler(gb)

	gb.SetFont(DefaultFont)
	gb.SetText("GroupBox")
	gb.SetSize(100, 100)

	return gb
}


================================================
FILE: canvas.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"fmt"

	"github.com/tadvi/winc/w32"
)

type Canvas struct {
	hwnd         w32.HWND
	hdc          w32.HDC
	doNotDispose bool
}

var nullBrush = NewNullBrush()

func NewCanvasFromHwnd(hwnd w32.HWND) *Canvas {
	hdc := w32.GetDC(hwnd)
	if hdc == 0 {
		panic(fmt.Sprintf("Create canvas from %v failed.", hwnd))
	}

	return &Canvas{hwnd: hwnd, hdc: hdc, doNotDispose: false}
}

func NewCanvasFromHDC(hdc w32.HDC) *Canvas {
	if hdc == 0 {
		panic("Cannot create canvas from invalid HDC.")
	}

	return &Canvas{hdc: hdc, doNotDispose: true}
}

func (ca *Canvas) Dispose() {
	if !ca.doNotDispose && ca.hdc != 0 {
		if ca.hwnd == 0 {
			w32.DeleteDC(ca.hdc)
		} else {
			w32.ReleaseDC(ca.hwnd, ca.hdc)
		}

		ca.hdc = 0
	}
}

func (ca *Canvas) DrawBitmap(bmp *Bitmap, x, y int) {
	cdc := w32.CreateCompatibleDC(0)
	defer w32.DeleteDC(cdc)

	hbmpOld := w32.SelectObject(cdc, w32.HGDIOBJ(bmp.GetHBITMAP()))
	defer w32.SelectObject(cdc, w32.HGDIOBJ(hbmpOld))

	w, h := bmp.Size()

	w32.BitBlt(ca.hdc, x, y, w, h, cdc, 0, 0, w32.SRCCOPY)
}

func (ca *Canvas) DrawStretchedBitmap(bmp *Bitmap, rect *Rect) {
	cdc := w32.CreateCompatibleDC(0)
	defer w32.DeleteDC(cdc)

	hbmpOld := w32.SelectObject(cdc, w32.HGDIOBJ(bmp.GetHBITMAP()))
	defer w32.SelectObject(cdc, w32.HGDIOBJ(hbmpOld))

	w, h := bmp.Size()

	rc := rect.GetW32Rect()
	w32.StretchBlt(ca.hdc, int(rc.Left), int(rc.Top), int(rc.Right), int(rc.Bottom), cdc, 0, 0, w, h, w32.SRCCOPY)
}

func (ca *Canvas) DrawIcon(ico *Icon, x, y int) bool {
	return w32.DrawIcon(ca.hdc, x, y, ico.Handle())
}

// DrawFillRect draw and fill rectangle with color.
func (ca *Canvas) DrawFillRect(rect *Rect, pen *Pen, brush *Brush) {
	w32Rect := rect.GetW32Rect()

	previousPen := w32.SelectObject(ca.hdc, w32.HGDIOBJ(pen.GetHPEN()))
	defer w32.SelectObject(ca.hdc, previousPen)

	previousBrush := w32.SelectObject(ca.hdc, w32.HGDIOBJ(brush.GetHBRUSH()))
	defer w32.SelectObject(ca.hdc, previousBrush)

	w32.Rectangle(ca.hdc, w32Rect.Left, w32Rect.Top, w32Rect.Right, w32Rect.Bottom)
}

func (ca *Canvas) DrawRect(rect *Rect, pen *Pen) {
	w32Rect := rect.GetW32Rect()

	previousPen := w32.SelectObject(ca.hdc, w32.HGDIOBJ(pen.GetHPEN()))
	defer w32.SelectObject(ca.hdc, previousPen)

	// nullBrush is used to make interior of the rect transparent
	previousBrush := w32.SelectObject(ca.hdc, w32.HGDIOBJ(nullBrush.GetHBRUSH()))
	defer w32.SelectObject(ca.hdc, previousBrush)

	w32.Rectangle(ca.hdc, w32Rect.Left, w32Rect.Top, w32Rect.Right, w32Rect.Bottom)
}

func (ca *Canvas) FillRect(rect *Rect, brush *Brush) {
	w32.FillRect(ca.hdc, rect.GetW32Rect(), brush.GetHBRUSH())
}

func (ca *Canvas) DrawEllipse(rect *Rect, pen *Pen) {
	w32Rect := rect.GetW32Rect()

	previousPen := w32.SelectObject(ca.hdc, w32.HGDIOBJ(pen.GetHPEN()))
	defer w32.SelectObject(ca.hdc, previousPen)

	// nullBrush is used to make interior of the rect transparent
	previousBrush := w32.SelectObject(ca.hdc, w32.HGDIOBJ(nullBrush.GetHBRUSH()))
	defer w32.SelectObject(ca.hdc, previousBrush)

	w32.Ellipse(ca.hdc, w32Rect.Left, w32Rect.Top, w32Rect.Right, w32Rect.Bottom)
}

// DrawFillEllipse draw and fill ellipse with color.
func (ca *Canvas) DrawFillEllipse(rect *Rect, pen *Pen, brush *Brush) {
	w32Rect := rect.GetW32Rect()

	previousPen := w32.SelectObject(ca.hdc, w32.HGDIOBJ(pen.GetHPEN()))
	defer w32.SelectObject(ca.hdc, previousPen)

	previousBrush := w32.SelectObject(ca.hdc, w32.HGDIOBJ(brush.GetHBRUSH()))
	defer w32.SelectObject(ca.hdc, previousBrush)

	w32.Ellipse(ca.hdc, w32Rect.Left, w32Rect.Top, w32Rect.Right, w32Rect.Bottom)
}

func (ca *Canvas) DrawLine(x, y, x2, y2 int, pen *Pen) {
	w32.MoveToEx(ca.hdc, x, y, nil)

	previousPen := w32.SelectObject(ca.hdc, w32.HGDIOBJ(pen.GetHPEN()))
	defer w32.SelectObject(ca.hdc, previousPen)

	w32.LineTo(ca.hdc, int32(x2), int32(y2))
}

// Refer win32 DrawText document for uFormat.
func (ca *Canvas) DrawText(text string, rect *Rect, format uint, font *Font, textColor Color) {
	previousFont := w32.SelectObject(ca.hdc, w32.HGDIOBJ(font.GetHFONT()))
	defer w32.SelectObject(ca.hdc, w32.HGDIOBJ(previousFont))

	previousBkMode := w32.SetBkMode(ca.hdc, w32.TRANSPARENT)
	defer w32.SetBkMode(ca.hdc, previousBkMode)

	previousTextColor := w32.SetTextColor(ca.hdc, w32.COLORREF(textColor))
	defer w32.SetTextColor(ca.hdc, previousTextColor)

	w32.DrawText(ca.hdc, text, len(text), rect.GetW32Rect(), format)
}


================================================
FILE: color.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

type Color uint32

func RGB(r, g, b byte) Color {
	return Color(uint32(r) | uint32(g)<<8 | uint32(b)<<16)
}

func (c Color) R() byte {
	return byte(c & 0xff)
}

func (c Color) G() byte {
	return byte((c >> 8) & 0xff)
}

func (c Color) B() byte {
	return byte((c >> 16) & 0xff)
}


================================================
FILE: combobox.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 */

package winc

import (
	"syscall"
	"unsafe"

	"github.com/tadvi/winc/w32"
)

type ComboBox struct {
	ControlBase
	onSelectedChange EventManager
}

func NewComboBox(parent Controller) *ComboBox {
	cb := new(ComboBox)

	cb.InitControl("COMBOBOX", parent, 0, w32.WS_CHILD|w32.WS_VISIBLE|w32.WS_TABSTOP|w32.WS_VSCROLL|w32.CBS_DROPDOWNLIST)
	RegMsgHandler(cb)

	cb.SetFont(DefaultFont)
	cb.SetSize(200, 400)
	return cb
}

func (cb *ComboBox) DeleteAllItems() bool {
	return w32.SendMessage(cb.hwnd, w32.CB_RESETCONTENT, 0, 0) == w32.TRUE
}

func (cb *ComboBox) InsertItem(index int, str string) bool {
	lp := uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(str)))
	return w32.SendMessage(cb.hwnd, w32.CB_INSERTSTRING, uintptr(index), lp) != w32.CB_ERR
}

func (cb *ComboBox) DeleteItem(index int) bool {
	return w32.SendMessage(cb.hwnd, w32.CB_DELETESTRING, uintptr(index), 0) != w32.CB_ERR
}

func (cb *ComboBox) SelectedItem() int {
	return int(int32(w32.SendMessage(cb.hwnd, w32.CB_GETCURSEL, 0, 0)))
}

func (cb *ComboBox) SetSelectedItem(value int) bool {
	return int(int32(w32.SendMessage(cb.hwnd, w32.CB_SETCURSEL, uintptr(value), 0))) == value
}

func (cb *ComboBox) OnSelectedChange() *EventManager {
	return &cb.onSelectedChange
}

// Message processer
func (cb *ComboBox) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_COMMAND:
		code := w32.HIWORD(uint32(wparam))

		switch code {
		case w32.CBN_SELCHANGE:
			cb.onSelectedChange.Fire(NewEvent(cb, nil))
		}
	}
	return w32.DefWindowProc(cb.hwnd, msg, wparam, lparam)
	//return cb.W32Control.WndProc(msg, wparam, lparam)
}


================================================
FILE: commondlgs.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"fmt"
	"syscall"
	"unsafe"

	"github.com/tadvi/winc/w32"
)

func genOFN(parent Controller, title, filter string, filterIndex uint, initialDir string, buf []uint16) *w32.OPENFILENAME {
	var ofn w32.OPENFILENAME
	ofn.StructSize = uint32(unsafe.Sizeof(ofn))
	ofn.Owner = parent.Handle()

	if filter != "" {
		filterBuf := make([]uint16, len(filter)+1)
		copy(filterBuf, syscall.StringToUTF16(filter))
		// Replace '|' with the expected '\0'
		for i, c := range filterBuf {
			if byte(c) == '|' {
				filterBuf[i] = uint16(0)
			}
		}
		ofn.Filter = &filterBuf[0]
		ofn.FilterIndex = uint32(filterIndex)
	}

	ofn.File = &buf[0]
	ofn.MaxFile = uint32(len(buf))

	if initialDir != "" {
		ofn.InitialDir = syscall.StringToUTF16Ptr(initialDir)
	}
	if title != "" {
		ofn.Title = syscall.StringToUTF16Ptr(title)
	}

	ofn.Flags = w32.OFN_FILEMUSTEXIST
	return &ofn
}

func ShowOpenFileDlg(parent Controller, title, filter string, filterIndex uint, initialDir string) (filePath string, accepted bool) {
	buf := make([]uint16, 1024)
	ofn := genOFN(parent, title, filter, filterIndex, initialDir, buf)

	if accepted = w32.GetOpenFileName(ofn); accepted {
		filePath = syscall.UTF16ToString(buf)
	}
	return
}

func ShowSaveFileDlg(parent Controller, title, filter string, filterIndex uint, initialDir string) (filePath string, accepted bool) {
	buf := make([]uint16, 1024)
	ofn := genOFN(parent, title, filter, filterIndex, initialDir, buf)

	if accepted = w32.GetSaveFileName(ofn); accepted {
		filePath = syscall.UTF16ToString(buf)
	}
	return
}

func ShowBrowseFolderDlg(parent Controller, title string) (folder string, accepted bool) {
	var bi w32.BROWSEINFO
	bi.Owner = parent.Handle()
	bi.Title = syscall.StringToUTF16Ptr(title)
	bi.Flags = w32.BIF_RETURNONLYFSDIRS | w32.BIF_NEWDIALOGSTYLE

	w32.CoInitialize()
	ret := w32.SHBrowseForFolder(&bi)
	w32.CoUninitialize()

	folder = w32.SHGetPathFromIDList(ret)
	accepted = folder != ""
	return
}

// MsgBoxOkCancel basic pop up message. Returns 1 for OK and 2 for CANCEL.
func MsgBoxOkCancel(parent Controller, title, caption string) int {
	return MsgBox(parent, title, caption, w32.MB_ICONEXCLAMATION|w32.MB_OKCANCEL)
}

func MsgBoxYesNo(parent Controller, title, caption string) int {
	return MsgBox(parent, title, caption, w32.MB_ICONEXCLAMATION|w32.MB_YESNO)
}

func MsgBoxOk(parent Controller, title, caption string) {
	MsgBox(parent, title, caption, w32.MB_ICONINFORMATION|w32.MB_OK)
}

// Warningf is generic warning message with OK and Cancel buttons. Returns 1 for OK.
func Warningf(parent Controller, format string, data ...interface{}) int {
	caption := fmt.Sprintf(format, data...)
	return MsgBox(parent, "Warning", caption, w32.MB_ICONWARNING|w32.MB_OKCANCEL)
}

// Printf is generic info message with OK button.
func Printf(parent Controller, format string, data ...interface{}) {
	caption := fmt.Sprintf(format, data...)
	MsgBox(parent, "Information", caption, w32.MB_ICONINFORMATION|w32.MB_OK)
}

// Errorf is generic error message with OK button.
func Errorf(parent Controller, format string, data ...interface{}) {
	caption := fmt.Sprintf(format, data...)
	MsgBox(parent, "Error", caption, w32.MB_ICONERROR|w32.MB_OK)
}

func MsgBox(parent Controller, title, caption string, flags uint) int {
	var result int
	if parent != nil {
		result = w32.MessageBox(parent.Handle(), caption, title, flags)
	} else {
		result = w32.MessageBox(0, caption, title, flags)
	}

	return result
}


================================================
FILE: controlbase.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"fmt"
	"syscall"
	"unsafe"

	"github.com/tadvi/winc/w32"
)

type ControlBase struct {
	hwnd        w32.HWND
	font        *Font
	parent      Controller
	contextMenu *MenuItem

	isForm bool

	minWidth, minHeight int
	maxWidth, maxHeight int

	// General events
	onCreate EventManager
	onClose  EventManager

	// Focus events
	onKillFocus EventManager
	onSetFocus  EventManager

	// Drag and drop events
	onDropFiles EventManager

	// Mouse events
	onLBDown    EventManager
	onLBUp      EventManager
	onLBDbl     EventManager
	onMBDown    EventManager
	onMBUp      EventManager
	onRBDown    EventManager
	onRBUp      EventManager
	onRBDbl     EventManager
	onMouseMove EventManager

	// use MouseControl to capture onMouseHover and onMouseLeave events.
	onMouseHover EventManager
	onMouseLeave EventManager

	// Keyboard events
	onKeyUp EventManager

	// Paint events
	onPaint EventManager
	onSize  EventManager
}

// initControl is called by controls: edit, button, treeview, listview, and so on.
func (cba *ControlBase) InitControl(className string, parent Controller, exstyle, style uint) {
	cba.hwnd = CreateWindow(className, parent, exstyle, style)
	if cba.hwnd == 0 {
		panic("cannot create window for " + className)
	}
	cba.parent = parent
}

// InitWindow is called by custom window based controls such as split, panel, etc.
func (cba *ControlBase) InitWindow(className string, parent Controller, exstyle, style uint) {
	RegClassOnlyOnce(className)
	cba.hwnd = CreateWindow(className, parent, exstyle, style)
	if cba.hwnd == 0 {
		panic("cannot create window for " + className)
	}
	cba.parent = parent
}

// SetTheme for TreeView and ListView controls.
func (cba *ControlBase) SetTheme(appName string) error {
	if hr := w32.SetWindowTheme(cba.hwnd, syscall.StringToUTF16Ptr(appName), nil); w32.FAILED(hr) {
		return fmt.Errorf("SetWindowTheme %d", hr)
	}
	return nil
}

func (cba *ControlBase) Handle() w32.HWND {
	return cba.hwnd
}

func (cba *ControlBase) SetHandle(hwnd w32.HWND) {
	cba.hwnd = hwnd
}

func (cba *ControlBase) GetWindowDPI() (w32.UINT, w32.UINT) {
	monitor := w32.MonitorFromWindow(cba.hwnd, w32.MONITOR_DEFAULTTOPRIMARY)
	var dpiX, dpiY w32.UINT
	w32.GetDPIForMonitor(monitor, w32.MDT_EFFECTIVE_DPI, &dpiX, &dpiY)
	return dpiX, dpiY
}

func (cba *ControlBase) SetAndClearStyleBits(set, clear uint32) error {
	style := uint32(w32.GetWindowLong(cba.hwnd, w32.GWL_STYLE))
	if style == 0 {
		return fmt.Errorf("GetWindowLong")
	}

	if newStyle := style&^clear | set; newStyle != style {
		if w32.SetWindowLong(cba.hwnd, w32.GWL_STYLE, newStyle) == 0 {
			return fmt.Errorf("SetWindowLong")
		}
	}
	return nil
}

func (cba *ControlBase) SetIsForm(isform bool) {
	cba.isForm = isform
}

func (cba *ControlBase) SetText(caption string) {
	w32.SetWindowText(cba.hwnd, caption)
}

func (cba *ControlBase) Text() string {
	return w32.GetWindowText(cba.hwnd)
}

func (cba *ControlBase) Close() {
	UnRegMsgHandler(cba.hwnd)
	w32.DestroyWindow(cba.hwnd)
}

func (cba *ControlBase) SetTranslucentBackground() {
	var accent = w32.ACCENT_POLICY{
		AccentState: w32.ACCENT_ENABLE_BLURBEHIND,
	}
	var data w32.WINDOWCOMPOSITIONATTRIBDATA
	data.Attrib = w32.WCA_ACCENT_POLICY
	data.PvData = unsafe.Pointer(&accent)
	data.CbData = unsafe.Sizeof(accent)

	w32.SetWindowCompositionAttribute(cba.hwnd, &data)
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func (cba *ControlBase) clampSize(width, height int) (int, int) {
	if cba.minWidth != 0 {
		width = max(width, cba.minWidth)
	}
	if cba.maxWidth != 0 {
		width = min(width, cba.maxWidth)
	}
	if cba.minHeight != 0 {
		height = max(height, cba.minHeight)
	}
	if cba.maxHeight != 0 {
		height = min(height, cba.maxHeight)
	}
	return width, height
}

func (cba *ControlBase) SetSize(width, height int) {
	x, y := cba.Pos()
	width, height = cba.clampSize(width, height)
	w32.MoveWindow(cba.hwnd, x, y, width, height, true)
}

func (cba *ControlBase) SetMinSize(width, height int) {
	cba.minWidth = width
	cba.minHeight = height

	// Ensure we set max if min > max
	if cba.maxWidth > 0 {
		cba.maxWidth = max(cba.minWidth, cba.maxWidth)
	}
	if cba.maxHeight > 0 {
		cba.maxHeight = max(cba.minHeight, cba.maxHeight)
	}

	x, y := cba.Pos()
	currentWidth, currentHeight := cba.Size()
	clampedWidth, clampedHeight := cba.clampSize(currentWidth, currentHeight)
	if clampedWidth != currentWidth || clampedHeight != currentHeight {
		w32.MoveWindow(cba.hwnd, x, y, clampedWidth, clampedHeight, true)
	}
}
func (cba *ControlBase) SetMaxSize(width, height int) {
	cba.maxWidth = width
	cba.maxHeight = height

	// Ensure we set min if max > min
	if cba.minWidth > 0 {
		cba.minWidth = min(cba.maxWidth, cba.minWidth)
	}
	if cba.maxHeight > 0 {
		cba.minHeight = min(cba.maxHeight, cba.minHeight)
	}

	x, y := cba.Pos()
	currentWidth, currentHeight := cba.Size()
	clampedWidth, clampedHeight := cba.clampSize(currentWidth, currentHeight)
	if clampedWidth != currentWidth || clampedHeight != currentHeight {
		w32.MoveWindow(cba.hwnd, x, y, clampedWidth, clampedHeight, true)
	}
}

func (cba *ControlBase) Size() (width, height int) {
	rect := w32.GetWindowRect(cba.hwnd)
	width = int(rect.Right - rect.Left)
	height = int(rect.Bottom - rect.Top)
	return
}

func (cba *ControlBase) Width() int {
	rect := w32.GetWindowRect(cba.hwnd)
	return int(rect.Right - rect.Left)
}

func (cba *ControlBase) Height() int {
	rect := w32.GetWindowRect(cba.hwnd)
	return int(rect.Bottom - rect.Top)
}

func (cba *ControlBase) SetPos(x, y int) {
	info := getMonitorInfo(cba.hwnd)
	workRect := info.RcWork

	w32.SetWindowPos(cba.hwnd, w32.HWND_TOP, int(workRect.Left)+x, int(workRect.Top)+y, 0, 0, w32.SWP_NOSIZE)
}

func (cba *ControlBase) Pos() (x, y int) {
	rect := w32.GetWindowRect(cba.hwnd)
	x = int(rect.Left)
	y = int(rect.Top)
	if !cba.isForm && cba.parent != nil {
		x, y, _ = w32.ScreenToClient(cba.parent.Handle(), x, y)
	}
	return
}

func (cba *ControlBase) Visible() bool {
	return w32.IsWindowVisible(cba.hwnd)
}

func (cba *ControlBase) ToggleVisible() bool {
	visible := w32.IsWindowVisible(cba.hwnd)
	if visible {
		cba.Hide()
	} else {
		cba.Show()
	}
	return !visible
}

func (cba *ControlBase) ContextMenu() *MenuItem {
	return cba.contextMenu
}

func (cba *ControlBase) SetContextMenu(menu *MenuItem) {
	cba.contextMenu = menu
}

func (cba *ControlBase) Bounds() *Rect {
	rect := w32.GetWindowRect(cba.hwnd)
	if cba.isForm {
		return &Rect{*rect}
	}

	return ScreenToClientRect(cba.hwnd, rect)
}

func (cba *ControlBase) ClientRect() *Rect {
	rect := w32.GetClientRect(cba.hwnd)
	return ScreenToClientRect(cba.hwnd, rect)
}
func (cba *ControlBase) ClientWidth() int {
	rect := w32.GetClientRect(cba.hwnd)
	return int(rect.Right - rect.Left)
}

func (cba *ControlBase) ClientHeight() int {
	rect := w32.GetClientRect(cba.hwnd)
	return int(rect.Bottom - rect.Top)
}

func (cba *ControlBase) Show() {
	w32.ShowWindow(cba.hwnd, w32.SW_SHOWDEFAULT)
}

func (cba *ControlBase) Hide() {
	w32.ShowWindow(cba.hwnd, w32.SW_HIDE)
}

func (cba *ControlBase) Enabled() bool {
	return w32.IsWindowEnabled(cba.hwnd)
}

func (cba *ControlBase) SetEnabled(b bool) {
	w32.EnableWindow(cba.hwnd, b)
}

func (cba *ControlBase) SetFocus() {
	w32.SetFocus(cba.hwnd)
}

func (cba *ControlBase) Invalidate(erase bool) {
	// pRect := w32.GetClientRect(cba.hwnd)
	// if cba.isForm {
	// 	w32.InvalidateRect(cba.hwnd, pRect, erase)
	// } else {
	// 	rc := ScreenToClientRect(cba.hwnd, pRect)
	// 	w32.InvalidateRect(cba.hwnd, rc.GetW32Rect(), erase)
	// }
	w32.InvalidateRect(cba.hwnd, nil, erase)
}

func (cba *ControlBase) Parent() Controller {
	return cba.parent
}

func (cba *ControlBase) SetParent(parent Controller) {
	cba.parent = parent
}

func (cba *ControlBase) Font() *Font {
	return cba.font
}

func (cba *ControlBase) SetFont(font *Font) {
	w32.SendMessage(cba.hwnd, w32.WM_SETFONT, uintptr(font.hfont), 1)
	cba.font = font
}

func (cba *ControlBase) EnableDragAcceptFiles(b bool) {
	w32.DragAcceptFiles(cba.hwnd, b)
}

func (cba *ControlBase) InvokeRequired() bool {
	if cba.hwnd == 0 {
		return false
	}

	windowThreadId, _ := w32.GetWindowThreadProcessId(cba.hwnd)
	currentThreadId := w32.GetCurrentThread()

	return windowThreadId != currentThreadId
}

func (cba *ControlBase) PreTranslateMessage(msg *w32.MSG) bool {
	if msg.Message == w32.WM_GETDLGCODE {
		println("pretranslate, WM_GETDLGCODE")
	}
	return false
}

//Events
func (cba *ControlBase) OnCreate() *EventManager {
	return &cba.onCreate
}

func (cba *ControlBase) OnClose() *EventManager {
	return &cba.onClose
}

func (cba *ControlBase) OnKillFocus() *EventManager {
	return &cba.onKillFocus
}

func (cba *ControlBase) OnSetFocus() *EventManager {
	return &cba.onSetFocus
}

func (cba *ControlBase) OnDropFiles() *EventManager {
	return &cba.onDropFiles
}

func (cba *ControlBase) OnLBDown() *EventManager {
	return &cba.onLBDown
}

func (cba *ControlBase) OnLBUp() *EventManager {
	return &cba.onLBUp
}

func (cba *ControlBase) OnLBDbl() *EventManager {
	return &cba.onLBDbl
}

func (cba *ControlBase) OnMBDown() *EventManager {
	return &cba.onMBDown
}

func (cba *ControlBase) OnMBUp() *EventManager {
	return &cba.onMBUp
}

func (cba *ControlBase) OnRBDown() *EventManager {
	return &cba.onRBDown
}

func (cba *ControlBase) OnRBUp() *EventManager {
	return &cba.onRBUp
}

func (cba *ControlBase) OnRBDbl() *EventManager {
	return &cba.onRBDbl
}

func (cba *ControlBase) OnMouseMove() *EventManager {
	return &cba.onMouseMove
}

func (cba *ControlBase) OnMouseHover() *EventManager {
	return &cba.onMouseHover
}

func (cba *ControlBase) OnMouseLeave() *EventManager {
	return &cba.onMouseLeave
}

func (cba *ControlBase) OnPaint() *EventManager {
	return &cba.onPaint
}

func (cba *ControlBase) OnSize() *EventManager {
	return &cba.onSize
}

func (cba *ControlBase) OnKeyUp() *EventManager {
	return &cba.onKeyUp
}


================================================
FILE: controller.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"github.com/tadvi/winc/w32"
)

type Controller interface {
	Text() string

	Enabled() bool
	SetFocus()

	Handle() w32.HWND
	Invalidate(erase bool)
	Parent() Controller

	Pos() (x, y int)
	Size() (w, h int)
	Height() int
	Width() int
	Visible() bool
	Bounds() *Rect
	ClientRect() *Rect

	SetText(s string)
	SetEnabled(b bool)
	SetPos(x, y int)
	SetSize(w, h int)
	EnableDragAcceptFiles(b bool)
	Show()
	Hide()

	ContextMenu() *MenuItem
	SetContextMenu(menu *MenuItem)

	Font() *Font
	SetFont(font *Font)
	InvokeRequired() bool
	PreTranslateMessage(msg *w32.MSG) bool
	WndProc(msg uint32, wparam, lparam uintptr) uintptr

	//General events
	OnCreate() *EventManager
	OnClose() *EventManager

	// Focus events
	OnKillFocus() *EventManager
	OnSetFocus() *EventManager

	//Drag and drop events
	OnDropFiles() *EventManager

	//Mouse events
	OnLBDown() *EventManager
	OnLBUp() *EventManager
	OnLBDbl() *EventManager
	OnMBDown() *EventManager
	OnMBUp() *EventManager
	OnRBDown() *EventManager
	OnRBUp() *EventManager
	OnRBDbl() *EventManager
	OnMouseMove() *EventManager

	// OnMouseLeave and OnMouseHover does not fire unless control called internalTrackMouseEvent.
	// Use MouseControl for a how to example.
	OnMouseHover() *EventManager
	OnMouseLeave() *EventManager

	//Keyboard events
	OnKeyUp() *EventManager

	//Paint events
	OnPaint() *EventManager
	OnSize() *EventManager
}


================================================
FILE: dialog.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import "github.com/tadvi/winc/w32"

// Dialog displayed as z-order top window until closed.
// It also disables parent window so it can not be clicked.
type Dialog struct {
	Form
	isModal bool

	btnOk     *PushButton
	btnCancel *PushButton

	onLoad   EventManager
	onOk     EventManager
	onCancel EventManager
}

func NewDialog(parent Controller) *Dialog {
	dlg := new(Dialog)

	dlg.isForm = true
	dlg.isModal = true
	RegClassOnlyOnce("winc_Dialog")

	dlg.hwnd = CreateWindow("winc_Dialog", parent, w32.WS_EX_CONTROLPARENT, /* IMPORTANT */
		w32.WS_SYSMENU|w32.WS_CAPTION|w32.WS_THICKFRAME /*|w32.WS_BORDER|w32.WS_POPUP*/)
	dlg.parent = parent

	// dlg might fail if icon resource is not embedded in the binary
	if ico, err := NewIconFromResource(GetAppInstance(), uint16(AppIconID)); err == nil {
		dlg.SetIcon(0, ico)
	}

	// Dlg forces display of focus rectangles, as soon as the user starts to type.
	w32.SendMessage(dlg.hwnd, w32.WM_CHANGEUISTATE, w32.UIS_INITIALIZE, 0)
	RegMsgHandler(dlg)

	dlg.SetFont(DefaultFont)
	dlg.SetText("Form")
	dlg.SetSize(200, 100)
	return dlg
}

func (dlg *Dialog) SetModal(modal bool) {
	dlg.isModal = modal
}

// SetButtons wires up dialog events to buttons. btnCancel can be nil.
func (dlg *Dialog) SetButtons(btnOk *PushButton, btnCancel *PushButton) {
	dlg.btnOk = btnOk
	dlg.btnOk.SetDefault()
	dlg.btnCancel = btnCancel
}

// Events
func (dlg *Dialog) OnLoad() *EventManager {
	return &dlg.onLoad
}

func (dlg *Dialog) OnOk() *EventManager {
	return &dlg.onOk
}

func (dlg *Dialog) OnCancel() *EventManager {
	return &dlg.onCancel
}

// PreTranslateMessage handles dialog specific messages. IMPORTANT.
func (dlg *Dialog) PreTranslateMessage(msg *w32.MSG) bool {
	if msg.Message >= w32.WM_KEYFIRST && msg.Message <= w32.WM_KEYLAST {
		if w32.IsDialogMessage(dlg.hwnd, msg) {
			return true
		}
	}
	return false
}

// Show dialog performs special setup for dialog windows.
func (dlg *Dialog) Show() {
	if dlg.isModal {
		dlg.Parent().SetEnabled(false)
	}
	dlg.onLoad.Fire(NewEvent(dlg, nil))
	dlg.Form.Show()
}

// Close dialog when you done with it.
func (dlg *Dialog) Close() {
	if dlg.isModal {
		dlg.Parent().SetEnabled(true)
	}
	dlg.ControlBase.Close()
}

func (dlg *Dialog) cancel() {
	if dlg.btnCancel != nil {
		dlg.btnCancel.onClick.Fire(NewEvent(dlg.btnCancel, nil))
	}
	dlg.onCancel.Fire(NewEvent(dlg, nil))
}

func (dlg *Dialog) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_COMMAND:
		switch w32.LOWORD(uint32(wparam)) {
		case w32.IDOK:
			if dlg.btnOk != nil {
				dlg.btnOk.onClick.Fire(NewEvent(dlg.btnOk, nil))
			}
			dlg.onOk.Fire(NewEvent(dlg, nil))
			return w32.TRUE

		case w32.IDCANCEL:
			dlg.cancel()
			return w32.TRUE
		}

	case w32.WM_CLOSE:
		dlg.cancel() // use onCancel or dlg.btnCancel.OnClick to close
		return 0

	case w32.WM_DESTROY:
		if dlg.isModal {
			dlg.Parent().SetEnabled(true)
		}
	}
	return w32.DefWindowProc(dlg.hwnd, msg, wparam, lparam)
}


================================================
FILE: edit.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import "github.com/tadvi/winc/w32"

type Edit struct {
	ControlBase
	onChange EventManager
}

const passwordChar = '*'
const nopasswordChar = ' '

func NewEdit(parent Controller) *Edit {
	edt := new(Edit)

	edt.InitControl("EDIT", parent, w32.WS_EX_CLIENTEDGE, w32.WS_CHILD|w32.WS_VISIBLE|w32.WS_TABSTOP|w32.ES_LEFT|
		w32.ES_AUTOHSCROLL)
	RegMsgHandler(edt)

	edt.SetFont(DefaultFont)
	edt.SetSize(200, 22)
	return edt
}

// Events.
func (ed *Edit) OnChange() *EventManager {
	return &ed.onChange
}

// Public methods.
func (ed *Edit) SetReadOnly(isReadOnly bool) {
	w32.SendMessage(ed.hwnd, w32.EM_SETREADONLY, uintptr(w32.BoolToBOOL(isReadOnly)), 0)
}

//Public methods
func (ed *Edit) SetPassword(isPassword bool) {
	if isPassword {
		w32.SendMessage(ed.hwnd, w32.EM_SETPASSWORDCHAR, uintptr(passwordChar), 0)
	} else {
		w32.SendMessage(ed.hwnd, w32.EM_SETPASSWORDCHAR, 0, 0)
	}
}

func (ed *Edit) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_COMMAND:
		switch w32.HIWORD(uint32(wparam)) {
		case w32.EN_CHANGE:
			ed.onChange.Fire(NewEvent(ed, nil))
		}
		/*case w32.WM_GETDLGCODE:
		println("Edit")
		if wparam == w32.VK_RETURN {
			return w32.DLGC_WANTALLKEYS
		}*/
	}
	return w32.DefWindowProc(ed.hwnd, msg, wparam, lparam)
}

// MultiEdit is multiline text edit.
type MultiEdit struct {
	ControlBase
	onChange EventManager
}

func NewMultiEdit(parent Controller) *MultiEdit {
	med := new(MultiEdit)

	med.InitControl("EDIT", parent, w32.WS_EX_CLIENTEDGE, w32.WS_CHILD|w32.WS_VISIBLE|w32.WS_TABSTOP|w32.ES_LEFT|
		w32.WS_VSCROLL|w32.WS_HSCROLL|w32.ES_MULTILINE|w32.ES_WANTRETURN|w32.ES_AUTOHSCROLL|w32.ES_AUTOVSCROLL)
	RegMsgHandler(med)

	med.SetFont(DefaultFont)
	med.SetSize(200, 400)
	return med
}

// Events
func (med *MultiEdit) OnChange() *EventManager {
	return &med.onChange
}

// Public methods
func (med *MultiEdit) SetReadOnly(isReadOnly bool) {
	w32.SendMessage(med.hwnd, w32.EM_SETREADONLY, uintptr(w32.BoolToBOOL(isReadOnly)), 0)
}

func (med *MultiEdit) AddLine(text string) {
	if len(med.Text()) == 0 {
		med.SetText(text)
	} else {
		med.SetText(med.Text() + "\r\n" + text)
	}
}

func (med *MultiEdit) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	switch msg {

	case w32.WM_COMMAND:
		switch w32.HIWORD(uint32(wparam)) {
		case w32.EN_CHANGE:
			med.onChange.Fire(NewEvent(med, nil))
		}
	}
	return w32.DefWindowProc(med.hwnd, msg, wparam, lparam)
}


================================================
FILE: event.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

type Event struct {
	Sender Controller
	Data   interface{}
}

func NewEvent(sender Controller, data interface{}) *Event {
	return &Event{Sender: sender, Data: data}
}


================================================
FILE: eventdata.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"github.com/tadvi/winc/w32"
)

type RawMsg struct {
	Hwnd           w32.HWND
	Msg            uint32
	WParam, LParam uintptr
}

type MouseEventData struct {
	X, Y   int
	Button int
	Wheel  int
}

type DropFilesEventData struct {
	X, Y  int
	Files []string
}

type PaintEventData struct {
	Canvas *Canvas
}

type LabelEditEventData struct {
	Item ListItem
	Text string
	//PszText *uint16
}

/*type LVDBLClickEventData struct {
	NmItem *w32.NMITEMACTIVATE
}*/

type KeyUpEventData struct {
	VKey, Code int
}

type SizeEventData struct {
	Type uint
	X, Y int
}


================================================
FILE: eventmanager.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

type EventHandler func(arg *Event)

type EventManager struct {
	handler EventHandler
}

func (evm *EventManager) Fire(arg *Event) {
	if evm.handler != nil {
		evm.handler(arg)
	}
}

func (evm *EventManager) Bind(handler EventHandler) {
	evm.handler = handler
}


================================================
FILE: examples/sample_contextmenu/app.manifest
================================================
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="App" type="win32"/>
        <dependency>
            <dependentAssembly>
                <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
            </dependentAssembly>
        </dependency>
    </assembly>


================================================
FILE: examples/sample_contextmenu/main.go
================================================
package main

import (
	"fmt"

	"github.com/tadvi/winc"
)

func btnOnClick(arg *winc.Event) {
	fmt.Println("Button clicked")
}

func wndOnClose(arg *winc.Event) {
	winc.Exit()
}

// Item for the treeview.
type Item struct {
	T string
}

func (item Item) Text() string    { return item.T }
func (item Item) ImageIndex() int { return 0 }

func main() {
	mainWindow := winc.NewForm(nil)
	dock := winc.NewSimpleDock(mainWindow)
	mainWindow.SetLayout(dock)

	mainWindow.SetSize(700, 600)
	mainWindow.SetText("Controls Demo")

	menu := mainWindow.NewMenu()
	fileMn := menu.AddSubMenu("File")
	fileMn.AddItem("New", winc.NoShortcut)
	editMn := menu.AddSubMenu("Edit")
	cutMn := editMn.AddItem("Cut", winc.Shortcut{winc.ModControl, winc.KeyX})
	copyMn := editMn.AddItem("Copy", winc.NoShortcut)
	pasteMn := editMn.AddItem("Paste", winc.NoShortcut)
	menu.Show()
	copyMn.SetCheckable(true)
	copyMn.SetChecked(true)
	pasteMn.SetEnabled(false)

	tabs := winc.NewMultiPanel(mainWindow)
	tabs.SetPos(10, 10)
	tabs.SetSize(100, 92)

	tree := winc.NewTreeView(mainWindow)
	tree.SetPos(10, 80)
	p := &Item{"First Item"}
	tree.InsertItem(p, nil, nil)
	sec := &Item{"Second"}
	if err := tree.InsertItem(sec, p, nil); err != nil {
		panic(err)
	}
	if err := tree.InsertItem(&Item{"Third"}, p, nil); err != nil {
		panic(err)
	}
	if err := tree.InsertItem(&Item{"Fourth"}, p, nil); err != nil {
		panic(err)
	}
	for i := 0; i < 50; i++ {
		if err := tree.InsertItem(&Item{"after second"}, sec, nil); err != nil {
			panic(err)
		}
	}
	tree.Expand(p)
	tree.OnCollapse().Bind(func(e *winc.Event) {
		println("collapse")
	})

	// Pop up menu.
	popupMn := winc.NewContextMenu()
	cutAllMn := popupMn.AddItemCheckable("Cut All", winc.NoShortcut)
	cutAllMn.SetChecked(true)
	copyAllMn := popupMn.AddItem("Copy All", winc.NoShortcut)
	copyAllMn.SetEnabled(false)
	_ = popupMn.AddItem("Paste All", winc.NoShortcut)
	// Attach pop up menu to the treeview.
	tree.SetContextMenu(popupMn)

	cutAllMn.OnClick().Bind(func(e *winc.Event) { fmt.Println("cutAllMn") })
	copyAllMn.OnClick().Bind(func(e *winc.Event) { fmt.Println("copyAllMn") })

	cutMn.OnClick().Bind(func(e *winc.Event) {
		println("cut click")
		ok := tree.EnsureVisible(p)
		fmt.Println("result of EnsureVisible", ok)
	})

	panel := winc.NewPanel(tabs)
	tabs.AddPanel(panel)

	panelDock := winc.NewSimpleDock(panel)
	panel.SetLayout(panelDock)
	panel.SetPos(0, 0)

	panelErr := winc.NewErrorPanel(panel)
	panelErr.SetPos(140, 10)
	panelErr.SetSize(200, 32)
	panelErr.ShowAsError(false)

	edt := winc.NewEdit(panel)
	edt.SetPos(10, 535)
	edt.SetText("some text")

	btn := winc.NewPushButton(panel)
	btn.SetText("Button")
	btn.SetSize(100, 40)
	btn.OnClick().Bind(func(e *winc.Event) {
		if edt.Visible() {
			edt.Hide()
		} else {
			edt.Show()
		}
	})
	btn.SetResIcon(13)

	panelDock.Dock(btn, winc.Top)
	panelDock.Dock(edt, winc.Top)
	panelDock.Dock(panelErr, winc.Top)

	dock.Dock(tree, winc.Left)
	dock.Dock(tabs, winc.Top)

	mainWindow.Center()
	mainWindow.Show()
	mainWindow.OnClose().Bind(wndOnClose)

	winc.RunMainLoop()
}


================================================
FILE: examples/sample_contextmenu/release.bat
================================================
rsrc -manifest app.manifest -ico=app.ico,application_lightning.ico,application_edit.ico,application_error.ico -o rsrc.syso
go build -ldflags="-H windowsgui"


================================================
FILE: examples/sample_control/main.go
================================================
package main

import (
	"github.com/tadvi/winc"
)

func main() {
	mainWindow := NewTopForm(nil) // Our TopForm control gets created here.
	mainWindow.SetSize(400, 300)
	mainWindow.SetText("Hello World Demo")

	edt := winc.NewEdit(mainWindow)
	edt.SetPos(10, 20)
	// Most Controls have default size unless SetSize is called.
	edt.SetText("edit text")

	btn := winc.NewPushButton(mainWindow)
	btn.SetText("Show or Hide")
	btn.SetPos(40, 50)
	btn.SetSize(100, 40)
	btn.OnClick().Bind(func(e *winc.Event) {
		if edt.Visible() {
			edt.Hide()
		} else {
			edt.Show()
		}
	})

	mainWindow.Center()
	mainWindow.Show()
	mainWindow.OnClose().Bind(wndOnClose)

	winc.RunMainLoop() // Must call to start event loop.
}

func wndOnClose(arg *winc.Event) {
	winc.Exit()
}


================================================
FILE: examples/sample_control/topform.go
================================================
package main

import (
	"github.com/tadvi/winc"
	"github.com/tadvi/winc/w32"
)

// TopForm displayed as topmost window until closed.
// By itself this is not very useful since Form has function EnableTopMost() making form topmost.
// This is just an example showing how custom window Form can be implemented inside your package.
type TopForm struct {
	winc.Form

	onLoad winc.EventManager
}

func NewTopForm(parent winc.Controller) *TopForm {
	dlg := new(TopForm)
	dlg.SetIsForm(true)

	winc.RegClassOnlyOnce("my_TopForm")
	dlg.SetHandle(winc.CreateWindow("my_TopForm", parent, w32.WS_EX_DLGMODALFRAME|w32.WS_EX_TOPMOST,
		w32.WS_VISIBLE|w32.WS_SYSMENU|w32.WS_CAPTION))
	dlg.SetParent(parent)

	// dlg might fail if icon resource is not embedded in the binary
	if ico, err := winc.NewIconFromResource(winc.GetAppInstance(), uint16(winc.AppIconID)); err == nil {
		dlg.SetIcon(0, ico)
	}

	// Dlg forces display of focus rectangles, as soon as the user starts to type.
	w32.SendMessage(dlg.Handle(), w32.WM_CHANGEUISTATE, w32.UIS_INITIALIZE, 0)
	winc.RegMsgHandler(dlg)

	dlg.SetFont(winc.DefaultFont)
	dlg.SetText("Form")
	return dlg
}

// Events
func (dlg *TopForm) OnLoad() *winc.EventManager {
	return &dlg.onLoad
}

func (dlg *TopForm) Show() {
	dlg.onLoad.Fire(winc.NewEvent(dlg, nil))
	dlg.Form.Show()
}

func (dlg *TopForm) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_CLOSE:
		dlg.Close()
	case w32.WM_DESTROY:
		if dlg.Parent() == nil {
			winc.Exit()
		}
	}
	return w32.DefWindowProc(dlg.Handle(), msg, wparam, lparam)
}


================================================
FILE: examples/sample_docking/app.manifest
================================================
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="App" type="win32"/>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
        </dependentAssembly>
    </dependency>
</assembly>


================================================
FILE: examples/sample_docking/main.go
================================================
package main

import (
	"fmt"

	"github.com/tadvi/winc"
)

func btnOnClick(arg *winc.Event) {
	fmt.Println("Button clicked")
}

func wndOnClose(arg *winc.Event) {
	winc.Exit()
}

type Item struct {
	T string
}

func (item Item) Text() string    { return item.T }
func (item Item) ImageIndex() int { return 0 }

func main() {
	//winc.Init()

	mainWindow := winc.NewForm(nil)
	dock := winc.NewSimpleDock(mainWindow)
	mainWindow.SetLayout(dock)

	mainWindow.SetSize(700, 600)
	mainWindow.SetText("Controls Demo")

	menu := mainWindow.NewMenu()
	fileMn := menu.AddSubMenu("File")
	fileMn.AddItem("New", winc.NoShortcut)
	editMn := menu.AddSubMenu("Edit")
	cutMn := editMn.AddItem("Cut", winc.Shortcut{winc.ModControl, winc.KeyX})
	copyMn := editMn.AddItem("Copy", winc.NoShortcut)
	pasteMn := editMn.AddItem("Paste", winc.NoShortcut)
	menu.Show()
	copyMn.SetCheckable(true)
	copyMn.SetChecked(true)
	pasteMn.SetEnabled(false)

	tabs := winc.NewMultiPanel(mainWindow)
	tabs.SetPos(10, 10)
	tabs.SetSize(100, 92)

	tree := winc.NewTreeView(mainWindow)
	tree.SetPos(10, 80)
	p := &Item{"First Item"}
	tree.InsertItem(p, nil, nil)
	sec := &Item{"Second"}
	if err := tree.InsertItem(sec, p, nil); err != nil {
		panic(err)
	}
	if err := tree.InsertItem(&Item{"Third"}, p, nil); err != nil {
		panic(err)
	}
	if err := tree.InsertItem(&Item{"Fourth"}, p, nil); err != nil {
		panic(err)
	}
	for i := 0; i < 50; i++ {
		if err := tree.InsertItem(&Item{"after second"}, sec, nil); err != nil {
			panic(err)
		}
	}
	tree.Expand(p)
	tree.OnCollapse().Bind(func(e *winc.Event) {
		println("collapse")
	})

	cutMn.OnClick().Bind(func(e *winc.Event) {
		println("cut click")
		ok := tree.EnsureVisible(p)
		fmt.Println("result of EnsureVisible", ok)
	})

	panel := winc.NewPanel(tabs)
	tabs.AddPanel(panel)

	panelDock := winc.NewSimpleDock(panel)
	panel.SetLayout(panelDock)
	panel.SetPos(0, 0)

	panelErr := winc.NewErrorPanel(panel)
	panelErr.SetPos(140, 10)
	panelErr.SetSize(200, 32)
	panelErr.ShowAsError(false)

	edt := winc.NewEdit(panel)
	edt.SetPos(10, 535)
	edt.SetText("some text")

	btn := winc.NewPushButton(panel)
	btn.SetText("Button")
	btn.SetSize(100, 40)
	btn.OnClick().Bind(func(e *winc.Event) {
		if edt.Visible() {
			edt.Hide()
		} else {
			edt.Show()
		}
	})
	btn.SetResIcon(13)

	panelDock.Dock(btn, winc.Top)
	panelDock.Dock(edt, winc.Top)
	panelDock.Dock(panelErr, winc.Top)

	dock.Dock(tree, winc.Left)
	dock.Dock(tabs, winc.Top)

	mainWindow.Center()
	mainWindow.Show()
	mainWindow.OnClose().Bind(wndOnClose)

	winc.RunMainLoop()
}


================================================
FILE: examples/sample_docking/release.bat
================================================
rsrc -manifest app.manifest -ico=app.ico,application_lightning.ico,application_edit.ico,application_error.ico -o rsrc.syso
go build -ldflags="-H windowsgui"


================================================
FILE: examples/sample_hello/main.go
================================================
package main

import (
	"github.com/tadvi/winc"
)

func main() {
	mainWindow := winc.NewForm(nil)
	mainWindow.SetSize(400, 300)
	mainWindow.SetText("Hello World Demo")

	// Main window menu. Context menus on controls also available.
	menu := mainWindow.NewMenu()
	fileMn := menu.AddSubMenu("File")
	fileMn.AddItem("New", winc.Shortcut{winc.ModControl, winc.KeyN})
	editMn := menu.AddSubMenu("Edit")
	cutMn := editMn.AddItem("Cut", winc.Shortcut{winc.ModControl, winc.KeyX})
	copyMn := editMn.AddItem("Copy", winc.NoShortcut)
	pasteMn := editMn.AddItem("Paste", winc.NoShortcut)
	menu.Show()
	// Menu items can be disabled and checked.
	copyMn.SetCheckable(true)
	copyMn.SetChecked(true)
	pasteMn.SetEnabled(false)

	cutMn.OnClick().Bind(func(e *winc.Event) {
		winc.MsgBoxOk(mainWindow, "Cut", "Click event")
	})

	edt := winc.NewEdit(mainWindow)
	edt.SetPos(10, 20)
	// Most Controls have default size unless SetSize is called.
	edt.SetText("edit text")

	btn := winc.NewPushButton(mainWindow)
	btn.SetText("Show or Hide")
	btn.SetPos(40, 50)
	btn.SetSize(100, 40)
	btn.OnClick().Bind(func(e *winc.Event) {
		if edt.Visible() {
			edt.Hide()
		} else {
			edt.Show()
		}
	})

	mainWindow.Center()
	mainWindow.Show()
	mainWindow.OnClose().Bind(wndOnClose)

	winc.RunMainLoop() // Must call to start event loop.
}

func wndOnClose(arg *winc.Event) {
	winc.Exit()
}


================================================
FILE: examples/sample_image/app.manifest
================================================
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="App" type="win32"/>
        <dependency>
            <dependentAssembly>
                <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
            </dependentAssembly>
        </dependency>
    </assembly>


================================================
FILE: examples/sample_image/main.go
================================================
package main

import (
	"fmt"

	"github.com/tadvi/winc"
)

func btnOnClick(arg *winc.Event) {
	fmt.Println("Button clicked")
}

func wndOnClose(arg *winc.Event) {
	winc.Exit()
}

func main() {
	mainWindow := winc.NewForm(nil)
	dock := winc.NewSimpleDock(mainWindow)

	mainWindow.SetSize(700, 600)
	mainWindow.SetText("Controls Demo")

	menu := mainWindow.NewMenu()
	fileMn := menu.AddSubMenu("File")
	fileMn.AddItem("New", winc.NoShortcut)
	editMn := menu.AddSubMenu("Edit")
	cutMn := editMn.AddItem("Cut", winc.Shortcut{winc.ModControl, winc.KeyX})
	copyMn := editMn.AddItem("Copy", winc.NoShortcut)
	pasteMn := editMn.AddItem("Paste", winc.NoShortcut)
	menu.Show()
	copyMn.SetCheckable(true)
	copyMn.SetChecked(true)
	pasteMn.SetEnabled(false)

	cutMn.OnClick().Bind(func(e *winc.Event) {
		println("cut click")
	})

	imlistTb := winc.NewImageList(16, 16)
	imlistTb.AddResIcon(10)
	imlistTb.AddResIcon(12)
	imlistTb.AddResIcon(15)

	toolbar := winc.NewToolbar(mainWindow)
	toolbar.SetImageList(imlistTb)
	addBtn := toolbar.AddButton("Add", 1)
	toolbar.AddSeparator()
	runBtn := toolbar.AddButton("Run", 2)
	toolbar.Show()

	runBtn.OnClick().Bind(func(e *winc.Event) {
		println("runBtn click")
	})

	scroll := winc.NewScrollView(mainWindow)
	imgv := winc.NewImageView(scroll)
	scroll.SetChild(imgv)

	addBtn.OnClick().Bind(func(e *winc.Event) {
		if filePath, ok := winc.ShowOpenFileDlg(mainWindow,
			"Select EDI X12 file", "All files (*.*)|*.*", 0, ""); ok {

			if err := imgv.DrawImageFile(filePath); err != nil {
				winc.Errorf(mainWindow, "Error: %s", err)
			}
			scroll.Invalidate(true)
		}
	})

	dock.Dock(toolbar, winc.Top) // toolbars always dock to the top
	dock.Dock(scroll, winc.Fill)

	mainWindow.Center()
	mainWindow.Show()
	dock.Update()
	mainWindow.OnClose().Bind(wndOnClose)

	winc.RunMainLoop()
}


================================================
FILE: examples/sample_image/release.bat
================================================
rsrc -manifest app.manifest -ico=app.ico,add.ico,application_lightning.ico,application_edit.ico,application_error.ico -o rsrc.syso
go build -ldflags="-H windowsgui"


================================================
FILE: examples/sample_imagebox/app.manifest
================================================
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="App" type="win32"/>
        <dependency>
            <dependentAssembly>
                <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
            </dependentAssembly>
        </dependency>
    </assembly>


================================================
FILE: examples/sample_imagebox/main.go
================================================
package main

import (
	"fmt"

	"github.com/tadvi/winc"
)

func btnOnClick(arg *winc.Event) {
	fmt.Println("Button clicked")
}

func wndOnClose(arg *winc.Event) {
	winc.Exit()
}

func main() {
	mainWindow := winc.NewForm(nil)
	dock := winc.NewSimpleDock(mainWindow)

	mainWindow.SetSize(700, 600)
	mainWindow.SetText("Controls Demo")

	menu := mainWindow.NewMenu()
	fileMn := menu.AddSubMenu("File")
	fileMn.AddItem("New", winc.NoShortcut)
	editMn := menu.AddSubMenu("Edit")
	cutMn := editMn.AddItem("Cut", winc.Shortcut{winc.ModControl, winc.KeyX})
	copyMn := editMn.AddItem("Copy", winc.NoShortcut)
	pasteMn := editMn.AddItem("Paste", winc.NoShortcut)
	menu.Show()
	copyMn.SetCheckable(true)
	copyMn.SetChecked(true)
	pasteMn.SetEnabled(false)

	cutMn.OnClick().Bind(func(e *winc.Event) {
		println("cut click")
	})

	imlistTb := winc.NewImageList(16, 16)
	imlistTb.AddResIcon(10)
	imlistTb.AddResIcon(12)
	imlistTb.AddResIcon(15)

	toolbar := winc.NewToolbar(mainWindow)
	toolbar.SetImageList(imlistTb)
	addBtn := toolbar.AddButton("Add", 1)

	toolbar.AddSeparator()
	runBtn := toolbar.AddButton("Run", 2)

	toolbar.Show()

	runBtn.OnClick().Bind(func(e *winc.Event) {
		println("runBtn click")
	})

	scroll := winc.NewScrollView(mainWindow)
	imgv := winc.NewImageViewBox(scroll)
	scroll.SetChild(imgv)

	addBtn.OnClick().Bind(func(e *winc.Event) {
		if filePath, ok := winc.ShowOpenFileDlg(mainWindow,
			"Select EDI X12 file", "All files (*.*)|*.*", 0, ""); ok {

			if err := imgv.DrawImageFile(filePath); err != nil {
				winc.Errorf(mainWindow, "Error: %s", err)
			}
			scroll.Invalidate(true)
		}
	})

	dock.Dock(toolbar, winc.Top) // toolbars always dock to the top
	dock.Dock(scroll, winc.Fill)

	mainWindow.Center()
	mainWindow.Show()
	dock.Update()
	mainWindow.OnClose().Bind(wndOnClose)

	winc.RunMainLoop()
}


================================================
FILE: examples/sample_imagebox/release.bat
================================================
rsrc -manifest app.manifest -ico=app.ico,add.ico,application_lightning.ico,application_edit.ico,application_error.ico -o rsrc.syso
go build -ldflags="-H windowsgui"


================================================
FILE: examples/sample_listview/app.manifest
================================================
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="App" type="win32"/>
        <dependency>
            <dependentAssembly>
                <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
            </dependentAssembly>
        </dependency>
    </assembly>


================================================
FILE: examples/sample_listview/main.go
================================================
package main

import (
	"fmt"

	"github.com/tadvi/winc"
)

func btnOnClick(arg *winc.Event) {
	fmt.Println("Button clicked")
}

func wndOnClose(arg *winc.Event) {
	winc.Exit()
}

type Item struct {
	T       []string
	checked bool
}

func (item Item) Text() []string    { return item.T }
func (item *Item) SetText(s string) { item.T[0] = s }

func (item Item) Checked() bool            { return item.checked }
func (item *Item) SetChecked(checked bool) { item.checked = checked }
func (item Item) ImageIndex() int          { return 0 }

func main() {
	mainWindow := winc.NewForm(nil)
	dock := winc.NewSimpleDock(mainWindow)

	mainWindow.SetSize(700, 600)
	mainWindow.SetText("Controls Demo")

	none := winc.Shortcut{}

	imlist := winc.NewImageList(16, 16)
	imlist.AddResIcon(16)
	imlist.AddResIcon(10)
	imlist.AddResIcon(13)

	ls := winc.NewListView(mainWindow)
	ls.SetImageList(imlist)
	ls.EnableEditLabels(false)
	ls.SetCheckBoxes(true)
	//ls.EnableFullRowSelect(true)
	//ls.EnableHotTrack(true)
	//ls.EnableSortHeader(true)
	//ls.EnableSortAscending(true)

	ls.AddColumn("One", 120)
	ls.AddColumn("Two", 120)
	ls.SetPos(10, 180)
	p1 := &Item{[]string{"First Item", "A"}, true}
	ls.AddItem(p1)
	p2 := &Item{[]string{"Second Item", "B"}, true}
	ls.AddItem(p2)
	p3 := &Item{[]string{"Third Item", "C"}, true}
	ls.AddItem(p3)
	for i := 0; i < 200; i++ {
		p4 := &Item{[]string{"Fourth Item", "D"}, false}
		ls.AddItem(p4)
	}

	menu := mainWindow.NewMenu()
	fileMn := menu.AddSubMenu("File")
	fileMn.AddItem("New", none)
	editMn := menu.AddSubMenu("Edit")
	delMn := editMn.AddItem("Delete", winc.Shortcut{winc.ModControl, winc.KeyX})
	delAllMn := editMn.AddItem("Delete All", none)
	menu.Show()

	ls.OnEndLabelEdit().Bind(func(e *winc.Event) {
		println("edited", e)
		// acccept label edit event!
		//d := e.Data.(*winc.LabelEditEventData)
		//d.Item.SetText(d.Text)
		//fmt.Println(d.Item.Text())
	})

	delMn.OnClick().Bind(func(e *winc.Event) {
		items := ls.SelectedItems()
		for _, it := range items {
			fmt.Println(it)
		}
	})

	delAllMn.OnClick().Bind(func(e *winc.Event) {
		ls.DeleteAllItems()
	})

	ls.OnClick().Bind(func(e *winc.Event) {
		println("onClick listview")
	})

	dock.Dock(ls, winc.Fill)

	mainWindow.Center()
	mainWindow.Show()
	mainWindow.OnClose().Bind(wndOnClose)

	winc.RunMainLoop()
}


================================================
FILE: examples/sample_listview/release.bat
================================================
rsrc -manifest app.manifest -ico=app.ico,application_lightning.ico,application_edit.ico,application_error.ico -o rsrc.syso
go build -ldflags="-H windowsgui"


================================================
FILE: examples/sample_minimal/main.go
================================================
package main

import (
	"github.com/tadvi/winc"
)

func main() {
	mainWindow := winc.NewForm(nil)
	mainWindow.SetSize(400, 300)
	mainWindow.SetText("Hello World Demo")

	edt := winc.NewEdit(mainWindow)
	edt.SetPos(10, 20)
	// Most Controls have default size unless SetSize is called.
	edt.SetText("edit text")

	btn := winc.NewPushButton(mainWindow)
	btn.SetText("Show or Hide")
	btn.SetPos(40, 50)
	btn.SetSize(100, 40)
	btn.OnClick().Bind(func(e *winc.Event) {
		if edt.Visible() {
			edt.Hide()
		} else {
			edt.Show()
		}
	})

	mainWindow.Center()
	mainWindow.Show()
	mainWindow.OnClose().Bind(wndOnClose)

	winc.RunMainLoop() // Must call to start event loop.
}

func wndOnClose(arg *winc.Event) {
	winc.Exit()
}


================================================
FILE: examples/sample_scrollview/app.manifest
================================================
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="App" type="win32"/>
        <dependency>
            <dependentAssembly>
                <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
            </dependentAssembly>
        </dependency>
    </assembly>


================================================
FILE: examples/sample_scrollview/main.go
================================================
package main

import (
	"fmt"

	"github.com/tadvi/winc"
)

func btnOnClick(arg *winc.Event) {
	//edt.SetCaption("Got you !!!")
	fmt.Println("Button clicked")
}

func wndOnClose(arg *winc.Event) {
	winc.Exit()
}

type Item struct {
	T string
}

func (item Item) Text() string    { return item.T }
func (item Item) ImageIndex() int { return 1 }

func main() {
	mainWindow := winc.NewForm(nil)
	dock := winc.NewSimpleDock(mainWindow)
	mainWindow.SetLayout(dock)

	mainWindow.SetSize(540, 540)
	mainWindow.SetText("Controls Demo")

	menu := mainWindow.NewMenu()
	fileMn := menu.AddSubMenu("File")
	fileMn.AddItem("New", winc.NoShortcut)
	editMn := menu.AddSubMenu("Edit")
	cutMn := editMn.AddItem("Cut", winc.Shortcut{winc.ModControl, winc.KeyX})
	copyMn := editMn.AddItem("Copy", winc.NoShortcut)
	pasteMn := editMn.AddItem("Paste", winc.NoShortcut)
	menu.Show()
	copyMn.SetCheckable(true)
	copyMn.SetChecked(true)
	pasteMn.SetEnabled(false)

	cutMn.OnClick().Bind(func(e *winc.Event) {
		println("cut click")
	})

	imlist := winc.NewImageList(16, 16)
	imlist.AddResIcon(10)
	imlist.AddResIcon(12)
	imlist.AddResIcon(15)

	scroll := winc.NewScrollView(mainWindow)
	tree := winc.NewTreeView(scroll)
	scroll.SetChild(&tree.ControlBase)
	//scroll.Show()

	tree.SetImageList(imlist)
	tree.SetPos(10, 80)
	tree.SetSize(800, 800)
	p := &Item{"First Item"}
	tree.InsertItem(p, nil, nil)
	sec := &Item{"Second"}
	if err := tree.InsertItem(sec, p, nil); err != nil {
		panic(err)
	}
	if err := tree.InsertItem(&Item{"Third"}, p, nil); err != nil {
		panic(err)
	}
	if err := tree.InsertItem(&Item{"Fourth"}, p, nil); err != nil {
		panic(err)
	}
	for i := 0; i < 50; i++ {
		if err := tree.InsertItem(&Item{"after second"}, sec, nil); err != nil {
			panic(err)
		}
	}
	tree.Expand(p)
	tree.OnCollapse().Bind(func(e *winc.Event) {
		println("collapse")
	})

	imlistTb := winc.NewImageList(16, 16)
	imlistTb.AddResIcon(10)
	imlistTb.AddResIcon(12)
	imlistTb.AddResIcon(15)

	toolbar := winc.NewToolbar(mainWindow)
	toolbar.SetImageList(imlistTb)
	addBtn := toolbar.AddButton("Add", 1)
	toolbar.AddSeparator()
	runBtn := toolbar.AddButton("Run", 2)
	toolbar.Show()

	runBtn.OnClick().Bind(func(e *winc.Event) {
		println("runBtn click")
	})

	addBtn.OnClick().Bind(func(e *winc.Event) {
		println("addBtn click")
	})

	dock.Dock(toolbar, winc.Top) // toolbars always dock to the top
	dock.Dock(scroll, winc.Fill)

	mainWindow.Center()
	dock.Update()
	mainWindow.Show()

	mainWindow.OnClose().Bind(wndOnClose)
	winc.RunMainLoop()
}


================================================
FILE: examples/sample_scrollview/release.bat
================================================
rsrc -manifest app.manifest -ico=app.ico,add.ico,application_lightning.ico,application_edit.ico,application_error.ico -o rsrc.syso
go build -ldflags="-H windowsgui"


================================================
FILE: examples/sample_slider/app.manifest
================================================
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="App" type="win32"/>
        <dependency>
            <dependentAssembly>
                <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
            </dependentAssembly>
        </dependency>
    </assembly>


================================================
FILE: examples/sample_slider/main.go
================================================
package main

import (
	"fmt"

	"github.com/tadvi/winc"
)

func btnOnClick(arg *winc.Event) {
	fmt.Println("Button clicked")
}

func wndOnClose(arg *winc.Event) {
	winc.Exit()
}

func main() {
	mainWindow := winc.NewForm(nil)
	dock := winc.NewSimpleDock(mainWindow)
	//mainWindow.SetLayout(dock)

	mainWindow.SetSize(700, 600)
	mainWindow.SetText("Controls Demo")

	menu := mainWindow.NewMenu()
	fileMn := menu.AddSubMenu("File")
	fileMn.AddItem("New", winc.NoShortcut)
	editMn := menu.AddSubMenu("Edit")
	cutMn := editMn.AddItem("Cut", winc.Shortcut{winc.ModControl, winc.KeyX})
	copyMn := editMn.AddItem("Copy", winc.NoShortcut)
	pasteMn := editMn.AddItem("Paste", winc.NoShortcut)
	menu.Show()
	copyMn.SetCheckable(true)
	copyMn.SetChecked(true)
	pasteMn.SetEnabled(false)

	cutMn.OnClick().Bind(func(e *winc.Event) {
		println("cut click")
	})

	imlistTb := winc.NewImageList(16, 16)
	imlistTb.AddResIcon(10)
	imlistTb.AddResIcon(12)
	imlistTb.AddResIcon(15)

	toolbar := winc.NewToolbar(mainWindow)
	toolbar.SetImageList(imlistTb)
	addBtn := toolbar.AddButton("Add", 1)
	toolbar.AddSeparator()
	runBtn := toolbar.AddButton("Run Now Fast", 2)
	toolbar.Show()

	runBtn.OnClick().Bind(func(e *winc.Event) {
		println("runBtn click")
	})

	dock.Dock(toolbar, winc.Top) // toolbars always dock to the top
	//dock.Dock(tree, winc.Fill)

	slide := winc.NewSlider(mainWindow)
	slide.SetPos(10, 50)
	slide.OnScroll().Bind(func(e *winc.Event) {
		println(slide.Value())
	})

	addBtn.OnClick().Bind(func(e *winc.Event) {
		println("addBtn click")
		slide.SetValue(30)
	})

	//track.SetRange(0, 100)
	//track.SetValue(20)

	mainWindow.Center()
	mainWindow.Show()
	dock.Update()
	mainWindow.OnClose().Bind(wndOnClose)

	winc.RunMainLoop()
}


================================================
FILE: examples/sample_slider/release.bat
================================================
rsrc -manifest app.manifest -ico=app.ico,add.ico,application_lightning.ico,application_edit.ico,application_error.ico -o rsrc.syso
go build -ldflags="-H windowsgui"


================================================
FILE: examples/sample_splitview/app.manifest
================================================
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="App" type="win32"/>
        <dependency>
            <dependentAssembly>
                <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
            </dependentAssembly>
        </dependency>
    </assembly>


================================================
FILE: examples/sample_splitview/layout.json
================================================
{"WindowState":"0 1 -1 -1 -1 -1 610 228 1310 828","Controls":[{"X":0,"Y":0,"Width":684,"Height":40},{"X":0,"Y":40,"Width":522,"Height":501},{"X":522,"Y":40,"Width":20,"Height":501},{"X":542,"Y":40,"Width":142,"Height":501}]}


================================================
FILE: examples/sample_splitview/main.go
================================================
package main

import (
	"fmt"

	"github.com/tadvi/winc"
)

func btnOnClick(arg *winc.Event) {
	//edt.SetCaption("Got you !!!")
	fmt.Println("Button clicked")
}

func wndOnClose(arg *winc.Event) {
	winc.Exit()
}

func main() {
	mainWindow := winc.NewForm(nil)

	mainWindow.SetSize(700, 600)
	mainWindow.SetText("Controls Demo")

	//none := winc.Shortcut{}

	menu := mainWindow.NewMenu()
	fileMn := menu.AddSubMenu("File")
	fileMn.AddItem("New", winc.NoShortcut)
	editMn := menu.AddSubMenu("Edit")
	delMn := editMn.AddItem("Delete", winc.Shortcut{winc.ModControl, winc.KeyX})
	delAllMn := editMn.AddItem("Delete All", winc.NoShortcut)
	menu.Show()

	delMn.OnClick().Bind(func(e *winc.Event) {
		dlg := winc.NewDialog(mainWindow)
		dlg.Center()
		dlg.Show()
	})

	delAllMn.OnClick().Bind(func(e *winc.Event) {
		dlg := winc.NewDialog(mainWindow)
		dlg.Center()
		dlg.Show()
	})

	toolbar := winc.NewPanel(mainWindow)
	toolbar.SetPos(0, 0)
	toolbar.SetSize(100, 40)

	btnRun := winc.NewIconButton(toolbar)
	btnRun.SetText(" Run")
	btnRun.SetPos(2, 2)
	btnRun.SetSize(98, 38)
	btnRun.SetResIcon(15)

	btnRun.OnClick().Bind(func(e *winc.Event) {
		println("event OnClick")
	})

	//tipRun := winc.NewToolTip(mainWindow)
	//tipRun.AddTool(btnRun, "Run project")

	btnEdit := winc.NewPushButton(toolbar)
	btnEdit.SetText(" Edit")
	btnEdit.SetPos(102, 2)
	btnEdit.SetSize(98, 38)
	btnEdit.SetResIcon(18)

	left := winc.NewMultiEdit(mainWindow)
	left.SetPos(5, 5)
	right := winc.NewMultiEdit(mainWindow)
	right.SetPos(50, 100)

	split := winc.NewVResizer(mainWindow)
	split.SetControl(left, right, winc.Left, 150)

	// --- Add controls to Dock, LoadStateFile and Show window in this order
	mainWindow.Center()
	mainWindow.Show()

	dock := winc.NewSimpleDock(mainWindow)
	//mainWindow.SetLayout(dock)
	dock.Dock(toolbar, winc.Top)
	dock.Dock(left, winc.Left)
	dock.Dock(split, winc.Left)
	dock.Dock(right, winc.Fill)
	// if err := dock.LoadStateFile("layout.json"); err != nil {
	// 	log.Println(err)
	// }

	mainWindow.OnClose().Bind(func(e *winc.Event) {
		dock.SaveStateFile("layout.json") // error gets ignored
		winc.Exit()
	})

	dock.Update()

	winc.RunMainLoop()
	// --- end of Dock and main window management

}


================================================
FILE: examples/sample_splitview/release.bat
================================================
rsrc -manifest app.manifest -ico=app.ico,add.ico,run.ico,edit.ico,error.ico -o rsrc.syso
go build -ldflags="-H windowsgui"


================================================
FILE: examples/sample_tab/app.manifest
================================================
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="App" type="win32"/>
        <dependency>
            <dependentAssembly>
                <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
            </dependentAssembly>
        </dependency>
    </assembly>


================================================
FILE: examples/sample_tab/main.go
================================================
package main

import (
	"fmt"

	"github.com/tadvi/winc"
)

func btnOnClick(arg *winc.Event) {
	fmt.Println("Button clicked")
}

func wndOnClose(arg *winc.Event) {
	winc.Exit()
}

type Item struct {
	T       []string
	checked bool
}

func (item Item) Text() []string    { return item.T }
func (item *Item) SetText(s string) { item.T[0] = s }

func (item Item) Checked() bool            { return item.checked }
func (item *Item) SetChecked(checked bool) { item.checked = checked }
func (item Item) ImageIndex() int          { return 0 }

func main() {
	mainWindow := winc.NewForm(nil)
	dock := winc.NewSimpleDock(mainWindow)

	mainWindow.SetSize(700, 600)
	mainWindow.SetText("Controls Demo")

	menu := mainWindow.NewMenu()
	fileMn := menu.AddSubMenu("File")
	fileMn.AddItem("New", winc.NoShortcut)
	editMn := menu.AddSubMenu("Edit")
	cutMn := editMn.AddItem("Cut", winc.Shortcut{winc.ModControl, winc.KeyX})
	copyMn := editMn.AddItem("Copy", winc.NoShortcut)
	pasteMn := editMn.AddItem("Paste", winc.NoShortcut)
	menu.Show()
	copyMn.SetCheckable(true)
	copyMn.SetChecked(true)
	pasteMn.SetEnabled(false)

	cutMn.OnClick().Bind(func(e *winc.Event) {
		println("cut click")
	})

	imlistTb := winc.NewImageList(16, 16)
	imlistTb.AddResIcon(10)
	imlistTb.AddResIcon(12)
	imlistTb.AddResIcon(15)

	// --- Toolbar
	toolbar := winc.NewToolbar(mainWindow)
	toolbar.SetImageList(imlistTb)
	addBtn := toolbar.AddButton("Add", 1)
	toolbar.AddSeparator()
	runBtn := toolbar.AddButton("Run Now Fast", 2)
	toolbar.Show()

	runBtn.OnClick().Bind(func(e *winc.Event) {
		println("runBtn click")
	})

	addBtn.OnClick().Bind(func(e *winc.Event) {
		println("addBtn click")
	})

	// --- Tabs
	tabs := winc.NewTabView(mainWindow)
	panel1 := tabs.AddPanel("First")
	panel2 := tabs.AddPanel("Second")
	panel3 := tabs.AddPanel("Third")
	panel4 := tabs.AddPanel("Fourth")

	edt := winc.NewEdit(panel1)
	edt.SetPos(100, 10)

	edt2 := winc.NewEdit(panel2)
	edt2.SetPos(40, 10)

	btn := winc.NewPushButton(panel3)
	btn.OnClick().Bind(func(e *winc.Event) {
		println("click")
	})

	imlist := winc.NewImageList(16, 16)
	imlist.AddResIcon(12)

	ls := winc.NewListView(panel4)
	ls.SetImageList(imlist)
	ls.EnableEditLabels(false)
	ls.SetCheckBoxes(true)
	//ls.EnableFullRowSelect(true)
	//ls.EnableHotTrack(true)
	//ls.EnableSortHeader(true)
	//ls.EnableSortAscending(true)

	ls.AddColumn("One", 120)
	ls.AddColumn("Two", 120)
	ls.SetPos(10, 180)
	p1 := &Item{[]string{"First Item", "A"}, true}
	ls.AddItem(p1)
	p2 := &Item{[]string{"Second Item", "B"}, true}
	ls.AddItem(p2)
	p3 := &Item{[]string{"Third Item", "C"}, true}
	ls.AddItem(p3)
	for i := 0; i < 200; i++ {
		p4 := &Item{[]string{"Fourth Item", "D"}, false}
		ls.AddItem(p4)
	}

	// --- Dock
	dock2 := winc.NewSimpleDock(panel4)
	dock2.Dock(ls, winc.Fill)
	tabs.SetCurrent(0)

	dock.Dock(toolbar, winc.Top)        // toolbars always dock to the top
	dock.Dock(tabs, winc.Top)           // tabs should prefer docking at the top
	dock.Dock(tabs.Panels(), winc.Fill) // tab panels dock just below tabs and fill area

	mainWindow.Center()
	mainWindow.Show()
	mainWindow.OnClose().Bind(wndOnClose)

	winc.RunMainLoop()
}


================================================
FILE: examples/sample_tab/release.bat
================================================
rsrc -manifest app.manifest -ico=app.ico,add.ico,application_lightning.ico,application_edit.ico,application_error.ico -o rsrc.syso
go build -ldflags="-H windowsgui"


================================================
FILE: examples/sample_treeview/app.manifest
================================================
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="App" type="win32"/>
        <dependency>
            <dependentAssembly>
                <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
            </dependentAssembly>
        </dependency>
    </assembly>


================================================
FILE: examples/sample_treeview/main.go
================================================
package main

import (
	"fmt"

	"github.com/tadvi/winc"
)

func btnOnClick(arg *winc.Event) {
	fmt.Println("Button clicked")
}

func wndOnClose(arg *winc.Event) {
	winc.Exit()
}

type Item struct {
	T string
}

func (item Item) Text() string    { return item.T }
func (item Item) ImageIndex() int { return 1 }

func main() {
	mainWindow := winc.NewForm(nil)
	dock := winc.NewSimpleDock(mainWindow)
	mainWindow.SetLayout(dock)

	mainWindow.SetSize(700, 600)
	mainWindow.SetText("Controls Demo")

	menu := mainWindow.NewMenu()
	fileMn := menu.AddSubMenu("File")
	fileMn.AddItem("New", winc.NoShortcut)
	editMn := menu.AddSubMenu("Edit")
	cutMn := editMn.AddItem("Cut", winc.Shortcut{winc.ModControl, winc.KeyX})
	copyMn := editMn.AddItem("Copy", winc.NoShortcut)
	pasteMn := editMn.AddItem("Paste", winc.NoShortcut)
	menu.Show()
	copyMn.SetCheckable(true)
	copyMn.SetChecked(true)
	pasteMn.SetEnabled(false)

	cutMn.OnClick().Bind(func(e *winc.Event) {
		println("cut click")
	})

	imlist := winc.NewImageList(16, 16)
	imlist.AddResIcon(10)
	imlist.AddResIcon(12)
	imlist.AddResIcon(15)

	tree := winc.NewTreeView(mainWindow)
	tree.SetImageList(imlist)
	tree.SetPos(10, 80)
	p := &Item{"First Item"}
	tree.InsertItem(p, nil, nil)
	sec := &Item{"Second"}
	if err := tree.InsertItem(sec, p, nil); err != nil {
		panic(err)
	}
	if err := tree.InsertItem(&Item{"Third"}, p, nil); err != nil {
		panic(err)
	}
	if err := tree.InsertItem(&Item{"Fourth"}, p, nil); err != nil {
		panic(err)
	}
	for i := 0; i < 50; i++ {
		if err := tree.InsertItem(&Item{"after second"}, sec, nil); err != nil {
			panic(err)
		}
	}
	tree.Expand(p)
	tree.OnCollapse().Bind(func(e *winc.Event) {
		println("collapse")
	})

	imlistTb := winc.NewImageList(16, 16)
	imlistTb.AddResIcon(10)
	imlistTb.AddResIcon(12)
	imlistTb.AddResIcon(15)

	toolbar := winc.NewToolbar(mainWindow)
	toolbar.SetImageList(imlistTb)
	addBtn := toolbar.AddButton("Add", 1)
	toolbar.AddSeparator()
	runBtn := toolbar.AddButton("Run", 2)
	toolbar.Show()

	runBtn.OnClick().Bind(func(e *winc.Event) {
		println("runBtn click")
	})

	addBtn.OnClick().Bind(func(e *winc.Event) {
		println("addBtn click")
	})

	dock.Dock(toolbar, winc.Top) // toolbars always dock to the top
	dock.Dock(tree, winc.Fill)

	mainWindow.Center()
	mainWindow.Show()
	dock.Update()
	mainWindow.OnClose().Bind(wndOnClose)

	winc.RunMainLoop()
}


================================================
FILE: examples/sample_treeview/release.bat
================================================
rsrc -manifest app.manifest -ico=app.ico,add.ico,application_lightning.ico,application_edit.ico,application_error.ico -o rsrc.syso
go build -ldflags="-H windowsgui"


================================================
FILE: font.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"syscall"

	"github.com/tadvi/winc/w32"
)

const (
	FontBold      byte = 0x01
	FontItalic    byte = 0x02
	FontUnderline byte = 0x04
	FontStrikeOut byte = 0x08
)

func init() {
	DefaultFont = NewFont("MS Shell Dlg 2", 8, 0)
}

type Font struct {
	hfont     w32.HFONT
	family    string
	pointSize int
	style     byte
}

func NewFont(family string, pointSize int, style byte) *Font {
	if style > FontBold|FontItalic|FontUnderline|FontStrikeOut {
		panic("Invalid font style")
	}

	//Retrive screen DPI
	hDC := w32.GetDC(0)
	defer w32.ReleaseDC(0, hDC)
	screenDPIY := w32.GetDeviceCaps(hDC, w32.LOGPIXELSY)

	font := Font{
		family:    family,
		pointSize: pointSize,
		style:     style,
	}

	font.hfont = font.createForDPI(screenDPIY)
	if font.hfont == 0 {
		panic("CreateFontIndirect failed")
	}

	return &font
}

func (fnt *Font) createForDPI(dpi int) w32.HFONT {
	var lf w32.LOGFONT

	lf.Height = int32(-w32.MulDiv(fnt.pointSize, dpi, 72))
	if fnt.style&FontBold > 0 {
		lf.Weight = w32.FW_BOLD
	} else {
		lf.Weight = w32.FW_NORMAL
	}
	if fnt.style&FontItalic > 0 {
		lf.Italic = 1
	}
	if fnt.style&FontUnderline > 0 {
		lf.Underline = 1
	}
	if fnt.style&FontStrikeOut > 0 {
		lf.StrikeOut = 1
	}
	lf.CharSet = w32.DEFAULT_CHARSET
	lf.OutPrecision = w32.OUT_TT_PRECIS
	lf.ClipPrecision = w32.CLIP_DEFAULT_PRECIS
	lf.Quality = w32.CLEARTYPE_QUALITY
	lf.PitchAndFamily = w32.VARIABLE_PITCH | w32.FF_SWISS

	src := syscall.StringToUTF16(fnt.family)
	dest := lf.FaceName[:]
	copy(dest, src)

	return w32.CreateFontIndirect(&lf)
}

func (fnt *Font) GetHFONT() w32.HFONT {
	return fnt.hfont
}

func (fnt *Font) Bold() bool {
	return fnt.style&FontBold > 0
}

func (fnt *Font) Dispose() {
	if fnt.hfont != 0 {
		w32.DeleteObject(w32.HGDIOBJ(fnt.hfont))
	}
}

func (fnt *Font) Family() string {
	return fnt.family
}

func (fnt *Font) Italic() bool {
	return fnt.style&FontItalic > 0
}

func (fnt *Font) StrikeOut() bool {
	return fnt.style&FontStrikeOut > 0
}

func (fnt *Font) Underline() bool {
	return fnt.style&FontUnderline > 0
}

func (fnt *Font) Style() byte {
	return fnt.style
}


================================================
FILE: form.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"github.com/tadvi/winc/w32"
	"unsafe"
)

type LayoutManager interface {
	Update()
}

// A Form is main window of the application.
type Form struct {
	ControlBase

	layoutMng LayoutManager

	// Fullscreen / Unfullscreen
	isFullscreen            bool
	previousWindowStyle     uint32
	previousWindowPlacement w32.WINDOWPLACEMENT
}

func NewCustomForm(parent Controller, exStyle int, dwStyle uint) *Form {
	fm := new(Form)

	RegClassOnlyOnce("winc_Form")

	fm.isForm = true

	if exStyle == 0 {
		exStyle = w32.WS_EX_CONTROLPARENT | w32.WS_EX_APPWINDOW
	}

	if dwStyle == 0 {
		dwStyle = w32.WS_OVERLAPPEDWINDOW
	}

	fm.hwnd = CreateWindow("winc_Form", parent, uint(exStyle), dwStyle)
	fm.parent = parent

	// this might fail if icon resource is not embedded in the binary
	if ico, err := NewIconFromResource(GetAppInstance(), uint16(AppIconID)); err == nil {
		fm.SetIcon(0, ico)
	}

	// This forces display of focus rectangles, as soon as the user starts to type.
	w32.SendMessage(fm.hwnd, w32.WM_CHANGEUISTATE, w32.UIS_INITIALIZE, 0)

	RegMsgHandler(fm)

	fm.SetFont(DefaultFont)
	fm.SetText("Form")
	return fm
}

func NewForm(parent Controller) *Form {
	fm := new(Form)

	RegClassOnlyOnce("winc_Form")

	fm.isForm = true
	fm.hwnd = CreateWindow("winc_Form", parent, w32.WS_EX_CONTROLPARENT|w32.WS_EX_APPWINDOW, w32.WS_OVERLAPPEDWINDOW)
	fm.parent = parent

	// this might fail if icon resource is not embedded in the binary
	if ico, err := NewIconFromResource(GetAppInstance(), uint16(AppIconID)); err == nil {
		fm.SetIcon(0, ico)
	}

	// This forces display of focus rectangles, as soon as the user starts to type.
	w32.SendMessage(fm.hwnd, w32.WM_CHANGEUISTATE, w32.UIS_INITIALIZE, 0)

	RegMsgHandler(fm)

	fm.SetFont(DefaultFont)
	fm.SetText("Form")
	return fm
}

func (fm *Form) SetLayout(mng LayoutManager) {
	fm.layoutMng = mng
}

// UpdateLayout refresh layout.
func (fm *Form) UpdateLayout() {
	if fm.layoutMng != nil {
		fm.layoutMng.Update()
	}
}

func (fm *Form) NewMenu() *Menu {
	hMenu := w32.CreateMenu()
	if hMenu == 0 {
		panic("failed CreateMenu")
	}
	m := &Menu{hMenu: hMenu, hwnd: fm.hwnd}
	if !w32.SetMenu(fm.hwnd, hMenu) {
		panic("failed SetMenu")
	}
	return m
}

func (fm *Form) DisableIcon() {
	windowInfo := getWindowInfo(fm.hwnd)
	frameless := windowInfo.IsPopup()
	if frameless {
		return
	}
	exStyle := w32.GetWindowLong(fm.hwnd, w32.GWL_EXSTYLE)
	w32.SetWindowLong(fm.hwnd, w32.GWL_EXSTYLE, uint32(exStyle|w32.WS_EX_DLGMODALFRAME))
	w32.SetWindowPos(fm.hwnd, 0, 0, 0, 0, 0,
		uint(
			w32.SWP_FRAMECHANGED|
				w32.SWP_NOMOVE|
				w32.SWP_NOSIZE|
				w32.SWP_NOZORDER),
	)
}

func (fm *Form) Maximise() {
	w32.ShowWindow(fm.hwnd, w32.SW_MAXIMIZE)
}

func (fm *Form) Minimise() {
	w32.ShowWindow(fm.hwnd, w32.SW_MINIMIZE)
}

func (fm *Form) Restore() {
	w32.ShowWindow(fm.hwnd, w32.SW_RESTORE)
}

// Public methods
func (fm *Form) Center() {

	windowInfo := getWindowInfo(fm.hwnd)
	frameless := windowInfo.IsPopup()

	info := getMonitorInfo(fm.hwnd)
	workRect := info.RcWork
	screenMiddleW := workRect.Left + (workRect.Right-workRect.Left)/2
	screenMiddleH := workRect.Top + (workRect.Bottom-workRect.Top)/2
	var winRect *w32.RECT
	if !frameless {
		winRect = w32.GetWindowRect(fm.hwnd)
	} else {
		winRect = w32.GetClientRect(fm.hwnd)
	}
	winWidth := winRect.Right - winRect.Left
	winHeight := winRect.Bottom - winRect.Top
	windowX := screenMiddleW - (winWidth / 2)
	windowY := screenMiddleH - (winHeight / 2)
	w32.SetWindowPos(fm.hwnd, w32.HWND_TOP, int(windowX), int(windowY), int(winWidth), int(winHeight), w32.SWP_NOSIZE)
}

func (fm *Form) Fullscreen() {
	if fm.isFullscreen {
		return
	}

	fm.previousWindowStyle = uint32(w32.GetWindowLongPtr(fm.hwnd, w32.GWL_STYLE))
	monitor := w32.MonitorFromWindow(fm.hwnd, w32.MONITOR_DEFAULTTOPRIMARY)
	var monitorInfo w32.MONITORINFO
	monitorInfo.CbSize = uint32(unsafe.Sizeof(monitorInfo))
	if !w32.GetMonitorInfo(monitor, &monitorInfo) {
		return
	}
	if !w32.GetWindowPlacement(fm.hwnd, &fm.previousWindowPlacement) {
		return
	}
	w32.SetWindowLong(fm.hwnd, w32.GWL_STYLE, fm.previousWindowStyle & ^uint32(w32.WS_OVERLAPPEDWINDOW))
	w32.SetWindowPos(fm.hwnd, w32.HWND_TOP,
		int(monitorInfo.RcMonitor.Left),
		int(monitorInfo.RcMonitor.Top),
		int(monitorInfo.RcMonitor.Right-monitorInfo.RcMonitor.Left),
		int(monitorInfo.RcMonitor.Bottom-monitorInfo.RcMonitor.Top),
		w32.SWP_NOOWNERZORDER|w32.SWP_FRAMECHANGED)
	fm.isFullscreen = true
}

func (fm *Form) UnFullscreen() {
	if !fm.isFullscreen {
		return
	}
	w32.SetWindowLong(fm.hwnd, w32.GWL_STYLE, fm.previousWindowStyle)
	w32.SetWindowPlacement(fm.hwnd, &fm.previousWindowPlacement)
	w32.SetWindowPos(fm.hwnd, 0, 0, 0, 0, 0,
		w32.SWP_NOMOVE|w32.SWP_NOSIZE|w32.SWP_NOZORDER|w32.SWP_NOOWNERZORDER|w32.SWP_FRAMECHANGED)
	fm.isFullscreen = false
}

// IconType: 1 - ICON_BIG; 0 - ICON_SMALL
func (fm *Form) SetIcon(iconType int, icon *Icon) {
	if iconType > 1 {
		panic("IconType is invalid")
	}
	w32.SendMessage(fm.hwnd, w32.WM_SETICON, uintptr(iconType), uintptr(icon.Handle()))
}

func (fm *Form) EnableMaxButton(b bool) {
	ToggleStyle(fm.hwnd, b, w32.WS_MAXIMIZEBOX)
}

func (fm *Form) EnableMinButton(b bool) {
	ToggleStyle(fm.hwnd, b, w32.WS_MINIMIZEBOX)
}

func (fm *Form) EnableSizable(b bool) {
	ToggleStyle(fm.hwnd, b, w32.WS_THICKFRAME)
}

func (fm *Form) EnableDragMove(_ bool) {
	//fm.isDragMove = b
}

func (fm *Form) EnableTopMost(b bool) {
	tag := w32.HWND_NOTOPMOST
	if b {
		tag = w32.HWND_TOPMOST
	}
	w32.SetWindowPos(fm.hwnd, tag, 0, 0, 0, 0, w32.SWP_NOMOVE|w32.SWP_NOSIZE)
}

func (fm *Form) WndProc(msg uint32, wparam, lparam uintptr) uintptr {

	switch msg {
	case w32.WM_COMMAND:
		if lparam == 0 && w32.HIWORD(uint32(wparam)) == 0 {
			// Menu support.
			actionID := uint16(w32.LOWORD(uint32(wparam)))
			if action, ok := actionsByID[actionID]; ok {
				action.onClick.Fire(NewEvent(fm, nil))
			}
		}
	case w32.WM_KEYDOWN:
		// Accelerator support.
		key := Key(wparam)
		if uint32(lparam)>>30 == 0 {
			// Using TranslateAccelerators refused to work, so we handle them
			// ourselves, at least for now.
			shortcut := Shortcut{ModifiersDown(), key}
			if action, ok := shortcut2Action[shortcut]; ok {
				if action.Enabled() {
					action.onClick.Fire(NewEvent(fm, nil))
				}
			}
		}

	case w32.WM_CLOSE:
		return 0
	case w32.WM_DESTROY:
		w32.PostQuitMessage(0)
		return 0

	case w32.WM_SIZE, w32.WM_PAINT:
		if fm.layoutMng != nil {
			fm.layoutMng.Update()
		}
	case w32.WM_GETMINMAXINFO:
		if fm.minWidth != 0 || fm.maxWidth != 0 || fm.minHeight != 0 || fm.maxHeight != 0 {
			dpix, dpiy := fm.GetWindowDPI()

			DPIScaleX := dpix / 96.0
			DPIScaleY := dpiy / 96.0

			mmi := (*w32.MINMAXINFO)(unsafe.Pointer(lparam))
			if fm.minWidth > 0 && fm.minHeight > 0 {
				mmi.PtMinTrackSize.X = int32(fm.minWidth * int(DPIScaleX))
				mmi.PtMinTrackSize.Y = int32(fm.minHeight * int(DPIScaleY))
			}
			if fm.maxWidth > 0 && fm.maxHeight > 0 {
				mmi.PtMaxSize.X = int32(fm.maxWidth * int(DPIScaleX))
				mmi.PtMaxSize.Y = int32(fm.maxHeight * int(DPIScaleY))
				mmi.PtMaxTrackSize.X = int32(fm.maxWidth * int(DPIScaleX))
				mmi.PtMaxTrackSize.Y = int32(fm.maxHeight * int(DPIScaleY))
			}
			return 0
		}
	}

	return w32.DefWindowProc(fm.hwnd, msg, wparam, lparam)
}


================================================
FILE: globalvars.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"syscall"

	"github.com/tadvi/winc/w32"
)

//Private global variables.
var (
	gAppInstance        w32.HINSTANCE
	gControllerRegistry map[w32.HWND]Controller
	gRegisteredClasses  []string
)

//Public global variables.
var (
	GeneralWndprocCallBack = syscall.NewCallback(generalWndProc)
	DefaultFont            *Font
)


================================================
FILE: go.mod
================================================
module github.com/tadvi/winc

go 1.12


================================================
FILE: icon.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"errors"
	"fmt"
	"syscall"

	"github.com/tadvi/winc/w32"
)

type Icon struct {
	handle w32.HICON
}

func NewIconFromFile(path string) (*Icon, error) {
	ico := new(Icon)
	var err error
	if ico.handle = w32.LoadIcon(0, syscall.StringToUTF16Ptr(path)); ico.handle == 0 {
		err = errors.New(fmt.Sprintf("Cannot load icon from %s", path))
	}
	return ico, err
}

func NewIconFromResource(instance w32.HINSTANCE, resId uint16) (*Icon, error) {
	ico := new(Icon)
	var err error
	if ico.handle = w32.LoadIcon(instance, w32.MakeIntResource(resId)); ico.handle == 0 {
		err = errors.New(fmt.Sprintf("Cannot load icon from resource with id %v", resId))
	}
	return ico, err
}

func ExtractIcon(fileName string, index int) (*Icon, error) {
	ico := new(Icon)
	var err error
	if ico.handle = w32.ExtractIcon(fileName, index); ico.handle == 0 || ico.handle == 1 {
		err = errors.New(fmt.Sprintf("Cannot extract icon from %s at index %v", fileName, index))
	}
	return ico, err
}

func (ic *Icon) Destroy() bool {
	return w32.DestroyIcon(ic.handle)
}

func (ic *Icon) Handle() w32.HICON {
	return ic.handle
}


================================================
FILE: imagelist.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"fmt"

	"github.com/tadvi/winc/w32"
)

type ImageList struct {
	handle w32.HIMAGELIST
}

func NewImageList(cx, cy int) *ImageList {
	return newImageList(cx, cy, w32.ILC_COLOR32, 0, 0)
}

func newImageList(cx, cy int, flags uint, cInitial, cGrow int) *ImageList {
	imgl := new(ImageList)
	imgl.handle = w32.ImageList_Create(cx, cy, flags, cInitial, cGrow)
	return imgl
}

func (im *ImageList) Handle() w32.HIMAGELIST {
	return im.handle
}

func (im *ImageList) Destroy() bool {
	return w32.ImageList_Destroy(im.handle)
}

func (im *ImageList) SetImageCount(uNewCount uint) bool {
	return w32.ImageList_SetImageCount(im.handle, uNewCount)
}

func (im *ImageList) ImageCount() int {
	return w32.ImageList_GetImageCount(im.handle)
}

func (im *ImageList) AddIcon(icon *Icon) int {
	return w32.ImageList_AddIcon(im.handle, icon.Handle())
}

func (im *ImageList) AddResIcon(iconID uint16) {
	if ico, err := NewIconFromResource(GetAppInstance(), iconID); err == nil {
		im.AddIcon(ico)
		return
	}
	panic(fmt.Sprintf("missing icon with icon ID: %d", iconID))
}

func (im *ImageList) RemoveAll() bool {
	return w32.ImageList_RemoveAll(im.handle)
}

func (im *ImageList) Remove(i int) bool {
	return w32.ImageList_Remove(im.handle, i)
}


================================================
FILE: imageview.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 */

package winc

import "github.com/tadvi/winc/w32"

type ImageView struct {
	ControlBase

	bmp *Bitmap
}

func NewImageView(parent Controller) *ImageView {
	iv := new(ImageView)

	iv.InitWindow("winc_ImageView", parent, w32.WS_EX_CONTROLPARENT, w32.WS_CHILD|w32.WS_VISIBLE)
	RegMsgHandler(iv)

	iv.SetFont(DefaultFont)
	iv.SetText("")
	iv.SetSize(200, 65)
	return iv
}

func (iv *ImageView) DrawImageFile(filepath string) error {
	bmp, err := NewBitmapFromFile(filepath, RGB(255, 255, 0))
	if err != nil {
		return err
	}
	iv.bmp = bmp
	return nil
}

func (iv *ImageView) DrawImage(bmp *Bitmap) {
	iv.bmp = bmp
}

func (iv *ImageView) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_SIZE, w32.WM_SIZING:
		iv.Invalidate(true)

	case w32.WM_ERASEBKGND:
		return 1 // important

	case w32.WM_PAINT:
		if iv.bmp != nil {
			canvas := NewCanvasFromHwnd(iv.hwnd)
			defer canvas.Dispose()
			iv.SetSize(iv.bmp.Size())
			canvas.DrawBitmap(iv.bmp, 0, 0)
		}
	}
	return w32.DefWindowProc(iv.hwnd, msg, wparam, lparam)
}


================================================
FILE: imageviewbox.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 */

package winc

import (
	"fmt"
	"time"

	"github.com/tadvi/winc/w32"
)

type direction int

const (
	DirNone direction = iota
	DirX
	DirY
	DirX2
	DirY2
)

var ImageBoxPen = NewPen(w32.PS_GEOMETRIC, 2, NewSolidColorBrush(RGB(140, 140, 220)))
var ImageBoxHiPen = NewPen(w32.PS_GEOMETRIC, 2, NewSolidColorBrush(RGB(220, 140, 140)))
var ImageBoxMarkBrush = NewSolidColorBrush(RGB(40, 40, 40))
var ImageBoxMarkPen = NewPen(w32.PS_GEOMETRIC, 2, ImageBoxMarkBrush)

type ImageBox struct {
	Name         string
	Type         int
	X, Y, X2, Y2 int

	underMouse bool // dynamic value
}

func (b *ImageBox) Rect() *Rect {
	return NewRect(b.X, b.Y, b.X2, b.Y2)
}

// ImageViewBox is image view with boxes.
type ImageViewBox struct {
	ControlBase

	bmp       *Bitmap
	mouseLeft bool
	modified  bool // used by GUI to see if any image box modified

	add bool

	Boxes   []*ImageBox // might be persisted to file
	dragBox *ImageBox
	selBox  *ImageBox

	dragStartX, dragStartY int
	resize                 direction

	onSelectedChange EventManager
	onAdd            EventManager
	onModify         EventManager
}

func NewImageViewBox(parent Controller) *ImageViewBox {
	iv := new(ImageViewBox)

	iv.InitWindow("winc_ImageViewBox", parent, w32.WS_EX_CONTROLPARENT, w32.WS_CHILD|w32.WS_VISIBLE)
	RegMsgHandler(iv)

	iv.SetFont(DefaultFont)
	iv.SetText("")
	iv.SetSize(200, 65)

	return iv
}

func (iv *ImageViewBox) OnSelectedChange() *EventManager {
	return &iv.onSelectedChange
}

func (iv *ImageViewBox) OnAdd() *EventManager {
	return &iv.onAdd
}

func (iv *ImageViewBox) OnModify() *EventManager {
	return &iv.onModify
}

func (iv *ImageViewBox) IsModified() bool          { return iv.modified }
func (iv *ImageViewBox) SetModified(modified bool) { iv.modified = modified }
func (iv *ImageViewBox) IsLoaded() bool            { return iv.bmp != nil }
func (iv *ImageViewBox) AddMode() bool             { return iv.add }
func (iv *ImageViewBox) SetAddMode(add bool)       { iv.add = add }
func (iv *ImageViewBox) HasSelected() bool         { return iv.selBox != nil && iv.bmp != nil }

func (iv *ImageViewBox) wasModified() {
	iv.modified = true
	iv.onModify.Fire(NewEvent(iv, nil))
}

func (iv *ImageViewBox) DeleteSelected() {
	if iv.selBox != nil {
		for i, b := range iv.Boxes {
			if b == iv.selBox {
				iv.Boxes = append(iv.Boxes[:i], iv.Boxes[i+1:]...)
				iv.selBox = nil
				iv.Invalidate(true)
				iv.wasModified()
				iv.onSelectedChange.Fire(NewEvent(iv, nil))
				return
			}
		}
	}
}

func (iv *ImageViewBox) NameSelected() string {
	if iv.selBox != nil {
		return iv.selBox.Name
	}
	return ""
}

func (iv *ImageViewBox) SetNameSelected(name string) {
	if iv.selBox != nil {
		iv.selBox.Name = name
		iv.wasModified()
	}
}

func (iv *ImageViewBox) TypeSelected() int {
	if iv.selBox != nil {
		return iv.selBox.Type
	}
	return 0
}

func (iv *ImageViewBox) SetTypeSelected(typ int) {
	if iv.selBox != nil {
		iv.selBox.Type = typ
		iv.wasModified()
	}
}

func (ib *ImageViewBox) updateHighlight(x, y int) bool {
	var changed bool
	for _, b := range ib.Boxes {
		under := x >= b.X && y >= b.Y && x <= b.X2 && y <= b.Y2
		if b.underMouse != under {
			changed = true
		}
		b.underMouse = under
		/*if sel {
			break // allow only one to be underMouse
		}*/
	}
	return changed
}

func (ib *ImageViewBox) isUnderMouse(x, y int) *ImageBox {
	for _, b := range ib.Boxes {
		if x >= b.X && y >= b.Y && x <= b.X2 && y <= b.Y2 {
			return b
		}
	}
	return nil
}

func (ib *ImageViewBox) getCursor(x, y int) uint16 {
	for _, b := range ib.Boxes {
		switch d := ib.resizingDirection(b, x, y); d {
		case DirY, DirY2:
			return w32.IDC_SIZENS
		case DirX, DirX2:
			return w32.IDC_SIZEWE
		}
		// w32.IDC_SIZEALL or w32.IDC_SIZE for resize
	}
	return w32.IDC_ARROW
}

func (ib *ImageViewBox) resizingDirection(b *ImageBox, x, y int) direction {
	if b == nil {
		return DirNone
	}
	switch {
	case b.X == x || b.X == x-1 || b.X == x+1:
		return DirX
	case b.X2 == x || b.X2 == x-1 || b.X2 == x+1:
		return DirX2
	case b.Y == y || b.Y == y-1 || b.Y == y+1:
		return DirY
	case b.Y2 == y || b.Y2 == y-1 || b.Y2 == y+1:
		return DirY2
	}
	return DirNone
}

func (ib *ImageViewBox) resizeToDirection(b *ImageBox, x, y int) {
	switch ib.resize {
	case DirX:
		b.X = x
	case DirY:
		b.Y = y
	case DirX2:
		b.X2 = x
	case DirY2:
		b.Y2 = y
	}
}

func (ib *ImageViewBox) drag(b *ImageBox, x, y int) {
	w, h := b.X2-b.X, b.Y2-b.Y

	nx := ib.dragStartX - b.X
	ny := ib.dragStartY - b.Y

	b.X = x - nx
	b.Y = y - ny
	b.X2 = b.X + w
	b.Y2 = b.Y + h

	ib.dragStartX, ib.dragStartY = x, y
}

func (iv *ImageViewBox) DrawImageFile(filepath string) (err error) {
	iv.bmp, err = NewBitmapFromFile(filepath, RGB(255, 255, 0))
	iv.selBox = nil
	iv.modified = false
	iv.onSelectedChange.Fire(NewEvent(iv, nil))
	iv.onModify.Fire(NewEvent(iv, nil))
	return
}

func (iv *ImageViewBox) DrawImage(bmp *Bitmap) {
	iv.bmp = bmp
	iv.selBox = nil
	iv.modified = false
	iv.onSelectedChange.Fire(NewEvent(iv, nil))
	iv.onModify.Fire(NewEvent(iv, nil))
}

func (iv *ImageViewBox) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_SIZE, w32.WM_SIZING:
		iv.Invalidate(true)

	case w32.WM_ERASEBKGND:
		return 1 // important

	case w32.WM_CREATE:
		internalTrackMouseEvent(iv.hwnd)

	case w32.WM_PAINT:
		if iv.bmp != nil {
			canvas := NewCanvasFromHwnd(iv.hwnd)
			defer canvas.Dispose()
			iv.SetSize(iv.bmp.Size())
			canvas.DrawBitmap(iv.bmp, 0, 0)

			for _, b := range iv.Boxes {
				// old code used NewSystemColorBrush(w32.COLOR_BTNFACE) w32.COLOR_WINDOW
				pen := ImageBoxPen
				if b.underMouse {
					pen = ImageBoxHiPen
				}
				canvas.DrawRect(b.Rect(), pen)

				if b == iv.selBox {
					x1 := []int{b.X, b.X2, b.X2, b.X}
					y1 := []int{b.Y, b.Y, b.Y2, b.Y2}

					for i := 0; i < len(x1); i++ {
						r := NewRect(x1[i]-2, y1[i]-2, x1[i]+2, y1[i]+2)
						canvas.DrawFillRect(r, ImageBoxMarkPen, ImageBoxMarkBrush)
					}

				}
			}
		}

	case w32.WM_MOUSEMOVE:
		x, y := genPoint(lparam)

		if iv.dragBox != nil {
			if iv.resize == DirNone {
				iv.drag(iv.dragBox, x, y)
				iv.wasModified()
			} else {
				iv.resizeToDirection(iv.dragBox, x, y)
				iv.wasModified()
			}
			iv.Invalidate(true)

		} else {
			if !iv.add {
				w32.SetCursor(w32.LoadCursor(0, w32.MakeIntResource(iv.getCursor(x, y))))
			}
			//  do not call repaint if underMouse item did not change.
			if iv.updateHighlight(x, y) {
				iv.Invalidate(true)
			}
		}

		if iv.mouseLeft {
			internalTrackMouseEvent(iv.hwnd)
			iv.mouseLeft = false
		}

	case w32.WM_MOUSELEAVE:
		iv.dragBox = nil
		iv.mouseLeft = true
		iv.updateHighlight(-1, -1)
		iv.Invalidate(true)

	case w32.WM_LBUTTONUP:
		iv.dragBox = nil

	case w32.WM_LBUTTONDOWN:
		x, y := genPoint(lparam)
		if iv.add {
			now := time.Now()
			s := fmt.Sprintf("field%s", now.Format("020405"))
			b := &ImageBox{Name: s, underMouse: true, X: x, Y: y, X2: x + 150, Y2: y + 30}
			iv.Boxes = append(iv.Boxes, b)
			iv.selBox = b
			iv.wasModified()
			iv.onAdd.Fire(NewEvent(iv, nil))
		} else {
			iv.dragBox = iv.isUnderMouse(x, y)
			iv.selBox = iv.dragBox
			iv.dragStartX, iv.dragStartY = x, y
			iv.resize = iv.resizingDirection(iv.dragBox, x, y)
		}
		iv.Invalidate(true)
		iv.onSelectedChange.Fire(NewEvent(iv, nil))

	case w32.WM_RBUTTONDOWN:

	}
	return w32.DefWindowProc(iv.hwnd, msg, wparam, lparam)
}


================================================
FILE: init.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"github.com/tadvi/winc/w32"
)

func init() {
	gControllerRegistry = make(map[w32.HWND]Controller)
	gRegisteredClasses = make([]string, 0)

	var si w32.GdiplusStartupInput
	si.GdiplusVersion = 1
	w32.GdiplusStartup(&si, nil)
}


================================================
FILE: keyboard.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"bytes"

	"github.com/tadvi/winc/w32"
)

type Key uint16

func (k Key) String() string {
	return key2string[k]
}

const (
	KeyLButton           Key = w32.VK_LBUTTON
	KeyRButton           Key = w32.VK_RBUTTON
	KeyCancel            Key = w32.VK_CANCEL
	KeyMButton           Key = w32.VK_MBUTTON
	KeyXButton1          Key = w32.VK_XBUTTON1
	KeyXButton2          Key = w32.VK_XBUTTON2
	KeyBack              Key = w32.VK_BACK
	KeyTab               Key = w32.VK_TAB
	KeyClear             Key = w32.VK_CLEAR
	KeyReturn            Key = w32.VK_RETURN
	KeyShift             Key = w32.VK_SHIFT
	KeyControl           Key = w32.VK_CONTROL
	KeyAlt               Key = w32.VK_MENU
	KeyMenu              Key = w32.VK_MENU
	KeyPause             Key = w32.VK_PAUSE
	KeyCapital           Key = w32.VK_CAPITAL
	KeyKana              Key = w32.VK_KANA
	KeyHangul            Key = w32.VK_HANGUL
	KeyJunja             Key = w32.VK_JUNJA
	KeyFinal             Key = w32.VK_FINAL
	KeyHanja             Key = w32.VK_HANJA
	KeyKanji             Key = w32.VK_KANJI
	KeyEscape            Key = w32.VK_ESCAPE
	KeyConvert           Key = w32.VK_CONVERT
	KeyNonconvert        Key = w32.VK_NONCONVERT
	KeyAccept            Key = w32.VK_ACCEPT
	KeyModeChange        Key = w32.VK_MODECHANGE
	KeySpace             Key = w32.VK_SPACE
	KeyPrior             Key = w32.VK_PRIOR
	KeyNext              Key = w32.VK_NEXT
	KeyEnd               Key = w32.VK_END
	KeyHome              Key = w32.VK_HOME
	KeyLeft              Key = w32.VK_LEFT
	KeyUp                Key = w32.VK_UP
	KeyRight             Key = w32.VK_RIGHT
	KeyDown              Key = w32.VK_DOWN
	KeySelect            Key = w32.VK_SELECT
	KeyPrint             Key = w32.VK_PRINT
	KeyExecute           Key = w32.VK_EXECUTE
	KeySnapshot          Key = w32.VK_SNAPSHOT
	KeyInsert            Key = w32.VK_INSERT
	KeyDelete            Key = w32.VK_DELETE
	KeyHelp              Key = w32.VK_HELP
	Key0                 Key = 0x30
	Key1                 Key = 0x31
	Key2                 Key = 0x32
	Key3                 Key = 0x33
	Key4                 Key = 0x34
	Key5                 Key = 0x35
	Key6                 Key = 0x36
	Key7                 Key = 0x37
	Key8                 Key = 0x38
	Key9                 Key = 0x39
	KeyA                 Key = 0x41
	KeyB                 Key = 0x42
	KeyC                 Key = 0x43
	KeyD                 Key = 0x44
	KeyE                 Key = 0x45
	KeyF                 Key = 0x46
	KeyG                 Key = 0x47
	KeyH                 Key = 0x48
	KeyI                 Key = 0x49
	KeyJ                 Key = 0x4A
	KeyK                 Key = 0x4B
	KeyL                 Key = 0x4C
	KeyM                 Key = 0x4D
	KeyN                 Key = 0x4E
	KeyO                 Key = 0x4F
	KeyP                 Key = 0x50
	KeyQ                 Key = 0x51
	KeyR                 Key = 0x52
	KeyS                 Key = 0x53
	KeyT                 Key = 0x54
	KeyU                 Key = 0x55
	KeyV                 Key = 0x56
	KeyW                 Key = 0x57
	KeyX                 Key = 0x58
	KeyY                 Key = 0x59
	KeyZ                 Key = 0x5A
	KeyLWIN              Key = w32.VK_LWIN
	KeyRWIN              Key = w32.VK_RWIN
	KeyApps              Key = w32.VK_APPS
	KeySleep             Key = w32.VK_SLEEP
	KeyNumpad0           Key = w32.VK_NUMPAD0
	KeyNumpad1           Key = w32.VK_NUMPAD1
	KeyNumpad2           Key = w32.VK_NUMPAD2
	KeyNumpad3           Key = w32.VK_NUMPAD3
	KeyNumpad4           Key = w32.VK_NUMPAD4
	KeyNumpad5           Key = w32.VK_NUMPAD5
	KeyNumpad6           Key = w32.VK_NUMPAD6
	KeyNumpad7           Key = w32.VK_NUMPAD7
	KeyNumpad8           Key = w32.VK_NUMPAD8
	KeyNumpad9           Key = w32.VK_NUMPAD9
	KeyMultiply          Key = w32.VK_MULTIPLY
	KeyAdd               Key = w32.VK_ADD
	KeySeparator         Key = w32.VK_SEPARATOR
	KeySubtract          Key = w32.VK_SUBTRACT
	KeyDecimal           Key = w32.VK_DECIMAL
	KeyDivide            Key = w32.VK_DIVIDE
	KeyF1                Key = w32.VK_F1
	KeyF2                Key = w32.VK_F2
	KeyF3                Key = w32.VK_F3
	KeyF4                Key = w32.VK_F4
	KeyF5                Key = w32.VK_F5
	KeyF6                Key = w32.VK_F6
	KeyF7                Key = w32.VK_F7
	KeyF8                Key = w32.VK_F8
	KeyF9                Key = w32.VK_F9
	KeyF10               Key = w32.VK_F10
	KeyF11               Key = w32.VK_F11
	KeyF12               Key = w32.VK_F12
	KeyF13               Key = w32.VK_F13
	KeyF14               Key = w32.VK_F14
	KeyF15               Key = w32.VK_F15
	KeyF16               Key = w32.VK_F16
	KeyF17               Key = w32.VK_F17
	KeyF18               Key = w32.VK_F18
	KeyF19               Key = w32.VK_F19
	KeyF20               Key = w32.VK_F20
	KeyF21               Key = w32.VK_F21
	KeyF22               Key = w32.VK_F22
	KeyF23               Key = w32.VK_F23
	KeyF24               Key = w32.VK_F24
	KeyNumlock           Key = w32.VK_NUMLOCK
	KeyScroll            Key = w32.VK_SCROLL
	KeyLShift            Key = w32.VK_LSHIFT
	KeyRShift            Key = w32.VK_RSHIFT
	KeyLControl          Key = w32.VK_LCONTROL
	KeyRControl          Key = w32.VK_RCONTROL
	KeyLAlt              Key = w32.VK_LMENU
	KeyLMenu             Key = w32.VK_LMENU
	KeyRAlt              Key = w32.VK_RMENU
	KeyRMenu             Key = w32.VK_RMENU
	KeyBrowserBack       Key = w32.VK_BROWSER_BACK
	KeyBrowserForward    Key = w32.VK_BROWSER_FORWARD
	KeyBrowserRefresh    Key = w32.VK_BROWSER_REFRESH
	KeyBrowserStop       Key = w32.VK_BROWSER_STOP
	KeyBrowserSearch     Key = w32.VK_BROWSER_SEARCH
	KeyBrowserFavorites  Key = w32.VK_BROWSER_FAVORITES
	KeyBrowserHome       Key = w32.VK_BROWSER_HOME
	KeyVolumeMute        Key = w32.VK_VOLUME_MUTE
	KeyVolumeDown        Key = w32.VK_VOLUME_DOWN
	KeyVolumeUp          Key = w32.VK_VOLUME_UP
	KeyMediaNextTrack    Key = w32.VK_MEDIA_NEXT_TRACK
	KeyMediaPrevTrack    Key = w32.VK_MEDIA_PREV_TRACK
	KeyMediaStop         Key = w32.VK_MEDIA_STOP
	KeyMediaPlayPause    Key = w32.VK_MEDIA_PLAY_PAUSE
	KeyLaunchMail        Key = w32.VK_LAUNCH_MAIL
	KeyLaunchMediaSelect Key = w32.VK_LAUNCH_MEDIA_SELECT
	KeyLaunchApp1        Key = w32.VK_LAUNCH_APP1
	KeyLaunchApp2        Key = w32.VK_LAUNCH_APP2
	KeyOEM1              Key = w32.VK_OEM_1
	KeyOEMPlus           Key = w32.VK_OEM_PLUS
	KeyOEMComma          Key = w32.VK_OEM_COMMA
	KeyOEMMinus          Key = w32.VK_OEM_MINUS
	KeyOEMPeriod         Key = w32.VK_OEM_PERIOD
	KeyOEM2              Key = w32.VK_OEM_2
	KeyOEM3              Key = w32.VK_OEM_3
	KeyOEM4              Key = w32.VK_OEM_4
	KeyOEM5              Key = w32.VK_OEM_5
	KeyOEM6              Key = w32.VK_OEM_6
	KeyOEM7              Key = w32.VK_OEM_7
	KeyOEM8              Key = w32.VK_OEM_8
	KeyOEM102            Key = w32.VK_OEM_102
	KeyProcessKey        Key = w32.VK_PROCESSKEY
	KeyPacket            Key = w32.VK_PACKET
	KeyAttn              Key = w32.VK_ATTN
	KeyCRSel             Key = w32.VK_CRSEL
	KeyEXSel             Key = w32.VK_EXSEL
	KeyErEOF             Key = w32.VK_EREOF
	KeyPlay              Key = w32.VK_PLAY
	KeyZoom              Key = w32.VK_ZOOM
	KeyNoName            Key = w32.VK_NONAME
	KeyPA1               Key = w32.VK_PA1
	KeyOEMClear          Key = w32.VK_OEM_CLEAR
)

var key2string = map[Key]string{
	KeyLButton:           "LButton",
	KeyRButton:           "RButton",
	KeyCancel:            "Cancel",
	KeyMButton:           "MButton",
	KeyXButton1:          "XButton1",
	KeyXButton2:          "XButton2",
	KeyBack:              "Back",
	KeyTab:               "Tab",
	KeyClear:             "Clear",
	KeyReturn:            "Return",
	KeyShift:             "Shift",
	KeyControl:           "Control",
	KeyAlt:               "Alt / Menu",
	KeyPause:             "Pause",
	KeyCapital:           "Capital",
	KeyKana:              "Kana / Hangul",
	KeyJunja:             "Junja",
	KeyFinal:             "Final",
	KeyHanja:             "Hanja / Kanji",
	KeyEscape:            "Escape",
	KeyConvert:           "Convert",
	KeyNonconvert:        "Nonconvert",
	KeyAccept:            "Accept",
	KeyModeChange:        "ModeChange",
	KeySpace:             "Space",
	KeyPrior:             "Prior",
	KeyNext:              "Next",
	KeyEnd:               "End",
	KeyHome:              "Home",
	KeyLeft:              "Left",
	KeyUp:                "Up",
	KeyRight:             "Right",
	KeyDown:              "Down",
	KeySelect:            "Select",
	KeyPrint:             "Print",
	KeyExecute:           "Execute",
	KeySnapshot:          "Snapshot",
	KeyInsert:            "Insert",
	KeyDelete:            "Delete",
	KeyHelp:              "Help",
	Key0:                 "0",
	Key1:                 "1",
	Key2:                 "2",
	Key3:                 "3",
	Key4:                 "4",
	Key5:                 "5",
	Key6:                 "6",
	Key7:                 "7",
	Key8:                 "8",
	Key9:                 "9",
	KeyA:                 "A",
	KeyB:                 "B",
	KeyC:                 "C",
	KeyD:                 "D",
	KeyE:                 "E",
	KeyF:                 "F",
	KeyG:                 "G",
	KeyH:                 "H",
	KeyI:                 "I",
	KeyJ:                 "J",
	KeyK:                 "K",
	KeyL:                 "L",
	KeyM:                 "M",
	KeyN:                 "N",
	KeyO:                 "O",
	KeyP:                 "P",
	KeyQ:                 "Q",
	KeyR:                 "R",
	KeyS:                 "S",
	KeyT:                 "T",
	KeyU:                 "U",
	KeyV:                 "V",
	KeyW:                 "W",
	KeyX:                 "X",
	KeyY:                 "Y",
	KeyZ:                 "Z",
	KeyLWIN:              "LWIN",
	KeyRWIN:              "RWIN",
	KeyApps:              "Apps",
	KeySleep:             "Sleep",
	KeyNumpad0:           "Numpad0",
	KeyNumpad1:           "Numpad1",
	KeyNumpad2:           "Numpad2",
	KeyNumpad3:           "Numpad3",
	KeyNumpad4:           "Numpad4",
	KeyNumpad5:           "Numpad5",
	KeyNumpad6:           "Numpad6",
	KeyNumpad7:           "Numpad7",
	KeyNumpad8:           "Numpad8",
	KeyNumpad9:           "Numpad9",
	KeyMultiply:          "Multiply",
	KeyAdd:               "Add",
	KeySeparator:         "Separator",
	KeySubtract:          "Subtract",
	KeyDecimal:           "Decimal",
	KeyDivide:            "Divide",
	KeyF1:                "F1",
	KeyF2:                "F2",
	KeyF3:                "F3",
	KeyF4:                "F4",
	KeyF5:                "F5",
	KeyF6:                "F6",
	KeyF7:                "F7",
	KeyF8:                "F8",
	KeyF9:                "F9",
	KeyF10:               "F10",
	KeyF11:               "F11",
	KeyF12:               "F12",
	KeyF13:               "F13",
	KeyF14:               "F14",
	KeyF15:               "F15",
	KeyF16:               "F16",
	KeyF17:               "F17",
	KeyF18:               "F18",
	KeyF19:               "F19",
	KeyF20:               "F20",
	KeyF21:               "F21",
	KeyF22:               "F22",
	KeyF23:               "F23",
	KeyF24:               "F24",
	KeyNumlock:           "Numlock",
	KeyScroll:            "Scroll",
	KeyLShift:            "LShift",
	KeyRShift:            "RShift",
	KeyLControl:          "LControl",
	KeyRControl:          "RControl",
	KeyLMenu:             "LMenu",
	KeyRMenu:             "RMenu",
	KeyBrowserBack:       "BrowserBack",
	KeyBrowserForward:    "BrowserForward",
	KeyBrowserRefresh:    "BrowserRefresh",
	KeyBrowserStop:       "BrowserStop",
	KeyBrowserSearch:     "BrowserSearch",
	KeyBrowserFavorites:  "BrowserFavorites",
	KeyBrowserHome:       "BrowserHome",
	KeyVolumeMute:        "VolumeMute",
	KeyVolumeDown:        "VolumeDown",
	KeyVolumeUp:          "VolumeUp",
	KeyMediaNextTrack:    "MediaNextTrack",
	KeyMediaPrevTrack:    "MediaPrevTrack",
	KeyMediaStop:         "MediaStop",
	KeyMediaPlayPause:    "MediaPlayPause",
	KeyLaunchMail:        "LaunchMail",
	KeyLaunchMediaSelect: "LaunchMediaSelect",
	KeyLaunchApp1:        "LaunchApp1",
	KeyLaunchApp2:        "LaunchApp2",
	KeyOEM1:              "OEM1",
	KeyOEMPlus:           "OEMPlus",
	KeyOEMComma:          "OEMComma",
	KeyOEMMinus:          "OEMMinus",
	KeyOEMPeriod:         "OEMPeriod",
	KeyOEM2:              "OEM2",
	KeyOEM3:              "OEM3",
	KeyOEM4:              "OEM4",
	KeyOEM5:              "OEM5",
	KeyOEM6:              "OEM6",
	KeyOEM7:              "OEM7",
	KeyOEM8:              "OEM8",
	KeyOEM102:            "OEM102",
	KeyProcessKey:        "ProcessKey",
	KeyPacket:            "Packet",
	KeyAttn:              "Attn",
	KeyCRSel:             "CRSel",
	KeyEXSel:             "EXSel",
	KeyErEOF:             "ErEOF",
	KeyPlay:              "Play",
	KeyZoom:              "Zoom",
	KeyNoName:            "NoName",
	KeyPA1:               "PA1",
	KeyOEMClear:          "OEMClear",
}

type Modifiers byte

func (m Modifiers) String() string {
	return modifiers2string[m]
}

var modifiers2string = map[Modifiers]string{
	ModShift:                       "Shift",
	ModControl:                     "Ctrl",
	ModControl | ModShift:          "Ctrl+Shift",
	ModAlt:                         "Alt",
	ModAlt | ModShift:              "Alt+Shift",
	ModAlt | ModControl | ModShift: "Alt+Ctrl+Shift",
}

const (
	ModShift Modifiers = 1 << iota
	ModControl
	ModAlt
)

func ModifiersDown() Modifiers {
	var m Modifiers

	if ShiftDown() {
		m |= ModShift
	}
	if ControlDown() {
		m |= ModControl
	}
	if AltDown() {
		m |= ModAlt
	}

	return m
}

type Shortcut struct {
	Modifiers Modifiers
	Key       Key
}

func (s Shortcut) String() string {
	m := s.Modifiers.String()
	if m == "" {
		return s.Key.String()
	}

	b := new(bytes.Buffer)

	b.WriteString(m)
	b.WriteRune('+')
	b.WriteString(s.Key.String())

	return b.String()
}

func AltDown() bool {
	return w32.GetKeyState(int32(KeyAlt))>>15 != 0
}

func ControlDown() bool {
	return w32.GetKeyState(int32(KeyControl))>>15 != 0
}

func ShiftDown() bool {
	return w32.GetKeyState(int32(KeyShift))>>15 != 0
}


================================================
FILE: label.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 */

package winc

import (
	"github.com/tadvi/winc/w32"
)

type Label struct {
	ControlBase
}

func NewLabel(parent Controller) *Label {
	lb := new(Label)

	lb.InitControl("STATIC", parent, 0, w32.WS_CHILD|w32.WS_VISIBLE|w32.SS_LEFTNOWORDWRAP)
	RegMsgHandler(lb)

	lb.SetFont(DefaultFont)
	lb.SetText("Label")
	lb.SetSize(100, 25)
	return lb
}

func (lb *Label) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	return w32.DefWindowProc(lb.hwnd, msg, wparam, lparam)
}


================================================
FILE: layout.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 */

package winc

import (
	"encoding/json"
	"fmt"
	"io"
	"os"
	"sort"
	"unsafe"

	"github.com/tadvi/winc/w32"
)

// Dockable component must satisfy interface to be docked.
type Dockable interface {
	Handle() w32.HWND

	Pos() (x, y int)
	Width() int
	Height() int
	Visible() bool

	SetPos(x, y int)
	SetSize(width, height int)

	OnMouseMove() *EventManager
	OnLBUp() *EventManager
}

// DockAllow is window, panel or other component that satisfies interface.
type DockAllow interface {
	Handle() w32.HWND
	ClientWidth() int
	ClientHeight() int
	SetLayout(mng LayoutManager)
}

// Various layout managers
type Direction int

const (
	Top Direction = iota
	Bottom
	Left
	Right
	Fill
)

type LayoutControl struct {
	child Dockable
	dir   Direction
}

type LayoutControls []*LayoutControl

type SimpleDock struct {
	parent      DockAllow
	layoutCtl   LayoutControls
	loadedState bool
}

// DockState gets saved and loaded from json
type CtlState struct {
	X, Y, Width, Height int
}

type LayoutState struct {
	WindowState string
	Controls    []*CtlState
}

func (lc LayoutControls) Len() int           { return len(lc) }
func (lc LayoutControls) Swap(i, j int)      { lc[i], lc[j] = lc[j], lc[i] }
func (lc LayoutControls) Less(i, j int) bool { return lc[i].dir < lc[j].dir }

func NewSimpleDock(parent DockAllow) *SimpleDock {
	d := &SimpleDock{parent: parent}
	parent.SetLayout(d)
	return d
}

// Layout management for the child controls.
func (sd *SimpleDock) Dock(child Dockable, dir Direction) {
	sd.layoutCtl = append(sd.layoutCtl, &LayoutControl{child, dir})
}

// SaveState of the layout. Only works for Docks with parent set to main form.
func (sd *SimpleDock) SaveState(w io.Writer) error {
	var ls LayoutState

	var wp w32.WINDOWPLACEMENT
	wp.Length = uint32(unsafe.Sizeof(wp))
	if !w32.GetWindowPlacement(sd.parent.Handle(), &wp) {
		return fmt.Errorf("GetWindowPlacement failed")
	}

	ls.WindowState = fmt.Sprint(
		wp.Flags, wp.ShowCmd,
		wp.PtMinPosition.X, wp.PtMinPosition.Y,
		wp.PtMaxPosition.X, wp.PtMaxPosition.Y,
		wp.RcNormalPosition.Left, wp.RcNormalPosition.Top,
		wp.RcNormalPosition.Right, wp.RcNormalPosition.Bottom)

	for _, c := range sd.layoutCtl {
		x, y := c.child.Pos()
		w, h := c.child.Width(), c.child.Height()

		ctl := &CtlState{X: x, Y: y, Width: w, Height: h}
		ls.Controls = append(ls.Controls, ctl)
	}

	if err := json.NewEncoder(w).Encode(ls); err != nil {
		return err
	}

	return nil
}

// LoadState of the layout. Only works for Docks with parent set to main form.
func (sd *SimpleDock) LoadState(r io.Reader) error {
	var ls LayoutState

	if err := json.NewDecoder(r).Decode(&ls); err != nil {
		return err
	}

	var wp w32.WINDOWPLACEMENT
	if _, err := fmt.Sscan(ls.WindowState,
		&wp.Flags, &wp.ShowCmd,
		&wp.PtMinPosition.X, &wp.PtMinPosition.Y,
		&wp.PtMaxPosition.X, &wp.PtMaxPosition.Y,
		&wp.RcNormalPosition.Left, &wp.RcNormalPosition.Top,
		&wp.RcNormalPosition.Right, &wp.RcNormalPosition.Bottom); err != nil {
		return err
	}
	wp.Length = uint32(unsafe.Sizeof(wp))

	if !w32.SetWindowPlacement(sd.parent.Handle(), &wp) {
		return fmt.Errorf("SetWindowPlacement failed")
	}

	// if number of controls in the saved layout does not match
	// current number on screen - something changed and we do not reload
	// rest of control sizes from json
	if len(sd.layoutCtl) != len(ls.Controls) {
		return nil
	}

	for i, c := range sd.layoutCtl {
		c.child.SetPos(ls.Controls[i].X, ls.Controls[i].Y)
		c.child.SetSize(ls.Controls[i].Width, ls.Controls[i].Height)
	}
	return nil
}

// SaveStateFile convenience function.
func (sd *SimpleDock) SaveStateFile(file string) error {
	f, err := os.Create(file)
	if err != nil {
		return err
	}
	return sd.SaveState(f)
}

// LoadStateFile loads state ignores error if file is not found.
func (sd *SimpleDock) LoadStateFile(file string) error {
	f, err := os.Open(file)
	if err != nil {
		return nil // if file is not found or not accessible ignore it
	}
	return sd.LoadState(f)
}

// Update is called to resize child items based on layout directions.
func (sd *SimpleDock) Update() {
	sort.Stable(sd.layoutCtl)

	x, y := 0, 0
	w, h := sd.parent.ClientWidth(), sd.parent.ClientHeight()
	winw, winh := w, h

	for _, c := range sd.layoutCtl {
		// Non visible controls do not preserve space.
		if !c.child.Visible() {
			continue
		}

		switch c.dir {
		case Top:
			c.child.SetPos(x, y)
			c.child.SetSize(w, c.child.Height())
			h -= c.child.Height()
			y += c.child.Height()
		case Bottom:
			c.child.SetPos(x, winh-c.child.Height())
			c.child.SetSize(w, c.child.Height())
			h -= c.child.Height()
			winh -= c.child.Height()
		case Left:
			c.child.SetPos(x, y)
			c.child.SetSize(c.child.Width(), h)
			w -= c.child.Width()
			x += c.child.Width()
		case Right:
			c.child.SetPos(winw-c.child.Width(), y)
			c.child.SetSize(c.child.Width(), h)
			w -= c.child.Width()
			winw -= c.child.Width()
		case Fill:
			// fill available space
			c.child.SetPos(x, y)
			c.child.SetSize(w, h)
		}
		//c.child.Invalidate(true)
	}
}


================================================
FILE: listview.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 */

package winc

import (
	"errors"
	"fmt"
	"syscall"
	"unsafe"

	"github.com/tadvi/winc/w32"
)

// ListItem represents an item in a ListView widget.
type ListItem interface {
	Text() []string  // Text returns the text of the multi-column item.
	ImageIndex() int // ImageIndex is used only if SetImageList is called on the listview
}

// ListItemChecker is used for checkbox support in ListView.
type ListItemChecker interface {
	Checked() bool
	SetChecked(checked bool)
}

// ListItemSetter is used in OnEndLabelEdit event.
type ListItemSetter interface {
	SetText(s string) // set first item in the array via LabelEdit event
}

// StringListItem is helper for basic string lists.
type StringListItem struct {
	ID    int
	Data  string
	Check bool
}

func (s StringListItem) Text() []string          { return []string{s.Data} }
func (s StringListItem) Checked() bool           { return s.Check }
func (s StringListItem) SetChecked(checked bool) { s.Check = checked }
func (s StringListItem) ImageIndex() int         { return 0 }

type ListView struct {
	ControlBase

	iml       *ImageList
	lastIndex int
	cols      int // count of columns

	item2Handle map[ListItem]uintptr
	handle2Item map[uintptr]ListItem

	onEndLabelEdit EventManager
	onDoubleClick  EventManager
	onClick        EventManager
	onKeyDown      EventManager
	onItemChanging EventManager
	onItemChanged  EventManager
	onCheckChanged EventManager
	onViewChange   EventManager
	onEndScroll    EventManager
}

func NewListView(parent Controller) *ListView {
	lv := new(ListView)

	lv.InitControl("SysListView32", parent /*w32.WS_EX_CLIENTEDGE*/, 0,
		w32.WS_CHILD|w32.WS_VISIBLE|w32.WS_TABSTOP|w32.LVS_REPORT|w32.LVS_EDITLABELS|w32.LVS_SHOWSELALWAYS)

	lv.item2Handle = make(map[ListItem]uintptr)
	lv.handle2Item = make(map[uintptr]ListItem)

	RegMsgHandler(lv)

	lv.SetFont(DefaultFont)
	lv.SetSize(200, 400)

	if err := lv.SetTheme("Explorer"); err != nil {
		// theme error is ignored
	}
	return lv
}

// FIXME: Changes the state of an item in a list-view control. Refer LVM_SETITEMSTATE message.
func (lv *ListView) setItemState(i int, state, mask uint) {
	var item w32.LVITEM
	item.State, item.StateMask = uint32(state), uint32(mask)
	w32.SendMessage(lv.hwnd, w32.LVM_SETITEMSTATE, uintptr(i), uintptr(unsafe.Pointer(&item)))
}

func (lv *ListView) EnableSingleSelect(enable bool) {
	ToggleStyle(lv.hwnd, enable, w32.LVS_SINGLESEL)
}

func (lv *ListView) EnableSortHeader(enable bool) {
	ToggleStyle(lv.hwnd, enable, w32.LVS_NOSORTHEADER)
}

func (lv *ListView) EnableSortAscending(enable bool) {
	ToggleStyle(lv.hwnd, enable, w32.LVS_SORTASCENDING)
}

func (lv *ListView) EnableEditLabels(enable bool) {
	ToggleStyle(lv.hwnd, enable, w32.LVS_EDITLABELS)
}

func (lv *ListView) EnableFullRowSelect(enable bool) {
	if enable {
		w32.SendMessage(lv.hwnd, w32.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, w32.LVS_EX_FULLROWSELECT)
	} else {
		w32.SendMessage(lv.hwnd, w32.LVM_SETEXTENDEDLISTVIEWSTYLE, w32.LVS_EX_FULLROWSELECT, 0)
	}
}

func (lv *ListView) EnableDoubleBuffer(enable bool) {
	if enable {
		w32.SendMessage(lv.hwnd, w32.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, w32.LVS_EX_DOUBLEBUFFER)
	} else {
		w32.SendMessage(lv.hwnd, w32.LVM_SETEXTENDEDLISTVIEWSTYLE, w32.LVS_EX_DOUBLEBUFFER, 0)
	}
}

func (lv *ListView) EnableHotTrack(enable bool) {
	if enable {
		w32.SendMessage(lv.hwnd, w32.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, w32.LVS_EX_TRACKSELECT)
	} else {
		w32.SendMessage(lv.hwnd, w32.LVM_SETEXTENDEDLISTVIEWSTYLE, w32.LVS_EX_TRACKSELECT, 0)
	}
}

func (lv *ListView) SetItemCount(count int) bool {
	return w32.SendMessage(lv.hwnd, w32.LVM_SETITEMCOUNT, uintptr(count), 0) != 0
}

func (lv *ListView) ItemCount() int {
	return int(w32.SendMessage(lv.hwnd, w32.LVM_GETITEMCOUNT, 0, 0))
}

func (lv *ListView) ItemAt(x, y int) ListItem {
	hti := w32.LVHITTESTINFO{Pt: w32.POINT{int32(x), int32(y)}}
	w32.SendMessage(lv.hwnd, w32.LVM_HITTEST, 0, uintptr(unsafe.Pointer(&hti)))
	return lv.findItemByIndex(int(hti.IItem))
}

func (lv *ListView) Items() (list []ListItem) {
	for item := range lv.item2Handle {
		list = append(list, item)
	}
	return list
}

func (lv *ListView) AddColumn(caption string, width int) {
	var lc w32.LVCOLUMN
	lc.Mask = w32.LVCF_TEXT
	if width != 0 {
		lc.Mask = lc.Mask | w32.LVCF_WIDTH
		lc.Cx = int32(width)
	}
	lc.PszText = syscall.StringToUTF16Ptr(caption)
	lv.insertLvColumn(&lc, lv.cols)
	lv.cols++
}

// StretchLastColumn makes the last column take up all remaining horizontal
// space of the *ListView.
// The effect of this is not persistent.
func (lv *ListView) StretchLastColumn() error {
	if lv.cols == 0 {
		return nil
	}
	if w32.SendMessage(lv.hwnd, w32.LVM_SETCOLUMNWIDTH, uintptr(lv.cols-1), w32.LVSCW_AUTOSIZE_USEHEADER) == 0 {
		//panic("LVM_SETCOLUMNWIDTH failed")
	}
	return nil
}

// CheckBoxes returns if the *TableView has check boxes.
func (lv *ListView) CheckBoxes() bool {
	return w32.SendMessage(lv.hwnd, w32.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)&w32.LVS_EX_CHECKBOXES > 0
}

// SetCheckBoxes sets if the *TableView has check boxes.
func (lv *ListView) SetCheckBoxes(value bool) {
	exStyle := w32.SendMessage(lv.hwnd, w32.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
	oldStyle := exStyle
	if value {
		exStyle |= w32.LVS_EX_CHECKBOXES
	} else {
		exStyle &^= w32.LVS_EX_CHECKBOXES
	}
	if exStyle != oldStyle {
		w32.SendMessage(lv.hwnd, w32.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, exStyle)
	}

	mask := w32.SendMessage(lv.hwnd, w32.LVM_GETCALLBACKMASK, 0, 0)
	if value {
		mask |= w32.LVIS_STATEIMAGEMASK
	} else {
		mask &^= w32.LVIS_STATEIMAGEMASK
	}

	if w32.SendMessage(lv.hwnd, w32.LVM_SETCALLBACKMASK, mask, 0) == w32.FALSE {
		panic("SendMessage(LVM_SETCALLBACKMASK)")
	}
}

func (lv *ListView) applyImage(lc *w32.LVITEM, imIndex int) {
	if lv.iml != nil {
		lc.Mask |= w32.LVIF_IMAGE
		lc.IImage = int32(imIndex)
	}
}

func (lv *ListView) AddItem(item ListItem) {
	lv.InsertItem(item, lv.ItemCount())
}

func (lv *ListView) InsertItem(item ListItem, index int) {
	text := item.Text()
	li := &w32.LVITEM{
		Mask:    w32.LVIF_TEXT | w32.LVIF_PARAM,
		PszText: syscall.StringToUTF16Ptr(text[0]),
		IItem:   int32(index),
	}

	lv.lastIndex++
	ix := new(int)
	*ix = lv.lastIndex
	li.LParam = uintptr(*ix)
	lv.handle2Item[li.LParam] = item
	lv.item2Handle[item] = li.LParam

	lv.applyImage(li, item.ImageIndex())
	lv.insertLvItem(li)

	for i := 1; i < len(text); i++ {
		li.Mask = w32.LVIF_TEXT
		li.PszText = syscall.StringToUTF16Ptr(text[i])
		li.ISubItem = int32(i)
		lv.setLvItem(li)
	}
}

func (lv *ListView) UpdateItem(item ListItem) bool {
	lparam, ok := lv.item2Handle[item]
	if !ok {
		return false
	}

	index := lv.findIndexByItem(item)
	if index == -1 {
		return false
	}

	text := item.Text()
	li := &w32.LVITEM{
		Mask:    w32.LVIF_TEXT | w32.LVIF_PARAM,
		PszText: syscall.StringToUTF16Ptr(text[0]),
		LParam:  lparam,
		IItem:   int32(index),
	}

	lv.applyImage(li, item.ImageIndex())
	lv.setLvItem(li)

	for i := 1; i < len(text); i++ {
		li.Mask = w32.LVIF_TEXT
		li.PszText = syscall.StringToUTF16Ptr(text[i])
		li.ISubItem = int32(i)
		lv.setLvItem(li)
	}
	return true
}

func (lv *ListView) insertLvColumn(lvColumn *w32.LVCOLUMN, iCol int) {
	w32.SendMessage(lv.hwnd, w32.LVM_INSERTCOLUMN, uintptr(iCol), uintptr(unsafe.Pointer(lvColumn)))
}

func (lv *ListView) insertLvItem(lvItem *w32.LVITEM) {
	w32.SendMessage(lv.hwnd, w32.LVM_INSERTITEM, 0, uintptr(unsafe.Pointer(lvItem)))
}

func (lv *ListView) setLvItem(lvItem *w32.LVITEM) {
	w32.SendMessage(lv.hwnd, w32.LVM_SETITEM, 0, uintptr(unsafe.Pointer(lvItem)))
}

func (lv *ListView) DeleteAllItems() bool {
	if w32.SendMessage(lv.hwnd, w32.LVM_DELETEALLITEMS, 0, 0) == w32.TRUE {
		lv.item2Handle = make(map[ListItem]uintptr)
		lv.handle2Item = make(map[uintptr]ListItem)
		return true
	}
	return false
}

func (lv *ListView) DeleteItem(item ListItem) error {
	index := lv.findIndexByItem(item)
	if index == -1 {
		return errors.New("item not found")
	}

	if w32.SendMessage(lv.hwnd, w32.LVM_DELETEITEM, uintptr(index), 0) == 0 {
		return errors.New("SendMessage(TVM_DELETEITEM) failed")
	}

	h := lv.item2Handle[item]
	delete(lv.item2Handle, item)
	delete(lv.handle2Item, h)
	return nil
}

func (lv *ListView) findIndexByItem(item ListItem) int {
	lparam, ok := lv.item2Handle[item]
	if !ok {
		return -1
	}

	it := &w32.LVFINDINFO{
		Flags:  w32.LVFI_PARAM,
		LParam: lparam,
	}
	var i int = -1
	return int(w32.SendMessage(lv.hwnd, w32.LVM_FINDITEM, uintptr(i), uintptr(unsafe.Pointer(it))))
}

func (lv *ListView) findItemByIndex(i int) ListItem {
	it := &w32.LVITEM{
		Mask:  w32.LVIF_PARAM,
		IItem: int32(i),
	}

	if w32.SendMessage(lv.hwnd, w32.LVM_GETITEM, 0, uintptr(unsafe.Pointer(it))) == w32.TRUE {
		if item, ok := lv.handle2Item[it.LParam]; ok {
			return item
		}
	}
	return nil
}

func (lv *ListView) EnsureVisible(item ListItem) bool {
	if i := lv.findIndexByItem(item); i != -1 {
		return w32.SendMessage(lv.hwnd, w32.LVM_ENSUREVISIBLE, uintptr(i), 1) == 0
	}
	return false
}

func (lv *ListView) SelectedItem() ListItem {
	if items := lv.SelectedItems(); len(items) > 0 {
		return items[0]
	}
	return nil
}

func (lv *ListView) SetSelectedItem(item ListItem) bool {
	if i := lv.findIndexByItem(item); i > -1 {
		lv.SetSelectedIndex(i)
		return true
	}
	return false
}

// mask is used to set the LVITEM.Mask for ListView.GetItem which indicates which attributes you'd like to receive
// of LVITEM.
func (lv *ListView) SelectedItems() []ListItem {
	var items []ListItem

	var i int = -1
	for {
		if i = int(w32.SendMessage(lv.hwnd, w32.LVM_GETNEXTITEM, uintptr(i), uintptr(w32.LVNI_SELECTED))); i == -1 {
			break
		}

		if item := lv.findItemByIndex(i); item != nil {
			items = append(items, item)
		}
	}
	return items
}

func (lv *ListView) SelectedCount() uint {
	return uint(w32.SendMessage(lv.hwnd, w32.LVM_GETSELECTEDCOUNT, 0, 0))
}

// GetSelectedIndex first selected item index. Returns -1 if no item is selected.
func (lv *ListView) SelectedIndex() int {
	var i int = -1
	return int(w32.SendMessage(lv.hwnd, w32.LVM_GETNEXTITEM, uintptr(i), uintptr(w32.LVNI_SELECTED)))
}

// Set i to -1 to select all items.
func (lv *ListView) SetSelectedIndex(i int) {
	lv.setItemState(i, w32.LVIS_SELECTED, w32.LVIS_SELECTED)
}

func (lv *ListView) SetImageList(imageList *ImageList) {
	w32.SendMessage(lv.hwnd, w32.LVM_SETIMAGELIST, w32.LVSIL_SMALL, uintptr(imageList.Handle()))
	lv.iml = imageList
}

// Event publishers
func (lv *ListView) OnEndLabelEdit() *EventManager {
	return &lv.onEndLabelEdit
}

func (lv *ListView) OnDoubleClick() *EventManager {
	return &lv.onDoubleClick
}

func (lv *ListView) OnClick() *EventManager {
	return &lv.onClick
}

func (lv *ListView) OnKeyDown() *EventManager {
	return &lv.onKeyDown
}

func (lv *ListView) OnItemChanging() *EventManager {
	return &lv.onItemChanging
}

func (lv *ListView) OnItemChanged() *EventManager {
	return &lv.onItemChanged
}

func (lv *ListView) OnCheckChanged() *EventManager {
	return &lv.onCheckChanged
}

func (lv *ListView) OnViewChange() *EventManager {
	return &lv.onViewChange
}

func (lv *ListView) OnEndScroll() *EventManager {
	return &lv.onEndScroll
}

// Message processer
func (lv *ListView) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	switch msg {
	/*case w32.WM_ERASEBKGND:
	lv.StretchLastColumn()
	println("case w32.WM_ERASEBKGND")
	return 1*/

	case w32.WM_NOTIFY:
		nm := (*w32.NMHDR)(unsafe.Pointer(lparam))
		code := int32(nm.Code)

		switch code {
		case w32.LVN_BEGINLABELEDITW:
			// println("Begin label edit")
		case w32.LVN_ENDLABELEDITW:
			nmdi := (*w32.NMLVDISPINFO)(unsafe.Pointer(lparam))
			if nmdi.Item.PszText != nil {
				fmt.Println(nmdi.Item.PszText, nmdi.Item)
				if item, ok := lv.handle2Item[nmdi.Item.LParam]; ok {
					lv.onEndLabelEdit.Fire(NewEvent(lv,
						&LabelEditEventData{Item: item,
							Text: w32.UTF16PtrToString(nmdi.Item.PszText)}))
				}
				return w32.TRUE
			}
		case w32.NM_DBLCLK:
			lv.onDoubleClick.Fire(NewEvent(lv, nil))

		case w32.NM_CLICK:
			ac := (*w32.NMITEMACTIVATE)(unsafe.Pointer(lparam))
			var hti w32.LVHITTESTINFO
			hti.Pt = w32.POINT{ac.PtAction.X, ac.PtAction.Y}
			w32.SendMessage(lv.hwnd, w32.LVM_HITTEST, 0, uintptr(unsafe.Pointer(&hti)))

			if hti.Flags == w32.LVHT_ONITEMSTATEICON {
				if item := lv.findItemByIndex(int(hti.IItem)); item != nil {
					if item, ok := item.(ListItemChecker); ok {
						checked := !item.Checked()
						item.SetChecked(checked)
						lv.onCheckChanged.Fire(NewEvent(lv, item))

						if w32.SendMessage(lv.hwnd, w32.LVM_UPDATE, uintptr(hti.IItem), 0) == w32.FALSE {
							panic("SendMessage(LVM_UPDATE)")
						}
					}
				}
			}

			hti.Pt = w32.POINT{ac.PtAction.X, ac.PtAction.Y}
			w32.SendMessage(lv.hwnd, w32.LVM_SUBITEMHITTEST, 0, uintptr(unsafe.Pointer(&hti)))
			lv.onClick.Fire(NewEvent(lv, hti.ISubItem))

		case w32.LVN_KEYDOWN:
			nmkey := (*w32.NMLVKEYDOWN)(unsafe.Pointer(lparam))
			if nmkey.WVKey == w32.VK_SPACE && lv.CheckBoxes() {
				if item := lv.SelectedItem(); item != nil {
					if item, ok := item.(ListItemChecker); ok {
						checked := !item.Checked()
						item.SetChecked(checked)
						lv.onCheckChanged.Fire(NewEvent(lv, item))
					}

					index := lv.findIndexByItem(item)
					if w32.SendMessage(lv.hwnd, w32.LVM_UPDATE, uintptr(index), 0) == w32.FALSE {
						panic("SendMessage(LVM_UPDATE)")
					}
				}
			}
			lv.onKeyDown.Fire(NewEvent(lv, nmkey.WVKey))
			key := nmkey.WVKey
			w32.SendMessage(lv.Parent().Handle(), w32.WM_KEYDOWN, uintptr(key), 0)

		case w32.LVN_ITEMCHANGING:
			// This event also fires when listview has changed via code.
			nmlv := (*w32.NMLISTVIEW)(unsafe.Pointer(lparam))
			item := lv.findItemByIndex(int(nmlv.IItem))
			lv.onItemChanging.Fire(NewEvent(lv, item))

		case w32.LVN_ITEMCHANGED:
			// This event also fires when listview has changed via code.
			nmlv := (*w32.NMLISTVIEW)(unsafe.Pointer(lparam))
			item := lv.findItemByIndex(int(nmlv.IItem))
			lv.onItemChanged.Fire(NewEvent(lv, item))

		case w32.LVN_GETDISPINFO:
			nmdi := (*w32.NMLVDISPINFO)(unsafe.Pointer(lparam))
			if nmdi.Item.StateMask&w32.LVIS_STATEIMAGEMASK > 0 {
				if item, ok := lv.handle2Item[nmdi.Item.LParam]; ok {
					if item, ok := item.(ListItemChecker); ok {

						checked := item.Checked()
						if checked {
							nmdi.Item.State = 0x2000
						} else {
							nmdi.Item.State = 0x1000
						}
					}
				}
			}

			lv.onViewChange.Fire(NewEvent(lv, nil))

		case w32.LVN_ENDSCROLL:
			lv.onEndScroll.Fire(NewEvent(lv, nil))
		}
	}
	return w32.DefWindowProc(lv.hwnd, msg, wparam, lparam)
}


================================================
FILE: menu.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 */

package winc

import (
	"fmt"
	"syscall"
	"unsafe"

	"github.com/tadvi/winc/w32"
)

var (
	nextMenuItemID  uint16 = 3
	actionsByID            = make(map[uint16]*MenuItem)
	shortcut2Action        = make(map[Shortcut]*MenuItem)
	menuItems              = make(map[w32.HMENU][]*MenuItem)
	radioGroups            = make(map[*MenuItem]*RadioGroup)
	initialised     bool
)

var NoShortcut = Shortcut{}

// Menu for main window and context menus on controls.
// Most methods used for both main window menu and context menu.
type Menu struct {
	hMenu w32.HMENU
	hwnd  w32.HWND // hwnd might be nil if it is context menu.
}

type MenuItem struct {
	hMenu    w32.HMENU
	hSubMenu w32.HMENU // Non zero if this item is in itself a submenu.

	text     string
	toolTip  string
	image    *Bitmap
	shortcut Shortcut
	enabled  bool

	checkable bool
	checked   bool
	isRadio   bool

	id uint16

	onClick EventManager
}

type RadioGroup struct {
	members []*MenuItem
	hwnd    w32.HWND
}

func NewContextMenu() *MenuItem {
	hMenu := w32.CreatePopupMenu()
	if hMenu == 0 {
		panic("failed CreateMenu")
	}

	item := &MenuItem{
		hMenu:    hMenu,
		hSubMenu: hMenu,
	}
	return item
}

func (m *Menu) Dispose() {
	if m.hMenu != 0 {
		w32.DestroyMenu(m.hMenu)
		m.hMenu = 0
	}
}

func (m *Menu) IsDisposed() bool {
	return m.hMenu == 0
}

func initMenuItemInfoFromAction(mii *w32.MENUITEMINFO, a *MenuItem) {
	mii.CbSize = uint32(unsafe.Sizeof(*mii))
	mii.FMask = w32.MIIM_FTYPE | w32.MIIM_ID | w32.MIIM_STATE | w32.MIIM_STRING
	if a.image != nil {
		mii.FMask |= w32.MIIM_BITMAP
		mii.HbmpItem = a.image.handle
	}
	if a.IsSeparator() {
		mii.FType = w32.MFT_SEPARATOR
	} else {
		mii.FType = w32.MFT_STRING
		var text string
		if s := a.shortcut; s.Key != 0 {
			text = fmt.Sprintf("%s\t%s", a.text, s.String())
			shortcut2Action[a.shortcut] = a
		} else {
			text = a.text
		}
		mii.DwTypeData = syscall.StringToUTF16Ptr(text)
		mii.Cch = uint32(len([]rune(a.text)))
	}
	mii.WID = uint32(a.id)

	if a.Enabled() {
		mii.FState &^= w32.MFS_DISABLED
	} else {
		mii.FState |= w32.MFS_DISABLED
	}

	if a.Checkable() {
		mii.FMask |= w32.MIIM_CHECKMARKS
	}
	if a.Checked() {
		mii.FState |= w32.MFS_CHECKED
	}

	if a.hSubMenu != 0 {
		mii.FMask |= w32.MIIM_SUBMENU
		mii.HSubMenu = a.hSubMenu
	}
}

// Show menu on the main window.
func (m *Menu) Show() {
	initialised = true
	updateRadioGroups()
	if !w32.DrawMenuBar(m.hwnd) {
		panic("DrawMenuBar failed")
	}
}

// AddSubMenu returns item that is used as submenu to perform AddItem(s).
func (m *Menu) AddSubMenu(text string) *MenuItem {
	hSubMenu := w32.CreateMenu()
	if hSubMenu == 0 {
		panic("failed CreateMenu")
	}
	return addMenuItem(m.hMenu, hSubMenu, text, Shortcut{}, nil, false)
}

// This method will iterate through the menu items, group radio items together, build a
// quick access map and set the initial items
func updateRadioGroups() {

	if !initialised {
		return
	}

	radioItemsChecked := []*MenuItem{}
	radioGroups = make(map[*MenuItem]*RadioGroup)
	var currentRadioGroupMembers []*MenuItem
	// Iterate the menus
	for _, menu := range menuItems {
		menuLength := len(menu)
		for index, menuItem := range menu {
			if menuItem.isRadio {
				currentRadioGroupMembers = append(currentRadioGroupMembers, menuItem)
				if menuItem.checked {
					radioItemsChecked = append(radioItemsChecked, menuItem)
				}

				// If end of menu
				if index == menuLength-1 {
					radioGroup := &RadioGroup{
						members: currentRadioGroupMembers,
						hwnd:    menuItem.hMenu,
					}
					// Save the group to each member iin the radiomap
					for _, member := range currentRadioGroupMembers {
						radioGroups[member] = radioGroup
					}
					currentRadioGroupMembers = []*MenuItem{}
				}
				continue
			}

			// Not a radio item
			if len(currentRadioGroupMembers) > 0 {
				radioGroup := &RadioGroup{
					members: currentRadioGroupMembers,
					hwnd:    menuItem.hMenu,
				}
				// Save the group to each member iin the radiomap
				for _, member := range currentRadioGroupMembers {
					radioGroups[member] = radioGroup
				}
				currentRadioGroupMembers = []*MenuItem{}
			}
		}
	}

	// Enable the checked items
	for _, item := range radioItemsChecked {
		radioGroup := radioGroups[item]
		startID := radioGroup.members[0].id
		endID := radioGroup.members[len(radioGroup.members)-1].id
		w32.SelectRadioMenuItem(item.id, startID, endID, radioGroup.hwnd)
	}

}

func (mi *MenuItem) OnClick() *EventManager {
	return &mi.onClick
}

func (mi *MenuItem) AddSeparator() {
	addMenuItem(mi.hSubMenu, 0, "-", Shortcut{}, nil, false)
}

// AddItem adds plain menu item.
func (mi *MenuItem) AddItem(text string, shortcut Shortcut) *MenuItem {
	return addMenuItem(mi.hSubMenu, 0, text, shortcut, nil, false)
}

// AddItemCheckable adds plain menu item that can have a checkmark.
func (mi *MenuItem) AddItemCheckable(text string, shortcut Shortcut) *MenuItem {
	return addMenuItem(mi.hSubMenu, 0, text, shortcut, nil, true)
}

// AddItemRadio adds plain menu item that can have a checkmark and is part of a radio group.
func (mi *MenuItem) AddItemRadio(text string, shortcut Shortcut) *MenuItem {
	menuItem := addMenuItem(mi.hSubMenu, 0, text, shortcut, nil, true)
	menuItem.isRadio = true
	return menuItem
}

// AddItemWithBitmap adds menu item with shortcut and bitmap.
func (mi *MenuItem) AddItemWithBitmap(text string, shortcut Shortcut, image *Bitmap) *MenuItem {
	return addMenuItem(mi.hSubMenu, 0, text, shortcut, image, false)
}

// AddSubMenu adds a submenu.
func (mi *MenuItem) AddSubMenu(text string) *MenuItem {
	hSubMenu := w32.CreatePopupMenu()
	if hSubMenu == 0 {
		panic("failed CreatePopupMenu")
	}
	return addMenuItem(mi.hSubMenu, hSubMenu, text, Shortcut{}, nil, false)
}

// AddItem to the menu, set text to "-" for separators.
func addMenuItem(hMenu, hSubMenu w32.HMENU, text string, shortcut Shortcut, image *Bitmap, checkable bool) *MenuItem {
	item := &MenuItem{
		hMenu:     hMenu,
		hSubMenu:  hSubMenu,
		text:      text,
		shortcut:  shortcut,
		image:     image,
		enabled:   true,
		id:        nextMenuItemID,
		checkable: checkable,
		isRadio:   false,
		//visible:  true,
	}
	nextMenuItemID++
	actionsByID[item.id] = item
	menuItems[hMenu] = append(menuItems[hMenu], item)

	var mii w32.MENUITEMINFO
	initMenuItemInfoFromAction(&mii, item)

	index := -1
	if !w32.InsertMenuItem(hMenu, uint32(index), true, &mii) {
		panic("InsertMenuItem failed")
	}
	return item
}

func indexInObserver(a *MenuItem) int {
	var idx int
	for _, mi := range menuItems[a.hMenu] {
		if mi == a {
			return idx
		}
		idx++
	}
	return -1
}

func findMenuItemByID(id int) *MenuItem {
	return actionsByID[uint16(id)]
}

func (mi *MenuItem) update() {
	var mii w32.MENUITEMINFO
	initMenuItemInfoFromAction(&mii, mi)

	if !w32.SetMenuItemInfo(mi.hMenu, uint32(indexInObserver(mi)), true, &mii) {
		panic("SetMenuItemInfo failed")
	}
	if mi.isRadio {
		mi.updateRadioGroup()
	}
}

func (mi *MenuItem) IsSeparator() bool { return mi.text == "-" }
func (mi *MenuItem) SetSeparator()     { mi.text = "-" }

func (mi *MenuItem) Enabled() bool     { return mi.enabled }
func (mi *MenuItem) SetEnabled(b bool) { mi.enabled = b; mi.update() }

func (mi *MenuItem) Checkable() bool     { return mi.checkable }
func (mi *MenuItem) SetCheckable(b bool) { mi.checkable = b; mi.update() }

func (mi *MenuItem) Checked() bool { return mi.checked }
func (mi *MenuItem) SetChecked(b bool) {
	if mi.isRadio {
		radioGroup := radioGroups[mi]
		if radioGroup != nil {
			for _, member := range radioGroup.members {
				member.checked = false
			}
		}

	}
	mi.checked = b
	mi.update()
}

func (mi *MenuItem) Text() string     { return mi.text }
func (mi *MenuItem) SetText(s string) { mi.text = s; mi.update() }

func (mi *MenuItem) Image() *Bitmap     { return mi.image }
func (mi *MenuItem) SetImage(b *Bitmap) { mi.image = b; mi.update() }

func (mi *MenuItem) ToolTip() string     { return mi.toolTip }
func (mi *MenuItem) SetToolTip(s string) { mi.toolTip = s; mi.update() }

func (mi *MenuItem) updateRadioGroup() {
	radioGroup := radioGroups[mi]
	if radioGroup == nil {
		return
	}
	startID := radioGroup.members[0].id
	endID := radioGroup.members[len(radioGroup.members)-1].id
	w32.SelectRadioMenuItem(mi.id, startID, endID, radioGroup.hwnd)
}


================================================
FILE: mousecontrol.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 */

package winc

import (
	"github.com/tadvi/winc/w32"
)

// MouseControl used for creating custom controls that need mouse hover or mouse leave events.
type MouseControl struct {
	ControlBase
	isMouseLeft bool
}

func (cc *MouseControl) Init(parent Controller, className string, exStyle, style uint) {
	RegClassOnlyOnce(className)
	cc.hwnd = CreateWindow(className, parent, exStyle, style)
	cc.parent = parent
	RegMsgHandler(cc)

	cc.isMouseLeft = true
	cc.SetFont(DefaultFont)
}

func (cc *MouseControl) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	sender := GetMsgHandler(cc.hwnd)
	switch msg {
	case w32.WM_CREATE:
		internalTrackMouseEvent(cc.hwnd)
		cc.onCreate.Fire(NewEvent(sender, nil))
	case w32.WM_CLOSE:
		cc.onClose.Fire(NewEvent(sender, nil))
	case w32.WM_MOUSEMOVE:
		//if cc.isMouseLeft {

		cc.onMouseHover.Fire(NewEvent(sender, nil))
		//internalTrackMouseEvent(cc.hwnd)
		cc.isMouseLeft = false

		//}
	case w32.WM_MOUSELEAVE:
		cc.onMouseLeave.Fire(NewEvent(sender, nil))
		cc.isMouseLeft = true
	}
	return w32.DefWindowProc(cc.hwnd, msg, wparam, lparam)
}


================================================
FILE: msghandlerregistry.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"github.com/tadvi/winc/w32"
)

func RegMsgHandler(controller Controller) {
	gControllerRegistry[controller.Handle()] = controller
}

func UnRegMsgHandler(hwnd w32.HWND) {
	delete(gControllerRegistry, hwnd)
}

func GetMsgHandler(hwnd w32.HWND) Controller {
	if controller, isExists := gControllerRegistry[hwnd]; isExists {
		return controller
	}

	return nil
}


================================================
FILE: panel.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 */

package winc

import (
	"fmt"

	"github.com/tadvi/winc/w32"
)

type Panel struct {
	ControlBase
	layoutMng LayoutManager
}

func NewPanel(parent Controller) *Panel {
	pa := new(Panel)

	RegClassOnlyOnce("winc_Panel")
	pa.hwnd = CreateWindow("winc_Panel", parent, w32.WS_EX_CONTROLPARENT, w32.WS_CHILD|w32.WS_VISIBLE)
	pa.parent = parent
	RegMsgHandler(pa)

	pa.SetFont(DefaultFont)
	pa.SetText("")
	pa.SetSize(200, 65)
	return pa
}

// SetLayout panel implements DockAllow interface.
func (pa *Panel) SetLayout(mng LayoutManager) {
	pa.layoutMng = mng
}

func (pa *Panel) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_SIZE, w32.WM_PAINT:
		if pa.layoutMng != nil {
			pa.layoutMng.Update()
		}
	}
	return w32.DefWindowProc(pa.hwnd, msg, wparam, lparam)
}

var errorPanelPen = NewPen(w32.PS_GEOMETRIC, 2, NewSolidColorBrush(RGB(255, 128, 128)))
var errorPanelOkPen = NewPen(w32.PS_GEOMETRIC, 2, NewSolidColorBrush(RGB(220, 220, 220)))

// ErrorPanel shows errors or important messages.
// It is meant to stand out of other on screen controls.
type ErrorPanel struct {
	ControlBase
	pen    *Pen
	margin int
}

// NewErrorPanel.
func NewErrorPanel(parent Controller) *ErrorPanel {
	f := new(ErrorPanel)
	f.init(parent)

	f.SetFont(DefaultFont)
	f.SetText("No errors")
	f.SetSize(200, 65)
	f.margin = 5
	f.pen = errorPanelOkPen
	return f
}

func (epa *ErrorPanel) init(parent Controller) {
	RegClassOnlyOnce("winc_ErrorPanel")

	epa.hwnd = CreateWindow("winc_ErrorPanel", parent, w32.WS_EX_CONTROLPARENT, w32.WS_CHILD|w32.WS_VISIBLE)
	epa.parent = parent

	RegMsgHandler(epa)
}

func (epa *ErrorPanel) SetMargin(margin int) {
	epa.margin = margin
}

func (epa *ErrorPanel) Printf(format string, v ...interface{}) {
	epa.SetText(fmt.Sprintf(format, v...))
	epa.ShowAsError(false)
}

func (epa *ErrorPanel) Errorf(format string, v ...interface{}) {
	epa.SetText(fmt.Sprintf(format, v...))
	epa.ShowAsError(true)
}

func (epa *ErrorPanel) ShowAsError(show bool) {
	if show {
		epa.pen = errorPanelPen
	} else {
		epa.pen = errorPanelOkPen
	}
	epa.Invalidate(true)
}

func (epa *ErrorPanel) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_ERASEBKGND:
		canvas := NewCanvasFromHDC(w32.HDC(wparam))
		r := epa.Bounds()
		r.rect.Left += int32(epa.margin)
		r.rect.Right -= int32(epa.margin)
		r.rect.Top += int32(epa.margin)
		r.rect.Bottom -= int32(epa.margin)
		// old code used NewSystemColorBrush(w32.COLOR_BTNFACE)
		canvas.DrawFillRect(r, epa.pen, NewSystemColorBrush(w32.COLOR_WINDOW))

		r.rect.Left += 5
		canvas.DrawText(epa.Text(), r, 0, epa.Font(), RGB(0, 0, 0))
		canvas.Dispose()
		return 1
	}
	return w32.DefWindowProc(epa.hwnd, msg, wparam, lparam)
}

// MultiPanel contains other panels and only makes one of them visible.
type MultiPanel struct {
	ControlBase
	current int
	panels  []*Panel
}

func NewMultiPanel(parent Controller) *MultiPanel {
	mpa := new(MultiPanel)

	RegClassOnlyOnce("winc_MultiPanel")
	mpa.hwnd = CreateWindow("winc_MultiPanel", parent, w32.WS_EX_CONTROLPARENT, w32.WS_CHILD|w32.WS_VISIBLE)
	mpa.parent = parent
	RegMsgHandler(mpa)

	mpa.SetFont(DefaultFont)
	mpa.SetText("")
	mpa.SetSize(300, 200)
	mpa.current = -1
	return mpa
}

func (mpa *MultiPanel) Count() int { return len(mpa.panels) }

// AddPanel adds panels to the internal list, first panel is visible all others are hidden.
func (mpa *MultiPanel) AddPanel(panel *Panel) {
	if len(mpa.panels) > 0 {
		panel.Hide()
	}
	mpa.current = 0
	mpa.panels = append(mpa.panels, panel)
}

// ReplacePanel replaces panel, useful for refreshing controls on screen.
func (mpa *MultiPanel) ReplacePanel(index int, panel *Panel) {
	mpa.panels[index] = panel
}

// DeletePanel removed panel.
func (mpa *MultiPanel) DeletePanel(index int) {
	mpa.panels = append(mpa.panels[:index], mpa.panels[index+1:]...)
}

func (mpa *MultiPanel) Current() int {
	return mpa.current
}

func (mpa *MultiPanel) SetCurrent(index int) {
	if index >= len(mpa.panels) {
		panic("index greater than number of panels")
	}
	if mpa.current == -1 {
		panic("no current panel, add panels first")
	}
	for i := range mpa.panels {
		if i != index {
			mpa.panels[i].Hide()
			mpa.panels[i].Invalidate(true)
		}
	}
	mpa.panels[index].Show()
	mpa.panels[index].Invalidate(true)
	mpa.current = index
}

func (mpa *MultiPanel) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_SIZE:
		// resize contained panels
		for _, p := range mpa.panels {
			p.SetPos(0, 0)
			p.SetSize(mpa.Size())
		}
	}
	return w32.DefWindowProc(mpa.hwnd, msg, wparam, lparam)
}


================================================
FILE: path.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"fmt"
	"os"
	"path/filepath"
	"syscall"

	"github.com/tadvi/winc/w32"
)

func knownFolderPath(id w32.CSIDL) (string, error) {
	var buf [w32.MAX_PATH]uint16

	if !w32.SHGetSpecialFolderPath(0, &buf[0], id, false) {
		return "", fmt.Errorf("SHGetSpecialFolderPath failed")
	}

	return syscall.UTF16ToString(buf[0:]), nil
}

func AppDataPath() (string, error) {
	return knownFolderPath(w32.CSIDL_APPDATA)
}

func CommonAppDataPath() (string, error) {
	return knownFolderPath(w32.CSIDL_COMMON_APPDATA)
}

func LocalAppDataPath() (string, error) {
	return knownFolderPath(w32.CSIDL_LOCAL_APPDATA)
}

// EnsureAppDataPath uses AppDataPath to ensure storage for local settings and databases.
func EnsureAppDataPath(company, product string) (string, error) {
	path, err := AppDataPath()
	if err != nil {
		return path, err
	}
	p := filepath.Join(path, company, product)

	if _, err := os.Stat(p); os.IsNotExist(err) {
		// path/to/whatever does not exist
		if err := os.MkdirAll(p, os.ModePerm); err != nil {
			return p, err
		}
	}
	return p, nil
}

func DriveNames() ([]string, error) {
	bufLen := w32.GetLogicalDriveStrings(0, nil)
	if bufLen == 0 {
		return nil, fmt.Errorf("GetLogicalDriveStrings failed")
	}
	buf := make([]uint16, bufLen+1)

	bufLen = w32.GetLogicalDriveStrings(bufLen+1, &buf[0])
	if bufLen == 0 {
		return nil, fmt.Errorf("GetLogicalDriveStrings failed")
	}

	var names []string
	for i := 0; i < len(buf)-2; {
		name := syscall.UTF16ToString(buf[i:])
		names = append(names, name)
		i += len(name) + 1
	}
	return names, nil
}


================================================
FILE: pen.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"github.com/tadvi/winc/w32"
)

type Pen struct {
	hPen  w32.HPEN
	style uint
	brush *Brush
}

func NewPen(style uint, width uint, brush *Brush) *Pen {
	if brush == nil {
		panic("Brush cannot be nil")
	}

	hPen := w32.ExtCreatePen(style, width, brush.GetLOGBRUSH(), 0, nil)
	if hPen == 0 {
		panic("Failed to create pen")
	}

	return &Pen{hPen, style, brush}
}

func NewNullPen() *Pen {
	lb := w32.LOGBRUSH{LbStyle: w32.BS_NULL}

	hPen := w32.ExtCreatePen(w32.PS_COSMETIC|w32.PS_NULL, 1, &lb, 0, nil)
	if hPen == 0 {
		panic("failed to create null brush")
	}

	return &Pen{hPen: hPen}
}

func (pen *Pen) Style() uint {
	return pen.style
}

func (pen *Pen) Brush() *Brush {
	return pen.brush
}

func (pen *Pen) GetHPEN() w32.HPEN {
	return pen.hPen
}

func (pen *Pen) Dispose() {
	if pen.hPen != 0 {
		w32.DeleteObject(w32.HGDIOBJ(pen.hPen))
		pen.hPen = 0
	}
}


================================================
FILE: progressbar.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 */

package winc

import (
	"github.com/tadvi/winc/w32"
)

type ProgressBar struct {
	ControlBase
}

func NewProgressBar(parent Controller) *ProgressBar {
	pb := new(ProgressBar)

	pb.InitControl(w32.PROGRESS_CLASS, parent, 0, w32.WS_CHILD|w32.WS_VISIBLE)
	RegMsgHandler(pb)

	pb.SetSize(200, 22)
	return pb
}

func (pr *ProgressBar) Value() int {
	ret := w32.SendMessage(pr.hwnd, w32.PBM_GETPOS, 0, 0)
	return int(ret)
}

func (pr *ProgressBar) SetValue(v int) {
	w32.SendMessage(pr.hwnd, w32.PBM_SETPOS, uintptr(v), 0)
}

func (pr *ProgressBar) Range() (min, max uint) {
	min = uint(w32.SendMessage(pr.hwnd, w32.PBM_GETRANGE, uintptr(w32.BoolToBOOL(true)), 0))
	max = uint(w32.SendMessage(pr.hwnd, w32.PBM_GETRANGE, uintptr(w32.BoolToBOOL(false)), 0))
	return
}

func (pr *ProgressBar) SetRange(min, max int) {
	w32.SendMessage(pr.hwnd, w32.PBM_SETRANGE32, uintptr(min), uintptr(max))
}

func (pr *ProgressBar) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	return w32.DefWindowProc(pr.hwnd, msg, wparam, lparam)
}


================================================
FILE: rect.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"github.com/tadvi/winc/w32"
)

type Rect struct {
	rect w32.RECT
}

func NewEmptyRect() *Rect {
	var newRect Rect
	w32.SetRectEmpty(&newRect.rect)

	return &newRect
}

func NewRect(left, top, right, bottom int) *Rect {
	var newRect Rect
	w32.SetRectEmpty(&newRect.rect)
	newRect.Set(left, top, right, bottom)

	return &newRect
}

func (re *Rect) Data() (left, top, right, bottom int32) {
	left = re.rect.Left
	top = re.rect.Top
	right = re.rect.Right
	bottom = re.rect.Bottom
	return
}

func (re *Rect) Width() int {
	return int(re.rect.Right - re.rect.Left)
}

func (re *Rect) Height() int {
	return int(re.rect.Bottom - re.rect.Top)
}

func (re *Rect) GetW32Rect() *w32.RECT {
	return &re.rect
}

func (re *Rect) Set(left, top, right, bottom int) {
	w32.SetRect(&re.rect, left, top, right, bottom)
}

func (re *Rect) IsEqual(rect *Rect) bool {
	return w32.EqualRect(&re.rect, &rect.rect)
}

func (re *Rect) Inflate(x, y int) {
	w32.InflateRect(&re.rect, x, y)
}

func (re *Rect) Intersect(src *Rect) {
	w32.IntersectRect(&re.rect, &re.rect, &src.rect)
}

func (re *Rect) IsEmpty() bool {
	return w32.IsRectEmpty(&re.rect)
}

func (re *Rect) Offset(x, y int) {
	w32.OffsetRect(&re.rect, x, y)
}

func (re *Rect) IsPointIn(x, y int) bool {
	return w32.PtInRect(&re.rect, x, y)
}

func (re *Rect) Substract(src *Rect) {
	w32.SubtractRect(&re.rect, &re.rect, &src.rect)
}

func (re *Rect) Union(src *Rect) {
	w32.UnionRect(&re.rect, &re.rect, &src.rect)
}


================================================
FILE: resizer.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 */

package winc

import (
	"github.com/tadvi/winc/w32"
)

type VResizer struct {
	ControlBase

	control1 Dockable
	control2 Dockable
	dir      Direction

	mouseLeft bool
	drag      bool
}

func NewVResizer(parent Controller) *VResizer {
	sp := new(VResizer)

	RegClassOnlyOnce("winc_VResizer")
	sp.hwnd = CreateWindow("winc_VResizer", parent, w32.WS_EX_CONTROLPARENT, w32.WS_CHILD|w32.WS_VISIBLE)
	sp.parent = parent
	sp.mouseLeft = true
	RegMsgHandler(sp)

	sp.SetFont(DefaultFont)
	sp.SetText("")
	sp.SetSize(20, 100)
	return sp
}

func (sp *VResizer) SetControl(control1, control2 Dockable, dir Direction, minSize int) {
	sp.control1 = control1
	sp.control2 = control2
	if dir != Left && dir != Right {
		panic("invalid direction")
	}
	sp.dir = dir

	// TODO(vi): ADDED
	/*internalTrackMouseEvent(control1.Handle())
	internalTrackMouseEvent(control2.Handle())

	control1.OnMouseMove().Bind(func(e *Event) {
		if sp.drag {
			x := e.Data.(*MouseEventData).X
			sp.update(x)
			w32.SetCursor(w32.LoadCursor(0, w32.MakeIntResource(w32.IDC_SIZEWE)))

		}
		fmt.Println("control1.OnMouseMove")
	})

	control2.OnMouseMove().Bind(func(e *Event) {
		if sp.drag {
			x := e.Data.(*MouseEventData).X
			sp.update(x)
			w32.SetCursor(w32.LoadCursor(0, w32.MakeIntResource(w32.IDC_SIZEWE)))

		}
		fmt.Println("control2.OnMouseMove")
	})

	control1.OnLBUp().Bind(func(e *Event) {
		sp.drag = false
		sp.mouseLeft = true
		fmt.Println("control1.OnLBUp")
	})

	control2.OnLBUp().Bind(func(e *Event) {
		sp.drag = false
		sp.mouseLeft = true
		fmt.Println("control2.OnLBUp")
	})*/

	// ---- finish ADDED

}

func (sp *VResizer) update(x int) {
	pos := x - 10

	w1, h1 := sp.control1.Width(), sp.control1.Height()
	if sp.dir == Left {
		w1 += pos
	} else {
		w1 -= pos
	}
	sp.control1.SetSize(w1, h1)
	fm := sp.parent.(*Form)
	fm.UpdateLayout()

	w32.SetCursor(w32.LoadCursor(0, w32.MakeIntResource(w32.IDC_ARROW)))
}

func (sp *VResizer) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_CREATE:
		internalTrackMouseEvent(sp.hwnd)

	case w32.WM_MOUSEMOVE:
		if sp.drag {
			x, _ := genPoint(lparam)
			sp.update(x)
		} else {
			w32.SetCursor(w32.LoadCursor(0, w32.MakeIntResource(w32.IDC_SIZEWE)))
		}

		if sp.mouseLeft {
			internalTrackMouseEvent(sp.hwnd)
			sp.mouseLeft = false
		}

	case w32.WM_MOUSELEAVE:
		sp.drag = false
		sp.mouseLeft = true

	case w32.WM_LBUTTONUP:
		sp.drag = false

	case w32.WM_LBUTTONDOWN:
		sp.drag = true
	}
	return w32.DefWindowProc(sp.hwnd, msg, wparam, lparam)
}

type HResizer struct {
	ControlBase

	control1  Dockable
	control2  Dockable
	dir       Direction
	mouseLeft bool
	drag      bool
}

func NewHResizer(parent Controller) *HResizer {
	sp := new(HResizer)

	RegClassOnlyOnce("winc_HResizer")
	sp.hwnd = CreateWindow("winc_HResizer", parent, w32.WS_EX_CONTROLPARENT, w32.WS_CHILD|w32.WS_VISIBLE)
	sp.parent = parent
	sp.mouseLeft = true
	RegMsgHandler(sp)

	sp.SetFont(DefaultFont)
	sp.SetText("")
	sp.SetSize(100, 20)

	return sp
}

func (sp *HResizer) SetControl(control1, control2 Dockable, dir Direction, minSize int) {
	sp.control1 = control1
	sp.control2 = control2
	if dir != Top && dir != Bottom {
		panic("invalid direction")
	}
	sp.dir = dir

}

func (sp *HResizer) update(y int) {
	pos := y - 10

	w1, h1 := sp.control1.Width(), sp.control1.Height()
	if sp.dir == Top {
		h1 += pos
	} else {
		h1 -= pos
	}
	sp.control1.SetSize(w1, h1)

	fm := sp.parent.(*Form)
	fm.UpdateLayout()

	w32.SetCursor(w32.LoadCursor(0, w32.MakeIntResource(w32.IDC_ARROW)))
}

func (sp *HResizer) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_CREATE:
		internalTrackMouseEvent(sp.hwnd)

	case w32.WM_MOUSEMOVE:
		if sp.drag {
			_, y := genPoint(lparam)
			sp.update(y)
		} else {
			w32.SetCursor(w32.LoadCursor(0, w32.MakeIntResource(w32.IDC_SIZENS)))
		}

		if sp.mouseLeft {
			internalTrackMouseEvent(sp.hwnd)
			sp.mouseLeft = false
		}

	case w32.WM_MOUSELEAVE:
		sp.drag = false
		sp.mouseLeft = true

	case w32.WM_LBUTTONUP:
		sp.drag = false

	case w32.WM_LBUTTONDOWN:
		sp.drag = true
	}
	return w32.DefWindowProc(sp.hwnd, msg, wparam, lparam)
}


================================================
FILE: scrollview.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 */

package winc

import (
	"unsafe"

	"github.com/tadvi/winc/w32"
)

type ScrollView struct {
	ControlBase
	child Dockable
}

func NewScrollView(parent Controller) *ScrollView {
	sv := new(ScrollView)

	RegClassOnlyOnce("winc_ScrollView")
	sv.hwnd = CreateWindow("winc_ScrollView", parent, w32.WS_EX_CONTROLPARENT,
		w32.WS_CHILD|w32.WS_HSCROLL|w32.WS_VISIBLE|w32.WS_VSCROLL)
	sv.parent = parent
	RegMsgHandler(sv)

	sv.SetFont(DefaultFont)
	sv.SetText("")
	sv.SetSize(200, 200)
	return sv
}

func (sv *ScrollView) SetChild(child Dockable) {
	sv.child = child
}

func (sv *ScrollView) UpdateScrollBars() {
	w, h := sv.child.Width(), sv.child.Height()
	sw, sh := sv.Size()

	var si w32.SCROLLINFO
	si.CbSize = uint32(unsafe.Sizeof(si))
	si.FMask = w32.SIF_PAGE | w32.SIF_RANGE

	si.NMax = int32(w - 1)
	si.NPage = uint32(sw)
	w32.SetScrollInfo(sv.hwnd, w32.SB_HORZ, &si, true)
	x := sv.scroll(w32.SB_HORZ, w32.SB_THUMBPOSITION)

	si.NMax = int32(h)
	si.NPage = uint32(sh)
	w32.SetScrollInfo(sv.hwnd, w32.SB_VERT, &si, true)
	y := sv.scroll(w32.SB_VERT, w32.SB_THUMBPOSITION)

	sv.child.SetPos(x, y)
}

func (sv *ScrollView) scroll(sb int32, cmd uint16) int {
	var pos int32
	var si w32.SCROLLINFO
	si.CbSize = uint32(unsafe.Sizeof(si))
	si.FMask = w32.SIF_PAGE | w32.SIF_POS | w32.SIF_RANGE | w32.SIF_TRACKPOS

	w32.GetScrollInfo(sv.hwnd, sb, &si)
	pos = si.NPos

	switch cmd {
	case w32.SB_LINELEFT: // == win.SB_LINEUP
		pos -= 20

	case w32.SB_LINERIGHT: // == win.SB_LINEDOWN
		pos += 20

	case w32.SB_PAGELEFT: // == win.SB_PAGEUP
		pos -= int32(si.NPage)

	case w32.SB_PAGERIGHT: // == win.SB_PAGEDOWN
		pos += int32(si.NPage)

	case w32.SB_THUMBTRACK:
		pos = si.NTrackPos
	}

	if pos < 0 {
		pos = 0
	}
	if pos > si.NMax+1-int32(si.NPage) {
		pos = si.NMax + 1 - int32(si.NPage)
	}

	si.FMask = w32.SIF_POS
	si.NPos = pos
	w32.SetScrollInfo(sv.hwnd, sb, &si, true)

	return -int(pos)
}

func (sv *ScrollView) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	if sv.child != nil {
		switch msg {
		case w32.WM_PAINT:
			sv.UpdateScrollBars()

		case w32.WM_HSCROLL:
			x, y := sv.child.Pos()
			x = sv.scroll(w32.SB_HORZ, w32.LOWORD(uint32(wparam)))
			sv.child.SetPos(x, y)

		case w32.WM_VSCROLL:
			x, y := sv.child.Pos()
			y = sv.scroll(w32.SB_VERT, w32.LOWORD(uint32(wparam)))
			sv.child.SetPos(x, y)

		case w32.WM_SIZE, w32.WM_SIZING:
			sv.UpdateScrollBars()
		}
	}
	return w32.DefWindowProc(sv.hwnd, msg, wparam, lparam)
}


================================================
FILE: slider.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 */

package winc

import "github.com/tadvi/winc/w32"

type Slider struct {
	ControlBase
	prevPos int

	onScroll EventManager
}

func NewSlider(parent Controller) *Slider {
	tb := new(Slider)

	tb.InitControl("msctls_trackbar32", parent, 0, w32.WS_TABSTOP|w32.WS_VISIBLE|w32.WS_CHILD /*|w32.TBS_AUTOTICKS*/)
	RegMsgHandler(tb)

	tb.SetFont(DefaultFont)
	tb.SetText("Slider")
	tb.SetSize(200, 32)

	tb.SetRange(0, 100)
	tb.SetPage(10)
	return tb
}

func (tb *Slider) OnScroll() *EventManager {
	return &tb.onScroll
}

func (tb *Slider) Value() int {
	ret := w32.SendMessage(tb.hwnd, w32.TBM_GETPOS, 0, 0)
	return int(ret)
}

func (tb *Slider) SetValue(v int) {
	tb.prevPos = v
	w32.SendMessage(tb.hwnd, w32.TBM_SETPOS, uintptr(w32.BoolToBOOL(true)), uintptr(v))
}

func (tb *Slider) Range() (min, max int) {
	min = int(w32.SendMessage(tb.hwnd, w32.TBM_GETRANGEMIN, 0, 0))
	max = int(w32.SendMessage(tb.hwnd, w32.TBM_GETRANGEMAX, 0, 0))
	return min, max
}

func (tb *Slider) SetRange(min, max int) {
	w32.SendMessage(tb.hwnd, w32.TBM_SETRANGE, uintptr(w32.BoolToBOOL(true)), uintptr(w32.MAKELONG(uint16(min), uint16(max))))
}

func (tb *Slider) SetPage(pagesize int) {
	w32.SendMessage(tb.hwnd, w32.TBM_SETPAGESIZE, 0, uintptr(pagesize))
}

func (tb *Slider) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	/*
		// REMOVE:
		// following code did not work, used workaround below
		code := w32.LOWORD(uint32(wparam))

		switch code {
		case w32.TB_ENDTRACK:
			tb.onScroll.Fire(NewEvent(tb, nil))
		}*/

	newPos := tb.Value()
	if newPos != tb.prevPos {
		tb.onScroll.Fire(NewEvent(tb, nil))
		tb.prevPos = newPos
	}

	return w32.DefWindowProc(tb.hwnd, msg, wparam, lparam)
}


================================================
FILE: tabview.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 */

package winc

import (
	"syscall"
	"unsafe"

	"github.com/tadvi/winc/w32"
)

// TabView creates MultiPanel internally and manages tabs as panels.
type TabView struct {
	ControlBase

	panels           *MultiPanel
	onSelectedChange EventManager
}

func NewTabView(parent Controller) *TabView {
	tv := new(TabView)

	tv.InitControl("SysTabControl32", parent, 0,
		w32.WS_CHILD|w32.WS_VISIBLE|w32.WS_TABSTOP|w32.WS_CLIPSIBLINGS)
	RegMsgHandler(tv)

	tv.panels = NewMultiPanel(parent)

	tv.SetFont(DefaultFont)
	tv.SetSize(200, 24)
	return tv
}

func (tv *TabView) Panels() *MultiPanel {
	return tv.panels
}

func (tv *TabView) tcitemFromPage(panel *Panel) *w32.TCITEM {
	text := syscall.StringToUTF16(panel.Text())
	item := &w32.TCITEM{
		Mask:       w32.TCIF_TEXT,
		PszText:    &text[0],
		CchTextMax: int32(len(text)),
	}
	return item
}

func (tv *TabView) AddPanel(text string) *Panel {
	panel := NewPanel(tv.panels)
	panel.SetText(text)

	item := tv.tcitemFromPage(panel)
	index := tv.panels.Count()
	idx := int(w32.SendMessage(tv.hwnd, w32.TCM_INSERTITEM, uintptr(index), uintptr(unsafe.Pointer(item))))
	if idx == -1 {
		panic("SendMessage(TCM_INSERTITEM) failed")
	}

	tv.panels.AddPanel(panel)
	tv.SetCurrent(idx)
	return panel
}

func (tv *TabView) DeletePanel(index int) {
	w32.SendMessage(tv.hwnd, w32.TCM_DELETEITEM, uintptr(index), 0)
	tv.panels.DeletePanel(index)
	switch {
	case tv.panels.Count() > index:
		tv.SetCurrent(index)
	case tv.panels.Count() == 0:
		tv.SetCurrent(0)
	}
}

func (tv *TabView) Current() int {
	return tv.panels.Current()
}

func (tv *TabView) SetCurrent(index int) {
	if index < 0 || index >= tv.panels.Count() {
		panic("invalid index")
	}
	if ret := int(w32.SendMessage(tv.hwnd, w32.TCM_SETCURSEL, uintptr(index), 0)); ret == -1 {
		panic("SendMessage(TCM_SETCURSEL) failed")
	}
	tv.panels.SetCurrent(index)
}

func (tv *TabView) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_NOTIFY:
		nmhdr := (*w32.NMHDR)(unsafe.Pointer(lparam))

		switch int32(nmhdr.Code) {
		case w32.TCN_SELCHANGE:
			cur := int(w32.SendMessage(tv.hwnd, w32.TCM_GETCURSEL, 0, 0))
			tv.SetCurrent(cur)

			tv.onSelectedChange.Fire(NewEvent(tv, nil))
		}
	}
	return w32.DefWindowProc(tv.hwnd, msg, wparam, lparam)
}


================================================
FILE: toolbar.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 */

package winc

import (
	"syscall"
	"unsafe"

	"github.com/tadvi/winc/w32"
)

type Toolbar struct {
	ControlBase
	iml *ImageList

	buttons []*ToolButton
}

type ToolButton struct {
	tb *Toolbar

	text      string
	enabled   bool
	checkable bool
	checked   bool
	image     int

	onClick EventManager
}

func (bt *ToolButton) OnClick() *EventManager {
	return &bt.onClick
}

func (bt *ToolButton) update() { bt.tb.update(bt) }

func (bt *ToolButton) IsSeparator() bool { return bt.text == "-" }
func (bt *ToolButton) SetSeparator()     { bt.text = "-" }

func (bt *ToolButton) Enabled() bool     { return bt.enabled }
func (bt *ToolButton) SetEnabled(b bool) { bt.enabled = b; bt.update() }

func (bt *ToolButton) Checkable() bool     { return bt.checkable }
func (bt *ToolButton) SetCheckable(b bool) { bt.checkable = b; bt.update() }

func (bt *ToolButton) Checked() bool     { return bt.checked }
func (bt *ToolButton) SetChecked(b bool) { bt.checked = b; bt.update() }

func (bt *ToolButton) Text() string     { return bt.text }
func (bt *ToolButton) SetText(s string) { bt.text = s; bt.update() }

func (bt *ToolButton) Image() int     { return bt.image }
func (bt *ToolButton) SetImage(i int) { bt.image = i; bt.update() }

// NewHToolbar creates horizontal toolbar with text on same line as image.
func NewHToolbar(parent Controller) *Toolbar {
	return newToolbar(parent, w32.CCS_NODIVIDER|w32.TBSTYLE_FLAT|w32.TBSTYLE_TOOLTIPS|w32.TBSTYLE_WRAPABLE|
		w32.WS_CHILD|w32.TBSTYLE_LIST)
}

// NewToolbar creates toolbar with text below the image.
func NewToolbar(parent Controller) *Toolbar {
	return newToolbar(parent, w32.CCS_NODIVIDER|w32.TBSTYLE_FLAT|w32.TBSTYLE_TOOLTIPS|w32.TBSTYLE_WRAPABLE|
		w32.WS_CHILD /*|w32.TBSTYLE_TRANSPARENT*/)
}

func newToolbar(parent Controller, style uint) *Toolbar {
	tb := new(Toolbar)

	tb.InitControl("ToolbarWindow32", parent, 0, style)

	exStyle := w32.SendMessage(tb.hwnd, w32.TB_GETEXTENDEDSTYLE, 0, 0)
	exStyle |= w32.TBSTYLE_EX_DRAWDDARROWS | w32.TBSTYLE_EX_MIXEDBUTTONS
	w32.SendMessage(tb.hwnd, w32.TB_SETEXTENDEDSTYLE, 0, exStyle)
	RegMsgHandler(tb)

	tb.SetFont(DefaultFont)
	tb.SetPos(0, 0)
	tb.SetSize(200, 40)

	return tb
}

func (tb *Toolbar) SetImageList(imageList *ImageList) {
	w32.SendMessage(tb.hwnd, w32.TB_SETIMAGELIST, 0, uintptr(imageList.Handle()))
	tb.iml = imageList
}

func (tb *Toolbar) initButton(btn *ToolButton, state, style *byte, image *int32, text *uintptr) {
	*style |= w32.BTNS_AUTOSIZE

	if btn.checked {
		*state |= w32.TBSTATE_CHECKED
	}

	if btn.enabled {
		*state |= w32.TBSTATE_ENABLED
	}

	if btn.checkable {
		*style |= w32.BTNS_CHECK
	}

	if len(btn.Text()) > 0 {
		*style |= w32.BTNS_SHOWTEXT
	}

	if btn.IsSeparator() {
		*style = w32.BTNS_SEP
	}

	*image = int32(btn.Image())
	*text = uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(btn.Text())))
}

func (tb *Toolbar) update(btn *ToolButton) {
	tbbi := w32.TBBUTTONINFO{
		DwMask: w32.TBIF_IMAGE | w32.TBIF_STATE | w32.TBIF_STYLE | w32.TBIF_TEXT,
	}

	tbbi.CbSize = uint32(unsafe.Sizeof(tbbi))

	var i int
	for i = range tb.buttons {
		if tb.buttons[i] == btn {
			break
		}
	}

	tb.initButton(btn, &tbbi.FsState, &tbbi.FsStyle, &tbbi.IImage, &tbbi.PszText)
	if w32.SendMessage(tb.hwnd, w32.TB_SETBUTTONINFO, uintptr(i), uintptr(unsafe.Pointer(&tbbi))) == 0 {
		panic("SendMessage(TB_SETBUTTONINFO) failed")
	}
}

func (tb *Toolbar) AddSeparator() {
	tb.AddButton("-", 0)
}

// AddButton creates and adds button to the toolbar. Use returned toolbutton to setup OnClick event.
func (tb *Toolbar) AddButton(text string, image int) *ToolButton {
	bt := &ToolButton{
		tb:      tb, // points to parent
		text:    text,
		image:   image,
		enabled: true,
	}
	tb.buttons = append(tb.buttons, bt)
	index := len(tb.buttons) - 1

	tbb := w32.TBBUTTON{
		IdCommand: int32(index),
	}

	tb.initButton(bt, &tbb.FsState, &tbb.FsStyle, &tbb.IBitmap, &tbb.IString)
	w32.SendMessage(tb.hwnd, w32.TB_BUTTONSTRUCTSIZE, uintptr(unsafe.Sizeof(tbb)), 0)

	if w32.SendMessage(tb.hwnd, w32.TB_INSERTBUTTON, uintptr(index), uintptr(unsafe.Pointer(&tbb))) == w32.FALSE {
		panic("SendMessage(TB_ADDBUTTONS)")
	}

	w32.SendMessage(tb.hwnd, w32.TB_AUTOSIZE, 0, 0)
	return bt
}

func (tb *Toolbar) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_COMMAND:
		switch w32.HIWORD(uint32(wparam)) {
		case w32.BN_CLICKED:
			id := uint16(w32.LOWORD(uint32(wparam)))
			btn := tb.buttons[id]
			btn.onClick.Fire(NewEvent(tb, nil))
		}
	}
	return w32.DefWindowProc(tb.hwnd, msg, wparam, lparam)
}


================================================
FILE: tooltip.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"syscall"
	"unsafe"

	"github.com/tadvi/winc/w32"
)

type ToolTip struct {
	ControlBase
}

func NewToolTip(parent Controller) *ToolTip {
	tp := new(ToolTip)

	tp.InitControl("tooltips_class32", parent, w32.WS_EX_TOPMOST, w32.WS_POPUP|w32.TTS_NOPREFIX|w32.TTS_ALWAYSTIP)
	w32.SetWindowPos(tp.Handle(), w32.HWND_TOPMOST, 0, 0, 0, 0, w32.SWP_NOMOVE|w32.SWP_NOSIZE|w32.SWP_NOACTIVATE)

	return tp
}

func (tp *ToolTip) SetTip(tool Controller, tip string) bool {
	var ti w32.TOOLINFO
	ti.CbSize = uint32(unsafe.Sizeof(ti))
	if tool.Parent() != nil {
		ti.Hwnd = tool.Parent().Handle()
	}
	ti.UFlags = w32.TTF_IDISHWND | w32.TTF_SUBCLASS /* | TTF_ABSOLUTE */
	ti.UId = uintptr(tool.Handle())
	ti.LpszText = syscall.StringToUTF16Ptr(tip)

	return w32.SendMessage(tp.Handle(), w32.TTM_ADDTOOL, 0, uintptr(unsafe.Pointer(&ti))) != w32.FALSE
}

func (tp *ToolTip) WndProc(msg uint, wparam, lparam uintptr) uintptr {
	return w32.DefWindowProc(tp.hwnd, uint32(msg), wparam, lparam)
}


================================================
FILE: treeview.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 */

package winc

import (
	"errors"
	"syscall"
	"unsafe"

	"github.com/tadvi/winc/w32"
)

// TreeItem represents an item in a TreeView widget.
type TreeItem interface {
	Text() string    // Text returns the text of the item.
	ImageIndex() int // ImageIndex is used only if SetImageList is called on the treeview
}

type treeViewItemInfo struct {
	handle       w32.HTREEITEM
	child2Handle map[TreeItem]w32.HTREEITEM
}

// StringTreeItem is helper for basic string lists.
type StringTreeItem struct {
	Data  string
	Image int
}

func (s StringTreeItem) Text() string    { return s.Data }
func (s StringTreeItem) ImageIndex() int { return s.Image }

type TreeView struct {
	ControlBase

	iml         *ImageList
	item2Info   map[TreeItem]*treeViewItemInfo
	handle2Item map[w32.HTREEITEM]TreeItem
	currItem    TreeItem

	onSelectedChange EventManager
	onExpand         EventManager
	onCollapse       EventManager
	onViewChange     EventManager
}

func NewTreeView(parent Controller) *TreeView {
	tv := new(TreeView)

	tv.InitControl("SysTreeView32", parent, 0, w32.WS_CHILD|w32.WS_VISIBLE|
		w32.WS_BORDER|w32.TVS_HASBUTTONS|w32.TVS_LINESATROOT|w32.TVS_SHOWSELALWAYS|
		w32.TVS_TRACKSELECT /*|w32.WS_EX_CLIENTEDGE*/)

	tv.item2Info = make(map[TreeItem]*treeViewItemInfo)
	tv.handle2Item = make(map[w32.HTREEITEM]TreeItem)

	RegMsgHandler(tv)

	tv.SetFont(DefaultFont)
	tv.SetSize(200, 400)

	if err := tv.SetTheme("Explorer"); err != nil {
		// theme error is ignored
	}
	return tv
}

func (tv *TreeView) EnableDoubleBuffer(enable bool) {
	if enable {
		w32.SendMessage(tv.hwnd, w32.TVM_SETEXTENDEDSTYLE, 0, w32.TVS_EX_DOUBLEBUFFER)
	} else {
		w32.SendMessage(tv.hwnd, w32.TVM_SETEXTENDEDSTYLE, w32.TVS_EX_DOUBLEBUFFER, 0)
	}
}

// SelectedItem is current selected item after OnSelectedChange event.
func (tv *TreeView) SelectedItem() TreeItem {
	return tv.currItem
}

func (tv *TreeView) SetSelectedItem(item TreeItem) bool {
	var handle w32.HTREEITEM
	if item != nil {
		if info := tv.item2Info[item]; info == nil {
			return false // invalid item
		} else {
			handle = info.handle
		}
	}

	if w32.SendMessage(tv.hwnd, w32.TVM_SELECTITEM, w32.TVGN_CARET, uintptr(handle)) == 0 {
		return false // set selected failed
	}
	tv.currItem = item
	return true
}

func (tv *TreeView) ItemAt(x, y int) TreeItem {
	hti := w32.TVHITTESTINFO{Pt: w32.POINT{int32(x), int32(y)}}
	w32.SendMessage(tv.hwnd, w32.TVM_HITTEST, 0, uintptr(unsafe.Pointer(&hti)))
	if item, ok := tv.handle2Item[hti.HItem]; ok {
		return item
	}
	return nil
}

func (tv *TreeView) Items() (list []TreeItem) {
	for item := range tv.item2Info {
		list = append(list, item)
	}
	return list
}

func (tv *TreeView) InsertItem(item, parent, insertAfter TreeItem) error {
	var tvins w32.TVINSERTSTRUCT
	tvi := &tvins.Item

	tvi.Mask = w32.TVIF_TEXT                                                     // w32.TVIF_CHILDREN | w32.TVIF_TEXT
	tvi.PszText = uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(item.Text()))) // w32.LPSTR_TEXTCALLBACK
	tvi.CChildren = 0                                                            // w32.I_CHILDRENCALLBACK

	if parent == nil {
		tvins.HParent = w32.TVI_ROOT
	} else {
		info := tv.item2Info[parent]
		if info == nil {
			return errors.New("winc: invalid parent")
		}
		tvins.HParent = info.handle
	}

	if insertAfter == nil {
		tvins.HInsertAfter = w32.TVI_LAST
	} else {
		info := tv.item2Info[insertAfter]
		if info == nil {
			return errors.New("winc: invalid prev item")
		}
		tvins.HInsertAfter = info.handle
	}

	tv.applyImage(tvi, item)

	hItem := w32.HTREEITEM(w32.SendMessage(tv.hwnd, w32.TVM_INSERTITEM, 0, uintptr(unsafe.Pointer(&tvins))))
	if hItem == 0 {
		return errors.New("winc: TVM_INSERTITEM failed")
	}
	tv.item2Info[item] = &treeViewItemInfo{hItem, make(map[TreeItem]w32.HTREEITEM)}
	tv.handle2Item[hItem] = item
	return nil
}

func (tv *TreeView) UpdateItem(item TreeItem) bool {
	it := tv.item2Info[item]
	if it == nil {
		return false
	}

	tvi := &w32.TVITEM{
		Mask:    w32.TVIF_TEXT,
		HItem:   it.handle,
		PszText: uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(item.Text()))),
	}
	tv.applyImage(tvi, item)

	if w32.SendMessage(tv.hwnd, w32.TVM_SETITEM, 0, uintptr(unsafe.Pointer(tvi))) == 0 {
		return false
	}
	return true
}

func (tv *TreeView) DeleteItem(item TreeItem) bool {
	it := tv.item2Info[item]
	if it == nil {
		return false
	}

	if w32.SendMessage(tv.hwnd, w32.TVM_DELETEITEM, 0, uintptr(it.handle)) == 0 {
		return false
	}

	delete(tv.item2Info, item)
	delete(tv.handle2Item, it.handle)
	return true
}

func (tv *TreeView) DeleteAllItems() bool {
	if w32.SendMessage(tv.hwnd, w32.TVM_DELETEITEM, 0, 0) == 0 {
		return false
	}

	tv.item2Info = make(map[TreeItem]*treeViewItemInfo)
	tv.handle2Item = make(map[w32.HTREEITEM]TreeItem)
	return true
}

func (tv *TreeView) Expand(item TreeItem) bool {
	if w32.SendMessage(tv.hwnd, w32.TVM_EXPAND, w32.TVE_EXPAND, uintptr(tv.item2Info[item].handle)) == 0 {
		return false
	}
	return true
}

func (tv *TreeView) Collapse(item TreeItem) bool {
	if w32.SendMessage(tv.hwnd, w32.TVM_EXPAND, w32.TVE_COLLAPSE, uintptr(tv.item2Info[item].handle)) == 0 {
		return false
	}
	return true
}

func (tv *TreeView) EnsureVisible(item TreeItem) bool {
	if info := tv.item2Info[item]; info != nil {
		return w32.SendMessage(tv.hwnd, w32.TVM_ENSUREVISIBLE, 0, uintptr(info.handle)) != 0
	}
	return false
}

func (tv *TreeView) SetImageList(imageList *ImageList) {
	w32.SendMessage(tv.hwnd, w32.TVM_SETIMAGELIST, 0, uintptr(imageList.Handle()))
	tv.iml = imageList
}

func (tv *TreeView) applyImage(tc *w32.TVITEM, item TreeItem) {
	if tv.iml != nil {
		tc.Mask |= w32.TVIF_IMAGE | w32.TVIF_SELECTEDIMAGE
		tc.IImage = int32(item.ImageIndex())
		tc.ISelectedImage = int32(item.ImageIndex())
	}
}

func (tv *TreeView) OnSelectedChange() *EventManager {
	return &tv.onSelectedChange
}

func (tv *TreeView) OnExpand() *EventManager {
	return &tv.onExpand
}

func (tv *TreeView) OnCollapse() *EventManager {
	return &tv.onCollapse
}

func (tv *TreeView) OnViewChange() *EventManager {
	return &tv.onViewChange
}

// Message processer
func (tv *TreeView) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
	switch msg {
	case w32.WM_NOTIFY:
		nm := (*w32.NMHDR)(unsafe.Pointer(lparam))

		switch nm.Code {
		case w32.TVN_ITEMEXPANDED:
			nmtv := (*w32.NMTREEVIEW)(unsafe.Pointer(lparam))

			switch nmtv.Action {
			case w32.TVE_COLLAPSE:
				tv.onCollapse.Fire(NewEvent(tv, nil))

			case w32.TVE_COLLAPSERESET:

			case w32.TVE_EXPAND:
				tv.onExpand.Fire(NewEvent(tv, nil))

			case w32.TVE_EXPANDPARTIAL:

			case w32.TVE_TOGGLE:
			}

		case w32.TVN_SELCHANGED:
			nmtv := (*w32.NMTREEVIEW)(unsafe.Pointer(lparam))
			tv.currItem = tv.handle2Item[nmtv.ItemNew.HItem]
			tv.onSelectedChange.Fire(NewEvent(tv, nil))

		case w32.TVN_GETDISPINFO:
			tv.onViewChange.Fire(NewEvent(tv, nil))
		}

	}
	return w32.DefWindowProc(tv.hwnd, msg, wparam, lparam)
}


================================================
FILE: utils.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2013 Allen Dang. All Rights Reserved.
 */

package winc

import (
	"fmt"
	"syscall"
	"unsafe"

	"github.com/tadvi/winc/w32"
)

func internalTrackMouseEvent(hwnd w32.HWND) {
	var tme w32.TRACKMOUSEEVENT
	tme.CbSize = uint32(unsafe.Sizeof(tme))
	tme.DwFlags = w32.TME_LEAVE
	tme.HwndTrack = hwnd
	tme.DwHoverTime = w32.HOVER_DEFAULT

	w32.TrackMouseEvent(&tme)
}

func ToggleStyle(hwnd w32.HWND, b bool, style int) {
	originalStyle := int(w32.GetWindowLongPtr(hwnd, w32.GWL_STYLE))
	if originalStyle != 0 {
		if b {
			originalStyle |= style
		} else {
			originalStyle ^= style
		}
		w32.SetWindowLongPtr(hwnd, w32.GWL_STYLE, uintptr(originalStyle))
	}
}

func ToggleExStyle(hwnd w32.HWND, b bool, style int) {
	originalStyle := int(w32.GetWindowLongPtr(hwnd, w32.GWL_EXSTYLE))
	if originalStyle != 0 {
		if b {
			originalStyle |= style
		} else {
			originalStyle ^= style
		}
		w32.SetWindowLongPtr(hwnd, w32.GWL_EXSTYLE, uintptr(originalStyle))
	}
}

func CreateWindow(className string, parent Controller, exStyle, style uint) w32.HWND {
	instance := GetAppInstance()
	var parentHwnd w32.HWND
	if parent != nil {
		parentHwnd = parent.Handle()
	}
	var hwnd w32.HWND
	hwnd = w32.CreateWindowEx(
		exStyle,
		syscall.StringToUTF16Ptr(className),
		nil,
		style,
		w32.CW_USEDEFAULT,
		w32.CW_USEDEFAULT,
		w32.CW_USEDEFAULT,
		w32.CW_USEDEFAULT,
		parentHwnd,
		0,
		instance,
		nil)

	if hwnd == 0 {
		errStr := fmt.Sprintf("Error occurred in CreateWindow(%s, %v, %d, %d)", className, parent, exStyle, style)
		panic(errStr)
	}

	return hwnd
}

func RegisterClass(className string, wndproc uintptr) {
	instance := GetAppInstance()
	icon := w32.LoadIcon(instance, w32.MakeIntResource(w32.IDI_APPLICATION))

	var wc w32.WNDCLASSEX
	wc.Size = uint32(unsafe.Sizeof(wc))
	wc.Style = w32.CS_HREDRAW | w32.CS_VREDRAW
	wc.WndProc = wndproc
	wc.Instance = instance
	wc.Background = w32.COLOR_BTNFACE + 1
	wc.Icon = icon
	wc.Cursor = w32.LoadCursor(0, w32.MakeIntResource(w32.IDC_ARROW))
	wc.ClassName = syscall.StringToUTF16Ptr(className)
	wc.MenuName = nil
	wc.IconSm = icon

	if ret := w32.RegisterClassEx(&wc); ret == 0 {
		panic(syscall.GetLastError())
	}
}

func getMonitorInfo(hwnd w32.HWND) *w32.MONITORINFO {
	currentMonitor := w32.MonitorFromWindow(hwnd, w32.MONITOR_DEFAULTTONEAREST)
	var info w32.MONITORINFO
	info.CbSize = uint32(unsafe.Sizeof(info))
	w32.GetMonitorInfo(currentMonitor, &info)
	return &info
}
func getWindowInfo(hwnd w32.HWND) *w32.WINDOWINFO {
	var info w32.WINDOWINFO
	info.CbSize = uint32(unsafe.Sizeof(info))
	w32.GetWindowInfo(hwnd, &info)
	return &info
}

func RegClassOnlyOnce(className string) {
	isExists := false
	for _, class := range gRegisteredClasses {
		if class == className {
			isExists = true
			break
		}
	}

	if !isExists {
		RegisterClass(className, GeneralWndprocCallBack)
		gRegisteredClasses = append(gRegisteredClasses, className)
	}
}

func ScreenToClientRect(hwnd w32.HWND, rect *w32.RECT) *Rect {
	l, t, r, b := rect.Left, rect.Top, rect.Right, rect.Bottom
	l1, t1, _ := w32.ScreenToClient(hwnd, int(l), int(t))
	r1, b1, _ := w32.ScreenToClient(hwnd, int(r), int(b))
	return NewRect(l1, t1, r1, b1)
}


================================================
FILE: w32/comctl32.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2012 The W32 Authors. All Rights Reserved.
 */

package w32

import (
	"syscall"
	"unsafe"
)

var (
	modcomctl32 = syscall.NewLazyDLL("comctl32.dll")

	procInitCommonControlsEx    = modcomctl32.NewProc("InitCommonControlsEx")
	procImageList_Create        = modcomctl32.NewProc("ImageList_Create")
	procImageList_Destroy       = modcomctl32.NewProc("ImageList_Destroy")
	procImageList_GetImageCount = modcomctl32.NewProc("ImageList_GetImageCount")
	procImageList_SetImageCount = modcomctl32.NewProc("ImageList_SetImageCount")
	procImageList_Add           = modcomctl32.NewProc("ImageList_Add")
	procImageList_ReplaceIcon   = modcomctl32.NewProc("ImageList_ReplaceIcon")
	procImageList_Remove        = modcomctl32.NewProc("ImageList_Remove")
	procTrackMouseEvent         = modcomctl32.NewProc("_TrackMouseEvent")
)

func InitCommonControlsEx(lpInitCtrls *INITCOMMONCONTROLSEX) bool {
	ret, _, _ := procInitCommonControlsEx.Call(
		uintptr(unsafe.Pointer(lpInitCtrls)))

	return ret != 0
}

func ImageList_Create(cx, cy int, flags uint, cInitial, cGrow int) HIMAGELIST {
	ret, _, _ := procImageList_Create.Call(
		uintptr(cx),
		uintptr(cy),
		uintptr(flags),
		uintptr(cInitial),
		uintptr(cGrow))

	if ret == 0 {
		panic("Create image list failed")
	}

	return HIMAGELIST(ret)
}

func ImageList_Destroy(himl HIMAGELIST) bool {
	ret, _, _ := procImageList_Destroy.Call(
		uintptr(himl))

	return ret != 0
}

func ImageList_GetImageCount(himl HIMAGELIST) int {
	ret, _, _ := procImageList_GetImageCount.Call(
		uintptr(himl))

	return int(ret)
}

func ImageList_SetImageCount(himl HIMAGELIST, uNewCount uint) bool {
	ret, _, _ := procImageList_SetImageCount.Call(
		uintptr(himl),
		uintptr(uNewCount))

	return ret != 0
}

func ImageList_Add(himl HIMAGELIST, hbmImage, hbmMask HBITMAP) int {
	ret, _, _ := procImageList_Add.Call(
		uintptr(himl),
		uintptr(hbmImage),
		uintptr(hbmMask))

	return int(ret)
}

func ImageList_ReplaceIcon(himl HIMAGELIST, i int, hicon HICON) int {
	ret, _, _ := procImageList_ReplaceIcon.Call(
		uintptr(himl),
		uintptr(i),
		uintptr(hicon))

	return int(ret)
}

func ImageList_AddIcon(himl HIMAGELIST, hicon HICON) int {
	return ImageList_ReplaceIcon(himl, -1, hicon)
}

func ImageList_Remove(himl HIMAGELIST, i int) bool {
	ret, _, _ := procImageList_Remove.Call(
		uintptr(himl),
		uintptr(i))

	return ret != 0
}

func ImageList_RemoveAll(himl HIMAGELIST) bool {
	return ImageList_Remove(himl, -1)
}

func TrackMouseEvent(tme *TRACKMOUSEEVENT) bool {
	ret, _, _ := procTrackMouseEvent.Call(
		uintptr(unsafe.Pointer(tme)))

	return ret != 0
}


================================================
FILE: w32/comdlg32.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2012 The W32 Authors. All Rights Reserved.
 */

package w32

import (
	"syscall"
	"unsafe"
)

var (
	modcomdlg32 = syscall.NewLazyDLL("comdlg32.dll")

	procGetSaveFileName      = modcomdlg32.NewProc("GetSaveFileNameW")
	procGetOpenFileName      = modcomdlg32.NewProc("GetOpenFileNameW")
	procCommDlgExtendedError = modcomdlg32.NewProc("CommDlgExtendedError")
)

func GetOpenFileName(ofn *OPENFILENAME) bool {
	ret, _, _ := procGetOpenFileName.Call(
		uintptr(unsafe.Pointer(ofn)))

	return ret != 0
}

func GetSaveFileName(ofn *OPENFILENAME) bool {
	ret, _, _ := procGetSaveFileName.Call(
		uintptr(unsafe.Pointer(ofn)))

	return ret != 0
}

func CommDlgExtendedError() uint {
	ret, _, _ := procCommDlgExtendedError.Call()

	return uint(ret)
}


================================================
FILE: w32/constants.go
================================================
/*
 * Copyright (C) 2019 The Winc Authors. All Rights Reserved.
 * Copyright (C) 2010-2012 The W32 Authors. All Rights Reserved.
 */

package w32

const (
	FALSE = 0
	TRUE  = 1
)

const (
	NO_ERROR                         = 0
	ERROR_SUCCESS                    = 0
	ERROR_FILE_NOT_FOUND             = 2
	ERROR_PATH_NOT_FOUND             = 3
	ERROR_ACCESS_DENIED              = 5
	ERROR_INVALID_HANDLE             = 6
	ERROR_BAD_FORMAT                 = 11
	ERROR_INVALID_NAME               = 123
	ERROR_MORE_DATA                  = 234
	ERROR_NO_MORE_ITEMS              = 259
	ERROR_INVALID_SERVICE_CONTROL    = 1052
	ERROR_SERVICE_REQUEST_TIMEOUT    = 1053
	ERROR_SERVICE_NO_THREAD          = 1054
	ERROR_SERVICE_DATABASE_LOCKED    = 1055
	ERROR_SERVICE_ALREADY_RUNNING    = 1056
	ERROR_SERVICE_DISABLED           = 1058
	ERROR_SERVICE_DOES_NOT_EXIST     = 1060
	ERROR_SERVICE_CANNOT_ACCEPT_CTRL = 1061
	ERROR_SERVICE_NOT_ACTIVE         = 1062
	ERROR_DATABASE_DOES_NOT_EXIST    = 1065
	ERROR_SERVICE_DEPENDENCY_FAIL    = 1068
	ERROR_SERVICE_LOGON_FAILED       = 1069
	ERROR_SERVICE_MARKED_FOR_DELETE  = 1072
	ERROR_SERVICE_DEPENDENCY_DELETED = 1075
)

const (
	SE_ERR_FNF             = 2
	SE_ERR_PNF             = 3
	SE_ERR_ACCESSDENIED    = 5
	SE_ERR_OOM             = 8
	SE_ERR_DLLNOTFOUND     = 32
	SE_ERR_SHARE           = 26
	SE_ERR_ASSOCINCOMPLETE = 27
	SE_ERR_DDETIMEOUT      = 28
	SE_ERR_DDEFAIL         = 29
	SE_ERR_DDEBUSY         = 30
	SE_ERR_NOASSOC         = 31
)

const (
	CW_USEDEFAULT = ^0x7fffffff
)

const (
	IMAGE_BITMAP      = 0
	IMAGE_ICON        = 1
	IMAGE_CURSOR      = 2
	IMAGE_ENHMETAFILE = 3
)

// ShowWindow constants
const (
	SW_HIDE            = 0
	SW_NORMAL          = 1
	SW_SHOWNORMAL      = 1
	SW_SHOWMINIMIZED   = 2
	SW_MAXIMIZE        = 3
	SW_SHOWMAXIMIZED   = 3
	SW_SHOWNOACTIVATE  = 4
	SW_SHOW            = 5
	SW_MINIMIZE        = 6
	SW_SHOWMINNOACTIVE = 7
	
Download .txt
gitextract_bzexg7vw/

├── .gitignore
├── AUTHORS
├── LICENSE
├── README.md
├── app.go
├── bitmap.go
├── brush.go
├── buttons.go
├── canvas.go
├── color.go
├── combobox.go
├── commondlgs.go
├── controlbase.go
├── controller.go
├── dialog.go
├── edit.go
├── event.go
├── eventdata.go
├── eventmanager.go
├── examples/
│   ├── sample_contextmenu/
│   │   ├── app.manifest
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   ├── sample_control/
│   │   ├── main.go
│   │   └── topform.go
│   ├── sample_docking/
│   │   ├── app.manifest
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   ├── sample_hello/
│   │   └── main.go
│   ├── sample_image/
│   │   ├── app.manifest
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   ├── sample_imagebox/
│   │   ├── app.manifest
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   ├── sample_listview/
│   │   ├── app.manifest
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   ├── sample_minimal/
│   │   └── main.go
│   ├── sample_scrollview/
│   │   ├── app.manifest
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   ├── sample_slider/
│   │   ├── app.manifest
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   ├── sample_splitview/
│   │   ├── app.manifest
│   │   ├── layout.json
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   ├── sample_tab/
│   │   ├── app.manifest
│   │   ├── main.go
│   │   ├── release.bat
│   │   └── rsrc.syso
│   └── sample_treeview/
│       ├── app.manifest
│       ├── main.go
│       ├── release.bat
│       └── rsrc.syso
├── font.go
├── form.go
├── globalvars.go
├── go.mod
├── icon.go
├── imagelist.go
├── imageview.go
├── imageviewbox.go
├── init.go
├── keyboard.go
├── label.go
├── layout.go
├── listview.go
├── menu.go
├── mousecontrol.go
├── msghandlerregistry.go
├── panel.go
├── path.go
├── pen.go
├── progressbar.go
├── rect.go
├── resizer.go
├── scrollview.go
├── slider.go
├── tabview.go
├── toolbar.go
├── tooltip.go
├── treeview.go
├── utils.go
├── w32/
│   ├── comctl32.go
│   ├── comdlg32.go
│   ├── constants.go
│   ├── gdi32.go
│   ├── gdiplus.go
│   ├── idispatch.go
│   ├── istream.go
│   ├── iunknown.go
│   ├── kernel32.go
│   ├── ole32.go
│   ├── oleaut32.go
│   ├── shcore.go
│   ├── shell32.go
│   ├── shlwapi.go
│   ├── toolbar.go
│   ├── typedef.go
│   ├── user32.go
│   ├── utils.go
│   ├── uxtheme.go
│   └── vars.go
└── wndproc.go
Download .txt
Showing preview only (294K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (4003 symbols across 76 files)

FILE: app.go
  function init (line 21) | func init() {
  function SetAppIcon (line 40) | func SetAppIcon(appIconID int) {
  function GetAppInstance (line 44) | func GetAppInstance() w32.HINSTANCE {
  function PreTranslateMessage (line 48) | func PreTranslateMessage(msg *w32.MSG) bool {
  function RunMainLoop (line 75) | func RunMainLoop() int {
  function PostMessages (line 91) | func PostMessages() {
  function Exit (line 103) | func Exit() {

FILE: bitmap.go
  type Bitmap (line 15) | type Bitmap struct
    method Dispose (line 89) | func (bm *Bitmap) Dispose() {
    method GetHBITMAP (line 96) | func (bm *Bitmap) GetHBITMAP() w32.HBITMAP {
    method Size (line 100) | func (bm *Bitmap) Size() (int, int) {
    method Height (line 104) | func (bm *Bitmap) Height() int {
    method Width (line 108) | func (bm *Bitmap) Width() int {
  function assembleBitmapFromHBITMAP (line 20) | func assembleBitmapFromHBITMAP(hbitmap w32.HBITMAP) (*Bitmap, error) {
  function NewBitmapFromFile (line 33) | func NewBitmapFromFile(filepath string, background Color) (*Bitmap, erro...
  function NewBitmapFromResource (line 53) | func NewBitmapFromResource(instance w32.HINSTANCE, resName *uint16, resT...

FILE: brush.go
  type Brush (line 14) | type Brush struct
    method GetHBRUSH (line 59) | func (br *Brush) GetHBRUSH() w32.HBRUSH {
    method GetLOGBRUSH (line 63) | func (br *Brush) GetLOGBRUSH() *w32.LOGBRUSH {
    method Dispose (line 67) | func (br *Brush) Dispose() {
  function NewSolidColorBrush (line 19) | func NewSolidColorBrush(color Color) *Brush {
  function NewSystemColorBrush (line 29) | func NewSystemColorBrush(colorIndex int) *Brush {
  function NewHatchedColorBrush (line 39) | func NewHatchedColorBrush(color Color) *Brush {
  function NewNullBrush (line 49) | func NewNullBrush() *Brush {

FILE: buttons.go
  type Button (line 14) | type Button struct
    method OnClick (line 19) | func (bt *Button) OnClick() *EventManager {
    method WndProc (line 23) | func (bt *Button) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
    method Checked (line 38) | func (bt *Button) Checked() bool {
    method SetChecked (line 43) | func (bt *Button) SetChecked(checked bool) {
    method SetIcon (line 52) | func (bt *Button) SetIcon(ico *Icon) {
    method SetResIcon (line 56) | func (bt *Button) SetResIcon(iconID uint16) {
  type PushButton (line 64) | type PushButton struct
    method SetDefault (line 82) | func (pb *PushButton) SetDefault() {
  function NewPushButton (line 68) | func NewPushButton(parent Controller) *PushButton {
  type IconButton (line 87) | type IconButton struct
  function NewIconButton (line 91) | func NewIconButton(parent Controller) *IconButton {
  type CheckBox (line 105) | type CheckBox struct
  function NewCheckBox (line 109) | func NewCheckBox(parent Controller) *CheckBox {
  type RadioButton (line 122) | type RadioButton struct
  function NewRadioButton (line 126) | func NewRadioButton(parent Controller) *RadioButton {
  type GroupBox (line 139) | type GroupBox struct
  function NewGroupBox (line 143) | func NewGroupBox(parent Controller) *GroupBox {

FILE: canvas.go
  type Canvas (line 14) | type Canvas struct
    method Dispose (line 39) | func (ca *Canvas) Dispose() {
    method DrawBitmap (line 51) | func (ca *Canvas) DrawBitmap(bmp *Bitmap, x, y int) {
    method DrawStretchedBitmap (line 63) | func (ca *Canvas) DrawStretchedBitmap(bmp *Bitmap, rect *Rect) {
    method DrawIcon (line 76) | func (ca *Canvas) DrawIcon(ico *Icon, x, y int) bool {
    method DrawFillRect (line 81) | func (ca *Canvas) DrawFillRect(rect *Rect, pen *Pen, brush *Brush) {
    method DrawRect (line 93) | func (ca *Canvas) DrawRect(rect *Rect, pen *Pen) {
    method FillRect (line 106) | func (ca *Canvas) FillRect(rect *Rect, brush *Brush) {
    method DrawEllipse (line 110) | func (ca *Canvas) DrawEllipse(rect *Rect, pen *Pen) {
    method DrawFillEllipse (line 124) | func (ca *Canvas) DrawFillEllipse(rect *Rect, pen *Pen, brush *Brush) {
    method DrawLine (line 136) | func (ca *Canvas) DrawLine(x, y, x2, y2 int, pen *Pen) {
    method DrawText (line 146) | func (ca *Canvas) DrawText(text string, rect *Rect, format uint, font ...
  function NewCanvasFromHwnd (line 22) | func NewCanvasFromHwnd(hwnd w32.HWND) *Canvas {
  function NewCanvasFromHDC (line 31) | func NewCanvasFromHDC(hdc w32.HDC) *Canvas {

FILE: color.go
  type Color (line 8) | type Color
    method R (line 14) | func (c Color) R() byte {
    method G (line 18) | func (c Color) G() byte {
    method B (line 22) | func (c Color) B() byte {
  function RGB (line 10) | func RGB(r, g, b byte) Color {

FILE: combobox.go
  type ComboBox (line 14) | type ComboBox struct
    method DeleteAllItems (line 30) | func (cb *ComboBox) DeleteAllItems() bool {
    method InsertItem (line 34) | func (cb *ComboBox) InsertItem(index int, str string) bool {
    method DeleteItem (line 39) | func (cb *ComboBox) DeleteItem(index int) bool {
    method SelectedItem (line 43) | func (cb *ComboBox) SelectedItem() int {
    method SetSelectedItem (line 47) | func (cb *ComboBox) SetSelectedItem(value int) bool {
    method OnSelectedChange (line 51) | func (cb *ComboBox) OnSelectedChange() *EventManager {
    method WndProc (line 56) | func (cb *ComboBox) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
  function NewComboBox (line 19) | func NewComboBox(parent Controller) *ComboBox {

FILE: commondlgs.go
  function genOFN (line 16) | func genOFN(parent Controller, title, filter string, filterIndex uint, i...
  function ShowOpenFileDlg (line 48) | func ShowOpenFileDlg(parent Controller, title, filter string, filterInde...
  function ShowSaveFileDlg (line 58) | func ShowSaveFileDlg(parent Controller, title, filter string, filterInde...
  function ShowBrowseFolderDlg (line 68) | func ShowBrowseFolderDlg(parent Controller, title string) (folder string...
  function MsgBoxOkCancel (line 84) | func MsgBoxOkCancel(parent Controller, title, caption string) int {
  function MsgBoxYesNo (line 88) | func MsgBoxYesNo(parent Controller, title, caption string) int {
  function MsgBoxOk (line 92) | func MsgBoxOk(parent Controller, title, caption string) {
  function Warningf (line 97) | func Warningf(parent Controller, format string, data ...interface{}) int {
  function Printf (line 103) | func Printf(parent Controller, format string, data ...interface{}) {
  function Errorf (line 109) | func Errorf(parent Controller, format string, data ...interface{}) {
  function MsgBox (line 114) | func MsgBox(parent Controller, title, caption string, flags uint) int {

FILE: controlbase.go
  type ControlBase (line 16) | type ControlBase struct
    method InitControl (line 62) | func (cba *ControlBase) InitControl(className string, parent Controlle...
    method InitWindow (line 71) | func (cba *ControlBase) InitWindow(className string, parent Controller...
    method SetTheme (line 81) | func (cba *ControlBase) SetTheme(appName string) error {
    method Handle (line 88) | func (cba *ControlBase) Handle() w32.HWND {
    method SetHandle (line 92) | func (cba *ControlBase) SetHandle(hwnd w32.HWND) {
    method GetWindowDPI (line 96) | func (cba *ControlBase) GetWindowDPI() (w32.UINT, w32.UINT) {
    method SetAndClearStyleBits (line 103) | func (cba *ControlBase) SetAndClearStyleBits(set, clear uint32) error {
    method SetIsForm (line 117) | func (cba *ControlBase) SetIsForm(isform bool) {
    method SetText (line 121) | func (cba *ControlBase) SetText(caption string) {
    method Text (line 125) | func (cba *ControlBase) Text() string {
    method Close (line 129) | func (cba *ControlBase) Close() {
    method SetTranslucentBackground (line 134) | func (cba *ControlBase) SetTranslucentBackground() {
    method clampSize (line 160) | func (cba *ControlBase) clampSize(width, height int) (int, int) {
    method SetSize (line 176) | func (cba *ControlBase) SetSize(width, height int) {
    method SetMinSize (line 182) | func (cba *ControlBase) SetMinSize(width, height int) {
    method SetMaxSize (line 201) | func (cba *ControlBase) SetMaxSize(width, height int) {
    method Size (line 221) | func (cba *ControlBase) Size() (width, height int) {
    method Width (line 228) | func (cba *ControlBase) Width() int {
    method Height (line 233) | func (cba *ControlBase) Height() int {
    method SetPos (line 238) | func (cba *ControlBase) SetPos(x, y int) {
    method Pos (line 245) | func (cba *ControlBase) Pos() (x, y int) {
    method Visible (line 255) | func (cba *ControlBase) Visible() bool {
    method ToggleVisible (line 259) | func (cba *ControlBase) ToggleVisible() bool {
    method ContextMenu (line 269) | func (cba *ControlBase) ContextMenu() *MenuItem {
    method SetContextMenu (line 273) | func (cba *ControlBase) SetContextMenu(menu *MenuItem) {
    method Bounds (line 277) | func (cba *ControlBase) Bounds() *Rect {
    method ClientRect (line 286) | func (cba *ControlBase) ClientRect() *Rect {
    method ClientWidth (line 290) | func (cba *ControlBase) ClientWidth() int {
    method ClientHeight (line 295) | func (cba *ControlBase) ClientHeight() int {
    method Show (line 300) | func (cba *ControlBase) Show() {
    method Hide (line 304) | func (cba *ControlBase) Hide() {
    method Enabled (line 308) | func (cba *ControlBase) Enabled() bool {
    method SetEnabled (line 312) | func (cba *ControlBase) SetEnabled(b bool) {
    method SetFocus (line 316) | func (cba *ControlBase) SetFocus() {
    method Invalidate (line 320) | func (cba *ControlBase) Invalidate(erase bool) {
    method Parent (line 331) | func (cba *ControlBase) Parent() Controller {
    method SetParent (line 335) | func (cba *ControlBase) SetParent(parent Controller) {
    method Font (line 339) | func (cba *ControlBase) Font() *Font {
    method SetFont (line 343) | func (cba *ControlBase) SetFont(font *Font) {
    method EnableDragAcceptFiles (line 348) | func (cba *ControlBase) EnableDragAcceptFiles(b bool) {
    method InvokeRequired (line 352) | func (cba *ControlBase) InvokeRequired() bool {
    method PreTranslateMessage (line 363) | func (cba *ControlBase) PreTranslateMessage(msg *w32.MSG) bool {
    method OnCreate (line 371) | func (cba *ControlBase) OnCreate() *EventManager {
    method OnClose (line 375) | func (cba *ControlBase) OnClose() *EventManager {
    method OnKillFocus (line 379) | func (cba *ControlBase) OnKillFocus() *EventManager {
    method OnSetFocus (line 383) | func (cba *ControlBase) OnSetFocus() *EventManager {
    method OnDropFiles (line 387) | func (cba *ControlBase) OnDropFiles() *EventManager {
    method OnLBDown (line 391) | func (cba *ControlBase) OnLBDown() *EventManager {
    method OnLBUp (line 395) | func (cba *ControlBase) OnLBUp() *EventManager {
    method OnLBDbl (line 399) | func (cba *ControlBase) OnLBDbl() *EventManager {
    method OnMBDown (line 403) | func (cba *ControlBase) OnMBDown() *EventManager {
    method OnMBUp (line 407) | func (cba *ControlBase) OnMBUp() *EventManager {
    method OnRBDown (line 411) | func (cba *ControlBase) OnRBDown() *EventManager {
    method OnRBUp (line 415) | func (cba *ControlBase) OnRBUp() *EventManager {
    method OnRBDbl (line 419) | func (cba *ControlBase) OnRBDbl() *EventManager {
    method OnMouseMove (line 423) | func (cba *ControlBase) OnMouseMove() *EventManager {
    method OnMouseHover (line 427) | func (cba *ControlBase) OnMouseHover() *EventManager {
    method OnMouseLeave (line 431) | func (cba *ControlBase) OnMouseLeave() *EventManager {
    method OnPaint (line 435) | func (cba *ControlBase) OnPaint() *EventManager {
    method OnSize (line 439) | func (cba *ControlBase) OnSize() *EventManager {
    method OnKeyUp (line 443) | func (cba *ControlBase) OnKeyUp() *EventManager {
  function min (line 146) | func min(a, b int) int {
  function max (line 153) | func max(a, b int) int {

FILE: controller.go
  type Controller (line 12) | type Controller interface

FILE: dialog.go
  type Dialog (line 12) | type Dialog struct
    method SetModal (line 50) | func (dlg *Dialog) SetModal(modal bool) {
    method SetButtons (line 55) | func (dlg *Dialog) SetButtons(btnOk *PushButton, btnCancel *PushButton) {
    method OnLoad (line 62) | func (dlg *Dialog) OnLoad() *EventManager {
    method OnOk (line 66) | func (dlg *Dialog) OnOk() *EventManager {
    method OnCancel (line 70) | func (dlg *Dialog) OnCancel() *EventManager {
    method PreTranslateMessage (line 75) | func (dlg *Dialog) PreTranslateMessage(msg *w32.MSG) bool {
    method Show (line 85) | func (dlg *Dialog) Show() {
    method Close (line 94) | func (dlg *Dialog) Close() {
    method cancel (line 101) | func (dlg *Dialog) cancel() {
    method WndProc (line 108) | func (dlg *Dialog) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
  function NewDialog (line 24) | func NewDialog(parent Controller) *Dialog {

FILE: edit.go
  type Edit (line 10) | type Edit struct
    method OnChange (line 31) | func (ed *Edit) OnChange() *EventManager {
    method SetReadOnly (line 36) | func (ed *Edit) SetReadOnly(isReadOnly bool) {
    method SetPassword (line 41) | func (ed *Edit) SetPassword(isPassword bool) {
    method WndProc (line 49) | func (ed *Edit) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
  constant passwordChar (line 15) | passwordChar = '*'
  constant nopasswordChar (line 16) | nopasswordChar = ' '
  function NewEdit (line 18) | func NewEdit(parent Controller) *Edit {
  type MultiEdit (line 66) | type MultiEdit struct
    method OnChange (line 84) | func (med *MultiEdit) OnChange() *EventManager {
    method SetReadOnly (line 89) | func (med *MultiEdit) SetReadOnly(isReadOnly bool) {
    method AddLine (line 93) | func (med *MultiEdit) AddLine(text string) {
    method WndProc (line 101) | func (med *MultiEdit) WndProc(msg uint32, wparam, lparam uintptr) uint...
  function NewMultiEdit (line 71) | func NewMultiEdit(parent Controller) *MultiEdit {

FILE: event.go
  type Event (line 8) | type Event struct
  function NewEvent (line 13) | func NewEvent(sender Controller, data interface{}) *Event {

FILE: eventdata.go
  type RawMsg (line 12) | type RawMsg struct
  type MouseEventData (line 18) | type MouseEventData struct
  type DropFilesEventData (line 24) | type DropFilesEventData struct
  type PaintEventData (line 29) | type PaintEventData struct
  type LabelEditEventData (line 33) | type LabelEditEventData struct
  type KeyUpEventData (line 43) | type KeyUpEventData struct
  type SizeEventData (line 47) | type SizeEventData struct

FILE: eventmanager.go
  type EventHandler (line 8) | type EventHandler
  type EventManager (line 10) | type EventManager struct
    method Fire (line 14) | func (evm *EventManager) Fire(arg *Event) {
    method Bind (line 20) | func (evm *EventManager) Bind(handler EventHandler) {

FILE: examples/sample_contextmenu/main.go
  function btnOnClick (line 9) | func btnOnClick(arg *winc.Event) {
  function wndOnClose (line 13) | func wndOnClose(arg *winc.Event) {
  type Item (line 18) | type Item struct
    method Text (line 22) | func (item Item) Text() string    { return item.T }
    method ImageIndex (line 23) | func (item Item) ImageIndex() int { return 0 }
  function main (line 25) | func main() {

FILE: examples/sample_control/main.go
  function main (line 7) | func main() {
  function wndOnClose (line 36) | func wndOnClose(arg *winc.Event) {

FILE: examples/sample_control/topform.go
  type TopForm (line 11) | type TopForm struct
    method OnLoad (line 41) | func (dlg *TopForm) OnLoad() *winc.EventManager {
    method Show (line 45) | func (dlg *TopForm) Show() {
    method WndProc (line 50) | func (dlg *TopForm) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
  function NewTopForm (line 17) | func NewTopForm(parent winc.Controller) *TopForm {

FILE: examples/sample_docking/main.go
  function btnOnClick (line 9) | func btnOnClick(arg *winc.Event) {
  function wndOnClose (line 13) | func wndOnClose(arg *winc.Event) {
  type Item (line 17) | type Item struct
    method Text (line 21) | func (item Item) Text() string    { return item.T }
    method ImageIndex (line 22) | func (item Item) ImageIndex() int { return 0 }
  function main (line 24) | func main() {

FILE: examples/sample_hello/main.go
  function main (line 7) | func main() {
  function wndOnClose (line 54) | func wndOnClose(arg *winc.Event) {

FILE: examples/sample_image/main.go
  function btnOnClick (line 9) | func btnOnClick(arg *winc.Event) {
  function wndOnClose (line 13) | func wndOnClose(arg *winc.Event) {
  function main (line 17) | func main() {

FILE: examples/sample_imagebox/main.go
  function btnOnClick (line 9) | func btnOnClick(arg *winc.Event) {
  function wndOnClose (line 13) | func wndOnClose(arg *winc.Event) {
  function main (line 17) | func main() {

FILE: examples/sample_listview/main.go
  function btnOnClick (line 9) | func btnOnClick(arg *winc.Event) {
  function wndOnClose (line 13) | func wndOnClose(arg *winc.Event) {
  type Item (line 17) | type Item struct
    method Text (line 22) | func (item Item) Text() []string    { return item.T }
    method SetText (line 23) | func (item *Item) SetText(s string) { item.T[0] = s }
    method Checked (line 25) | func (item Item) Checked() bool            { return item.checked }
    method SetChecked (line 26) | func (item *Item) SetChecked(checked bool) { item.checked = checked }
    method ImageIndex (line 27) | func (item Item) ImageIndex() int          { return 0 }
  function main (line 29) | func main() {

FILE: examples/sample_minimal/main.go
  function main (line 7) | func main() {
  function wndOnClose (line 36) | func wndOnClose(arg *winc.Event) {

FILE: examples/sample_scrollview/main.go
  function btnOnClick (line 9) | func btnOnClick(arg *winc.Event) {
  function wndOnClose (line 14) | func wndOnClose(arg *winc.Event) {
  type Item (line 18) | type Item struct
    method Text (line 22) | func (item Item) Text() string    { return item.T }
    method ImageIndex (line 23) | func (item Item) ImageIndex() int { return 1 }
  function main (line 25) | func main() {

FILE: examples/sample_slider/main.go
  function btnOnClick (line 9) | func btnOnClick(arg *winc.Event) {
  function wndOnClose (line 13) | func wndOnClose(arg *winc.Event) {
  function main (line 17) | func main() {

FILE: examples/sample_splitview/main.go
  function btnOnClick (line 9) | func btnOnClick(arg *winc.Event) {
  function wndOnClose (line 14) | func wndOnClose(arg *winc.Event) {
  function main (line 18) | func main() {

FILE: examples/sample_tab/main.go
  function btnOnClick (line 9) | func btnOnClick(arg *winc.Event) {
  function wndOnClose (line 13) | func wndOnClose(arg *winc.Event) {
  type Item (line 17) | type Item struct
    method Text (line 22) | func (item Item) Text() []string    { return item.T }
    method SetText (line 23) | func (item *Item) SetText(s string) { item.T[0] = s }
    method Checked (line 25) | func (item Item) Checked() bool            { return item.checked }
    method SetChecked (line 26) | func (item *Item) SetChecked(checked bool) { item.checked = checked }
    method ImageIndex (line 27) | func (item Item) ImageIndex() int          { return 0 }
  function main (line 29) | func main() {

FILE: examples/sample_treeview/main.go
  function btnOnClick (line 9) | func btnOnClick(arg *winc.Event) {
  function wndOnClose (line 13) | func wndOnClose(arg *winc.Event) {
  type Item (line 17) | type Item struct
    method Text (line 21) | func (item Item) Text() string    { return item.T }
    method ImageIndex (line 22) | func (item Item) ImageIndex() int { return 1 }
  function main (line 24) | func main() {

FILE: font.go
  constant FontBold (line 15) | FontBold      byte = 0x01
  constant FontItalic (line 16) | FontItalic    byte = 0x02
  constant FontUnderline (line 17) | FontUnderline byte = 0x04
  constant FontStrikeOut (line 18) | FontStrikeOut byte = 0x08
  function init (line 21) | func init() {
  type Font (line 25) | type Font struct
    method createForDPI (line 56) | func (fnt *Font) createForDPI(dpi int) w32.HFONT {
    method GetHFONT (line 87) | func (fnt *Font) GetHFONT() w32.HFONT {
    method Bold (line 91) | func (fnt *Font) Bold() bool {
    method Dispose (line 95) | func (fnt *Font) Dispose() {
    method Family (line 101) | func (fnt *Font) Family() string {
    method Italic (line 105) | func (fnt *Font) Italic() bool {
    method StrikeOut (line 109) | func (fnt *Font) StrikeOut() bool {
    method Underline (line 113) | func (fnt *Font) Underline() bool {
    method Style (line 117) | func (fnt *Font) Style() byte {
  function NewFont (line 32) | func NewFont(family string, pointSize int, style byte) *Font {

FILE: form.go
  type LayoutManager (line 13) | type LayoutManager interface
  type Form (line 18) | type Form struct
    method SetLayout (line 86) | func (fm *Form) SetLayout(mng LayoutManager) {
    method UpdateLayout (line 91) | func (fm *Form) UpdateLayout() {
    method NewMenu (line 97) | func (fm *Form) NewMenu() *Menu {
    method DisableIcon (line 109) | func (fm *Form) DisableIcon() {
    method Maximise (line 126) | func (fm *Form) Maximise() {
    method Minimise (line 130) | func (fm *Form) Minimise() {
    method Restore (line 134) | func (fm *Form) Restore() {
    method Center (line 139) | func (fm *Form) Center() {
    method Fullscreen (line 161) | func (fm *Form) Fullscreen() {
    method UnFullscreen (line 186) | func (fm *Form) UnFullscreen() {
    method SetIcon (line 198) | func (fm *Form) SetIcon(iconType int, icon *Icon) {
    method EnableMaxButton (line 205) | func (fm *Form) EnableMaxButton(b bool) {
    method EnableMinButton (line 209) | func (fm *Form) EnableMinButton(b bool) {
    method EnableSizable (line 213) | func (fm *Form) EnableSizable(b bool) {
    method EnableDragMove (line 217) | func (fm *Form) EnableDragMove(_ bool) {
    method EnableTopMost (line 221) | func (fm *Form) EnableTopMost(b bool) {
    method WndProc (line 229) | func (fm *Form) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
  function NewCustomForm (line 29) | func NewCustomForm(parent Controller, exStyle int, dwStyle uint) *Form {
  function NewForm (line 62) | func NewForm(parent Controller) *Form {

FILE: icon.go
  type Icon (line 16) | type Icon struct
    method Destroy (line 47) | func (ic *Icon) Destroy() bool {
    method Handle (line 51) | func (ic *Icon) Handle() w32.HICON {
  function NewIconFromFile (line 20) | func NewIconFromFile(path string) (*Icon, error) {
  function NewIconFromResource (line 29) | func NewIconFromResource(instance w32.HINSTANCE, resId uint16) (*Icon, e...
  function ExtractIcon (line 38) | func ExtractIcon(fileName string, index int) (*Icon, error) {

FILE: imagelist.go
  type ImageList (line 14) | type ImageList struct
    method Handle (line 28) | func (im *ImageList) Handle() w32.HIMAGELIST {
    method Destroy (line 32) | func (im *ImageList) Destroy() bool {
    method SetImageCount (line 36) | func (im *ImageList) SetImageCount(uNewCount uint) bool {
    method ImageCount (line 40) | func (im *ImageList) ImageCount() int {
    method AddIcon (line 44) | func (im *ImageList) AddIcon(icon *Icon) int {
    method AddResIcon (line 48) | func (im *ImageList) AddResIcon(iconID uint16) {
    method RemoveAll (line 56) | func (im *ImageList) RemoveAll() bool {
    method Remove (line 60) | func (im *ImageList) Remove(i int) bool {
  function NewImageList (line 18) | func NewImageList(cx, cy int) *ImageList {
  function newImageList (line 22) | func newImageList(cx, cy int, flags uint, cInitial, cGrow int) *ImageList {

FILE: imageview.go
  type ImageView (line 9) | type ImageView struct
    method DrawImageFile (line 27) | func (iv *ImageView) DrawImageFile(filepath string) error {
    method DrawImage (line 36) | func (iv *ImageView) DrawImage(bmp *Bitmap) {
    method WndProc (line 40) | func (iv *ImageView) WndProc(msg uint32, wparam, lparam uintptr) uintp...
  function NewImageView (line 15) | func NewImageView(parent Controller) *ImageView {

FILE: imageviewbox.go
  type direction (line 14) | type direction
  constant DirNone (line 17) | DirNone direction = iota
  constant DirX (line 18) | DirX
  constant DirY (line 19) | DirY
  constant DirX2 (line 20) | DirX2
  constant DirY2 (line 21) | DirY2
  type ImageBox (line 29) | type ImageBox struct
    method Rect (line 37) | func (b *ImageBox) Rect() *Rect {
  type ImageViewBox (line 42) | type ImageViewBox struct
    method OnSelectedChange (line 76) | func (iv *ImageViewBox) OnSelectedChange() *EventManager {
    method OnAdd (line 80) | func (iv *ImageViewBox) OnAdd() *EventManager {
    method OnModify (line 84) | func (iv *ImageViewBox) OnModify() *EventManager {
    method IsModified (line 88) | func (iv *ImageViewBox) IsModified() bool          { return iv.modified }
    method SetModified (line 89) | func (iv *ImageViewBox) SetModified(modified bool) { iv.modified = mod...
    method IsLoaded (line 90) | func (iv *ImageViewBox) IsLoaded() bool            { return iv.bmp != ...
    method AddMode (line 91) | func (iv *ImageViewBox) AddMode() bool             { return iv.add }
    method SetAddMode (line 92) | func (iv *ImageViewBox) SetAddMode(add bool)       { iv.add = add }
    method HasSelected (line 93) | func (iv *ImageViewBox) HasSelected() bool         { return iv.selBox ...
    method wasModified (line 95) | func (iv *ImageViewBox) wasModified() {
    method DeleteSelected (line 100) | func (iv *ImageViewBox) DeleteSelected() {
    method NameSelected (line 115) | func (iv *ImageViewBox) NameSelected() string {
    method SetNameSelected (line 122) | func (iv *ImageViewBox) SetNameSelected(name string) {
    method TypeSelected (line 129) | func (iv *ImageViewBox) TypeSelected() int {
    method SetTypeSelected (line 136) | func (iv *ImageViewBox) SetTypeSelected(typ int) {
    method updateHighlight (line 143) | func (ib *ImageViewBox) updateHighlight(x, y int) bool {
    method isUnderMouse (line 158) | func (ib *ImageViewBox) isUnderMouse(x, y int) *ImageBox {
    method getCursor (line 167) | func (ib *ImageViewBox) getCursor(x, y int) uint16 {
    method resizingDirection (line 180) | func (ib *ImageViewBox) resizingDirection(b *ImageBox, x, y int) direc...
    method resizeToDirection (line 197) | func (ib *ImageViewBox) resizeToDirection(b *ImageBox, x, y int) {
    method drag (line 210) | func (ib *ImageViewBox) drag(b *ImageBox, x, y int) {
    method DrawImageFile (line 224) | func (iv *ImageViewBox) DrawImageFile(filepath string) (err error) {
    method DrawImage (line 233) | func (iv *ImageViewBox) DrawImage(bmp *Bitmap) {
    method WndProc (line 241) | func (iv *ImageViewBox) WndProc(msg uint32, wparam, lparam uintptr) ui...
  function NewImageViewBox (line 63) | func NewImageViewBox(parent Controller) *ImageViewBox {

FILE: init.go
  function init (line 12) | func init() {

FILE: keyboard.go
  type Key (line 14) | type Key
    method String (line 16) | func (k Key) String() string {
  constant KeyLButton (line 21) | KeyLButton           Key = w32.VK_LBUTTON
  constant KeyRButton (line 22) | KeyRButton           Key = w32.VK_RBUTTON
  constant KeyCancel (line 23) | KeyCancel            Key = w32.VK_CANCEL
  constant KeyMButton (line 24) | KeyMButton           Key = w32.VK_MBUTTON
  constant KeyXButton1 (line 25) | KeyXButton1          Key = w32.VK_XBUTTON1
  constant KeyXButton2 (line 26) | KeyXButton2          Key = w32.VK_XBUTTON2
  constant KeyBack (line 27) | KeyBack              Key = w32.VK_BACK
  constant KeyTab (line 28) | KeyTab               Key = w32.VK_TAB
  constant KeyClear (line 29) | KeyClear             Key = w32.VK_CLEAR
  constant KeyReturn (line 30) | KeyReturn            Key = w32.VK_RETURN
  constant KeyShift (line 31) | KeyShift             Key = w32.VK_SHIFT
  constant KeyControl (line 32) | KeyControl           Key = w32.VK_CONTROL
  constant KeyAlt (line 33) | KeyAlt               Key = w32.VK_MENU
  constant KeyMenu (line 34) | KeyMenu              Key = w32.VK_MENU
  constant KeyPause (line 35) | KeyPause             Key = w32.VK_PAUSE
  constant KeyCapital (line 36) | KeyCapital           Key = w32.VK_CAPITAL
  constant KeyKana (line 37) | KeyKana              Key = w32.VK_KANA
  constant KeyHangul (line 38) | KeyHangul            Key = w32.VK_HANGUL
  constant KeyJunja (line 39) | KeyJunja             Key = w32.VK_JUNJA
  constant KeyFinal (line 40) | KeyFinal             Key = w32.VK_FINAL
  constant KeyHanja (line 41) | KeyHanja             Key = w32.VK_HANJA
  constant KeyKanji (line 42) | KeyKanji             Key = w32.VK_KANJI
  constant KeyEscape (line 43) | KeyEscape            Key = w32.VK_ESCAPE
  constant KeyConvert (line 44) | KeyConvert           Key = w32.VK_CONVERT
  constant KeyNonconvert (line 45) | KeyNonconvert        Key = w32.VK_NONCONVERT
  constant KeyAccept (line 46) | KeyAccept            Key = w32.VK_ACCEPT
  constant KeyModeChange (line 47) | KeyModeChange        Key = w32.VK_MODECHANGE
  constant KeySpace (line 48) | KeySpace             Key = w32.VK_SPACE
  constant KeyPrior (line 49) | KeyPrior             Key = w32.VK_PRIOR
  constant KeyNext (line 50) | KeyNext              Key = w32.VK_NEXT
  constant KeyEnd (line 51) | KeyEnd               Key = w32.VK_END
  constant KeyHome (line 52) | KeyHome              Key = w32.VK_HOME
  constant KeyLeft (line 53) | KeyLeft              Key = w32.VK_LEFT
  constant KeyUp (line 54) | KeyUp                Key = w32.VK_UP
  constant KeyRight (line 55) | KeyRight             Key = w32.VK_RIGHT
  constant KeyDown (line 56) | KeyDown              Key = w32.VK_DOWN
  constant KeySelect (line 57) | KeySelect            Key = w32.VK_SELECT
  constant KeyPrint (line 58) | KeyPrint             Key = w32.VK_PRINT
  constant KeyExecute (line 59) | KeyExecute           Key = w32.VK_EXECUTE
  constant KeySnapshot (line 60) | KeySnapshot          Key = w32.VK_SNAPSHOT
  constant KeyInsert (line 61) | KeyInsert            Key = w32.VK_INSERT
  constant KeyDelete (line 62) | KeyDelete            Key = w32.VK_DELETE
  constant KeyHelp (line 63) | KeyHelp              Key = w32.VK_HELP
  constant Key0 (line 64) | Key0                 Key = 0x30
  constant Key1 (line 65) | Key1                 Key = 0x31
  constant Key2 (line 66) | Key2                 Key = 0x32
  constant Key3 (line 67) | Key3                 Key = 0x33
  constant Key4 (line 68) | Key4                 Key = 0x34
  constant Key5 (line 69) | Key5                 Key = 0x35
  constant Key6 (line 70) | Key6                 Key = 0x36
  constant Key7 (line 71) | Key7                 Key = 0x37
  constant Key8 (line 72) | Key8                 Key = 0x38
  constant Key9 (line 73) | Key9                 Key = 0x39
  constant KeyA (line 74) | KeyA                 Key = 0x41
  constant KeyB (line 75) | KeyB                 Key = 0x42
  constant KeyC (line 76) | KeyC                 Key = 0x43
  constant KeyD (line 77) | KeyD                 Key = 0x44
  constant KeyE (line 78) | KeyE                 Key = 0x45
  constant KeyF (line 79) | KeyF                 Key = 0x46
  constant KeyG (line 80) | KeyG                 Key = 0x47
  constant KeyH (line 81) | KeyH                 Key = 0x48
  constant KeyI (line 82) | KeyI                 Key = 0x49
  constant KeyJ (line 83) | KeyJ                 Key = 0x4A
  constant KeyK (line 84) | KeyK                 Key = 0x4B
  constant KeyL (line 85) | KeyL                 Key = 0x4C
  constant KeyM (line 86) | KeyM                 Key = 0x4D
  constant KeyN (line 87) | KeyN                 Key = 0x4E
  constant KeyO (line 88) | KeyO                 Key = 0x4F
  constant KeyP (line 89) | KeyP                 Key = 0x50
  constant KeyQ (line 90) | KeyQ                 Key = 0x51
  constant KeyR (line 91) | KeyR                 Key = 0x52
  constant KeyS (line 92) | KeyS                 Key = 0x53
  constant KeyT (line 93) | KeyT                 Key = 0x54
  constant KeyU (line 94) | KeyU                 Key = 0x55
  constant KeyV (line 95) | KeyV                 Key = 0x56
  constant KeyW (line 96) | KeyW                 Key = 0x57
  constant KeyX (line 97) | KeyX                 Key = 0x58
  constant KeyY (line 98) | KeyY                 Key = 0x59
  constant KeyZ (line 99) | KeyZ                 Key = 0x5A
  constant KeyLWIN (line 100) | KeyLWIN              Key = w32.VK_LWIN
  constant KeyRWIN (line 101) | KeyRWIN              Key = w32.VK_RWIN
  constant KeyApps (line 102) | KeyApps              Key = w32.VK_APPS
  constant KeySleep (line 103) | KeySleep             Key = w32.VK_SLEEP
  constant KeyNumpad0 (line 104) | KeyNumpad0           Key = w32.VK_NUMPAD0
  constant KeyNumpad1 (line 105) | KeyNumpad1           Key = w32.VK_NUMPAD1
  constant KeyNumpad2 (line 106) | KeyNumpad2           Key = w32.VK_NUMPAD2
  constant KeyNumpad3 (line 107) | KeyNumpad3           Key = w32.VK_NUMPAD3
  constant KeyNumpad4 (line 108) | KeyNumpad4           Key = w32.VK_NUMPAD4
  constant KeyNumpad5 (line 109) | KeyNumpad5           Key = w32.VK_NUMPAD5
  constant KeyNumpad6 (line 110) | KeyNumpad6           Key = w32.VK_NUMPAD6
  constant KeyNumpad7 (line 111) | KeyNumpad7           Key = w32.VK_NUMPAD7
  constant KeyNumpad8 (line 112) | KeyNumpad8           Key = w32.VK_NUMPAD8
  constant KeyNumpad9 (line 113) | KeyNumpad9           Key = w32.VK_NUMPAD9
  constant KeyMultiply (line 114) | KeyMultiply          Key = w32.VK_MULTIPLY
  constant KeyAdd (line 115) | KeyAdd               Key = w32.VK_ADD
  constant KeySeparator (line 116) | KeySeparator         Key = w32.VK_SEPARATOR
  constant KeySubtract (line 117) | KeySubtract          Key = w32.VK_SUBTRACT
  constant KeyDecimal (line 118) | KeyDecimal           Key = w32.VK_DECIMAL
  constant KeyDivide (line 119) | KeyDivide            Key = w32.VK_DIVIDE
  constant KeyF1 (line 120) | KeyF1                Key = w32.VK_F1
  constant KeyF2 (line 121) | KeyF2                Key = w32.VK_F2
  constant KeyF3 (line 122) | KeyF3                Key = w32.VK_F3
  constant KeyF4 (line 123) | KeyF4                Key = w32.VK_F4
  constant KeyF5 (line 124) | KeyF5                Key = w32.VK_F5
  constant KeyF6 (line 125) | KeyF6                Key = w32.VK_F6
  constant KeyF7 (line 126) | KeyF7                Key = w32.VK_F7
  constant KeyF8 (line 127) | KeyF8                Key = w32.VK_F8
  constant KeyF9 (line 128) | KeyF9                Key = w32.VK_F9
  constant KeyF10 (line 129) | KeyF10               Key = w32.VK_F10
  constant KeyF11 (line 130) | KeyF11               Key = w32.VK_F11
  constant KeyF12 (line 131) | KeyF12               Key = w32.VK_F12
  constant KeyF13 (line 132) | KeyF13               Key = w32.VK_F13
  constant KeyF14 (line 133) | KeyF14               Key = w32.VK_F14
  constant KeyF15 (line 134) | KeyF15               Key = w32.VK_F15
  constant KeyF16 (line 135) | KeyF16               Key = w32.VK_F16
  constant KeyF17 (line 136) | KeyF17               Key = w32.VK_F17
  constant KeyF18 (line 137) | KeyF18               Key = w32.VK_F18
  constant KeyF19 (line 138) | KeyF19               Key = w32.VK_F19
  constant KeyF20 (line 139) | KeyF20               Key = w32.VK_F20
  constant KeyF21 (line 140) | KeyF21               Key = w32.VK_F21
  constant KeyF22 (line 141) | KeyF22               Key = w32.VK_F22
  constant KeyF23 (line 142) | KeyF23               Key = w32.VK_F23
  constant KeyF24 (line 143) | KeyF24               Key = w32.VK_F24
  constant KeyNumlock (line 144) | KeyNumlock           Key = w32.VK_NUMLOCK
  constant KeyScroll (line 145) | KeyScroll            Key = w32.VK_SCROLL
  constant KeyLShift (line 146) | KeyLShift            Key = w32.VK_LSHIFT
  constant KeyRShift (line 147) | KeyRShift            Key = w32.VK_RSHIFT
  constant KeyLControl (line 148) | KeyLControl          Key = w32.VK_LCONTROL
  constant KeyRControl (line 149) | KeyRControl          Key = w32.VK_RCONTROL
  constant KeyLAlt (line 150) | KeyLAlt              Key = w32.VK_LMENU
  constant KeyLMenu (line 151) | KeyLMenu             Key = w32.VK_LMENU
  constant KeyRAlt (line 152) | KeyRAlt              Key = w32.VK_RMENU
  constant KeyRMenu (line 153) | KeyRMenu             Key = w32.VK_RMENU
  constant KeyBrowserBack (line 154) | KeyBrowserBack       Key = w32.VK_BROWSER_BACK
  constant KeyBrowserForward (line 155) | KeyBrowserForward    Key = w32.VK_BROWSER_FORWARD
  constant KeyBrowserRefresh (line 156) | KeyBrowserRefresh    Key = w32.VK_BROWSER_REFRESH
  constant KeyBrowserStop (line 157) | KeyBrowserStop       Key = w32.VK_BROWSER_STOP
  constant KeyBrowserSearch (line 158) | KeyBrowserSearch     Key = w32.VK_BROWSER_SEARCH
  constant KeyBrowserFavorites (line 159) | KeyBrowserFavorites  Key = w32.VK_BROWSER_FAVORITES
  constant KeyBrowserHome (line 160) | KeyBrowserHome       Key = w32.VK_BROWSER_HOME
  constant KeyVolumeMute (line 161) | KeyVolumeMute        Key = w32.VK_VOLUME_MUTE
  constant KeyVolumeDown (line 162) | KeyVolumeDown        Key = w32.VK_VOLUME_DOWN
  constant KeyVolumeUp (line 163) | KeyVolumeUp          Key = w32.VK_VOLUME_UP
  constant KeyMediaNextTrack (line 164) | KeyMediaNextTrack    Key = w32.VK_MEDIA_NEXT_TRACK
  constant KeyMediaPrevTrack (line 165) | KeyMediaPrevTrack    Key = w32.VK_MEDIA_PREV_TRACK
  constant KeyMediaStop (line 166) | KeyMediaStop         Key = w32.VK_MEDIA_STOP
  constant KeyMediaPlayPause (line 167) | KeyMediaPlayPause    Key = w32.VK_MEDIA_PLAY_PAUSE
  constant KeyLaunchMail (line 168) | KeyLaunchMail        Key = w32.VK_LAUNCH_MAIL
  constant KeyLaunchMediaSelect (line 169) | KeyLaunchMediaSelect Key = w32.VK_LAUNCH_MEDIA_SELECT
  constant KeyLaunchApp1 (line 170) | KeyLaunchApp1        Key = w32.VK_LAUNCH_APP1
  constant KeyLaunchApp2 (line 171) | KeyLaunchApp2        Key = w32.VK_LAUNCH_APP2
  constant KeyOEM1 (line 172) | KeyOEM1              Key = w32.VK_OEM_1
  constant KeyOEMPlus (line 173) | KeyOEMPlus           Key = w32.VK_OEM_PLUS
  constant KeyOEMComma (line 174) | KeyOEMComma          Key = w32.VK_OEM_COMMA
  constant KeyOEMMinus (line 175) | KeyOEMMinus          Key = w32.VK_OEM_MINUS
  constant KeyOEMPeriod (line 176) | KeyOEMPeriod         Key = w32.VK_OEM_PERIOD
  constant KeyOEM2 (line 177) | KeyOEM2              Key = w32.VK_OEM_2
  constant KeyOEM3 (line 178) | KeyOEM3              Key = w32.VK_OEM_3
  constant KeyOEM4 (line 179) | KeyOEM4              Key = w32.VK_OEM_4
  constant KeyOEM5 (line 180) | KeyOEM5              Key = w32.VK_OEM_5
  constant KeyOEM6 (line 181) | KeyOEM6              Key = w32.VK_OEM_6
  constant KeyOEM7 (line 182) | KeyOEM7              Key = w32.VK_OEM_7
  constant KeyOEM8 (line 183) | KeyOEM8              Key = w32.VK_OEM_8
  constant KeyOEM102 (line 184) | KeyOEM102            Key = w32.VK_OEM_102
  constant KeyProcessKey (line 185) | KeyProcessKey        Key = w32.VK_PROCESSKEY
  constant KeyPacket (line 186) | KeyPacket            Key = w32.VK_PACKET
  constant KeyAttn (line 187) | KeyAttn              Key = w32.VK_ATTN
  constant KeyCRSel (line 188) | KeyCRSel             Key = w32.VK_CRSEL
  constant KeyEXSel (line 189) | KeyEXSel             Key = w32.VK_EXSEL
  constant KeyErEOF (line 190) | KeyErEOF             Key = w32.VK_EREOF
  constant KeyPlay (line 191) | KeyPlay              Key = w32.VK_PLAY
  constant KeyZoom (line 192) | KeyZoom              Key = w32.VK_ZOOM
  constant KeyNoName (line 193) | KeyNoName            Key = w32.VK_NONAME
  constant KeyPA1 (line 194) | KeyPA1               Key = w32.VK_PA1
  constant KeyOEMClear (line 195) | KeyOEMClear          Key = w32.VK_OEM_CLEAR
  type Modifiers (line 371) | type Modifiers
    method String (line 373) | func (m Modifiers) String() string {
  constant ModShift (line 387) | ModShift Modifiers = 1 << iota
  constant ModControl (line 388) | ModControl
  constant ModAlt (line 389) | ModAlt
  function ModifiersDown (line 392) | func ModifiersDown() Modifiers {
  type Shortcut (line 408) | type Shortcut struct
    method String (line 413) | func (s Shortcut) String() string {
  function AltDown (line 428) | func AltDown() bool {
  function ControlDown (line 432) | func ControlDown() bool {
  function ShiftDown (line 436) | func ShiftDown() bool {

FILE: label.go
  type Label (line 11) | type Label struct
    method WndProc (line 27) | func (lb *Label) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
  function NewLabel (line 15) | func NewLabel(parent Controller) *Label {

FILE: layout.go
  type Dockable (line 19) | type Dockable interface
  type DockAllow (line 35) | type DockAllow interface
  type Direction (line 43) | type Direction
  constant Top (line 46) | Top Direction = iota
  constant Bottom (line 47) | Bottom
  constant Left (line 48) | Left
  constant Right (line 49) | Right
  constant Fill (line 50) | Fill
  type LayoutControl (line 53) | type LayoutControl struct
  type LayoutControls (line 58) | type LayoutControls
    method Len (line 76) | func (lc LayoutControls) Len() int           { return len(lc) }
    method Swap (line 77) | func (lc LayoutControls) Swap(i, j int)      { lc[i], lc[j] = lc[j], l...
    method Less (line 78) | func (lc LayoutControls) Less(i, j int) bool { return lc[i].dir < lc[j...
  type SimpleDock (line 60) | type SimpleDock struct
    method Dock (line 87) | func (sd *SimpleDock) Dock(child Dockable, dir Direction) {
    method SaveState (line 92) | func (sd *SimpleDock) SaveState(w io.Writer) error {
    method LoadState (line 124) | func (sd *SimpleDock) LoadState(r io.Reader) error {
    method SaveStateFile (line 161) | func (sd *SimpleDock) SaveStateFile(file string) error {
    method LoadStateFile (line 170) | func (sd *SimpleDock) LoadStateFile(file string) error {
    method Update (line 179) | func (sd *SimpleDock) Update() {
  type CtlState (line 67) | type CtlState struct
  type LayoutState (line 71) | type LayoutState struct
  function NewSimpleDock (line 80) | func NewSimpleDock(parent DockAllow) *SimpleDock {

FILE: listview.go
  type ListItem (line 17) | type ListItem interface
  type ListItemChecker (line 23) | type ListItemChecker interface
  type ListItemSetter (line 29) | type ListItemSetter interface
  type StringListItem (line 34) | type StringListItem struct
    method Text (line 40) | func (s StringListItem) Text() []string          { return []string{s.D...
    method Checked (line 41) | func (s StringListItem) Checked() bool           { return s.Check }
    method SetChecked (line 42) | func (s StringListItem) SetChecked(checked bool) { s.Check = checked }
    method ImageIndex (line 43) | func (s StringListItem) ImageIndex() int         { return 0 }
  type ListView (line 45) | type ListView struct
    method setItemState (line 87) | func (lv *ListView) setItemState(i int, state, mask uint) {
    method EnableSingleSelect (line 93) | func (lv *ListView) EnableSingleSelect(enable bool) {
    method EnableSortHeader (line 97) | func (lv *ListView) EnableSortHeader(enable bool) {
    method EnableSortAscending (line 101) | func (lv *ListView) EnableSortAscending(enable bool) {
    method EnableEditLabels (line 105) | func (lv *ListView) EnableEditLabels(enable bool) {
    method EnableFullRowSelect (line 109) | func (lv *ListView) EnableFullRowSelect(enable bool) {
    method EnableDoubleBuffer (line 117) | func (lv *ListView) EnableDoubleBuffer(enable bool) {
    method EnableHotTrack (line 125) | func (lv *ListView) EnableHotTrack(enable bool) {
    method SetItemCount (line 133) | func (lv *ListView) SetItemCount(count int) bool {
    method ItemCount (line 137) | func (lv *ListView) ItemCount() int {
    method ItemAt (line 141) | func (lv *ListView) ItemAt(x, y int) ListItem {
    method Items (line 147) | func (lv *ListView) Items() (list []ListItem) {
    method AddColumn (line 154) | func (lv *ListView) AddColumn(caption string, width int) {
    method StretchLastColumn (line 169) | func (lv *ListView) StretchLastColumn() error {
    method CheckBoxes (line 180) | func (lv *ListView) CheckBoxes() bool {
    method SetCheckBoxes (line 185) | func (lv *ListView) SetCheckBoxes(value bool) {
    method applyImage (line 209) | func (lv *ListView) applyImage(lc *w32.LVITEM, imIndex int) {
    method AddItem (line 216) | func (lv *ListView) AddItem(item ListItem) {
    method InsertItem (line 220) | func (lv *ListView) InsertItem(item ListItem, index int) {
    method UpdateItem (line 246) | func (lv *ListView) UpdateItem(item ListItem) bool {
    method insertLvColumn (line 277) | func (lv *ListView) insertLvColumn(lvColumn *w32.LVCOLUMN, iCol int) {
    method insertLvItem (line 281) | func (lv *ListView) insertLvItem(lvItem *w32.LVITEM) {
    method setLvItem (line 285) | func (lv *ListView) setLvItem(lvItem *w32.LVITEM) {
    method DeleteAllItems (line 289) | func (lv *ListView) DeleteAllItems() bool {
    method DeleteItem (line 298) | func (lv *ListView) DeleteItem(item ListItem) error {
    method findIndexByItem (line 314) | func (lv *ListView) findIndexByItem(item ListItem) int {
    method findItemByIndex (line 328) | func (lv *ListView) findItemByIndex(i int) ListItem {
    method EnsureVisible (line 342) | func (lv *ListView) EnsureVisible(item ListItem) bool {
    method SelectedItem (line 349) | func (lv *ListView) SelectedItem() ListItem {
    method SetSelectedItem (line 356) | func (lv *ListView) SetSelectedItem(item ListItem) bool {
    method SelectedItems (line 366) | func (lv *ListView) SelectedItems() []ListItem {
    method SelectedCount (line 382) | func (lv *ListView) SelectedCount() uint {
    method SelectedIndex (line 387) | func (lv *ListView) SelectedIndex() int {
    method SetSelectedIndex (line 393) | func (lv *ListView) SetSelectedIndex(i int) {
    method SetImageList (line 397) | func (lv *ListView) SetImageList(imageList *ImageList) {
    method OnEndLabelEdit (line 403) | func (lv *ListView) OnEndLabelEdit() *EventManager {
    method OnDoubleClick (line 407) | func (lv *ListView) OnDoubleClick() *EventManager {
    method OnClick (line 411) | func (lv *ListView) OnClick() *EventManager {
    method OnKeyDown (line 415) | func (lv *ListView) OnKeyDown() *EventManager {
    method OnItemChanging (line 419) | func (lv *ListView) OnItemChanging() *EventManager {
    method OnItemChanged (line 423) | func (lv *ListView) OnItemChanged() *EventManager {
    method OnCheckChanged (line 427) | func (lv *ListView) OnCheckChanged() *EventManager {
    method OnViewChange (line 431) | func (lv *ListView) OnViewChange() *EventManager {
    method OnEndScroll (line 435) | func (lv *ListView) OnEndScroll() *EventManager {
    method WndProc (line 440) | func (lv *ListView) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
  function NewListView (line 66) | func NewListView(parent Controller) *ListView {

FILE: menu.go
  type Menu (line 28) | type Menu struct
    method Dispose (line 70) | func (m *Menu) Dispose() {
    method IsDisposed (line 77) | func (m *Menu) IsDisposed() bool {
    method Show (line 124) | func (m *Menu) Show() {
    method AddSubMenu (line 133) | func (m *Menu) AddSubMenu(text string) *MenuItem {
  type MenuItem (line 33) | type MenuItem struct
    method OnClick (line 202) | func (mi *MenuItem) OnClick() *EventManager {
    method AddSeparator (line 206) | func (mi *MenuItem) AddSeparator() {
    method AddItem (line 211) | func (mi *MenuItem) AddItem(text string, shortcut Shortcut) *MenuItem {
    method AddItemCheckable (line 216) | func (mi *MenuItem) AddItemCheckable(text string, shortcut Shortcut) *...
    method AddItemRadio (line 221) | func (mi *MenuItem) AddItemRadio(text string, shortcut Shortcut) *Menu...
    method AddItemWithBitmap (line 228) | func (mi *MenuItem) AddItemWithBitmap(text string, shortcut Shortcut, ...
    method AddSubMenu (line 233) | func (mi *MenuItem) AddSubMenu(text string) *MenuItem {
    method update (line 284) | func (mi *MenuItem) update() {
    method IsSeparator (line 296) | func (mi *MenuItem) IsSeparator() bool { return mi.text == "-" }
    method SetSeparator (line 297) | func (mi *MenuItem) SetSeparator()     { mi.text = "-" }
    method Enabled (line 299) | func (mi *MenuItem) Enabled() bool     { return mi.enabled }
    method SetEnabled (line 300) | func (mi *MenuItem) SetEnabled(b bool) { mi.enabled = b; mi.update() }
    method Checkable (line 302) | func (mi *MenuItem) Checkable() bool     { return mi.checkable }
    method SetCheckable (line 303) | func (mi *MenuItem) SetCheckable(b bool) { mi.checkable = b; mi.update...
    method Checked (line 305) | func (mi *MenuItem) Checked() bool { return mi.checked }
    method SetChecked (line 306) | func (mi *MenuItem) SetChecked(b bool) {
    method Text (line 320) | func (mi *MenuItem) Text() string     { return mi.text }
    method SetText (line 321) | func (mi *MenuItem) SetText(s string) { mi.text = s; mi.update() }
    method Image (line 323) | func (mi *MenuItem) Image() *Bitmap     { return mi.image }
    method SetImage (line 324) | func (mi *MenuItem) SetImage(b *Bitmap) { mi.image = b; mi.update() }
    method ToolTip (line 326) | func (mi *MenuItem) ToolTip() string     { return mi.toolTip }
    method SetToolTip (line 327) | func (mi *MenuItem) SetToolTip(s string) { mi.toolTip = s; mi.update() }
    method updateRadioGroup (line 329) | func (mi *MenuItem) updateRadioGroup() {
  type RadioGroup (line 52) | type RadioGroup struct
  function NewContextMenu (line 57) | func NewContextMenu() *MenuItem {
  function initMenuItemInfoFromAction (line 81) | func initMenuItemInfoFromAction(mii *w32.MENUITEMINFO, a *MenuItem) {
  function updateRadioGroups (line 143) | func updateRadioGroups() {
  function addMenuItem (line 242) | func addMenuItem(hMenu, hSubMenu w32.HMENU, text string, shortcut Shortc...
  function indexInObserver (line 269) | func indexInObserver(a *MenuItem) int {
  function findMenuItemByID (line 280) | func findMenuItemByID(id int) *MenuItem {

FILE: mousecontrol.go
  type MouseControl (line 12) | type MouseControl struct
    method Init (line 17) | func (cc *MouseControl) Init(parent Controller, className string, exSt...
    method WndProc (line 27) | func (cc *MouseControl) WndProc(msg uint32, wparam, lparam uintptr) ui...

FILE: msghandlerregistry.go
  function RegMsgHandler (line 12) | func RegMsgHandler(controller Controller) {
  function UnRegMsgHandler (line 16) | func UnRegMsgHandler(hwnd w32.HWND) {
  function GetMsgHandler (line 20) | func GetMsgHandler(hwnd w32.HWND) Controller {

FILE: panel.go
  type Panel (line 13) | type Panel struct
    method SetLayout (line 33) | func (pa *Panel) SetLayout(mng LayoutManager) {
    method WndProc (line 37) | func (pa *Panel) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
  function NewPanel (line 18) | func NewPanel(parent Controller) *Panel {
  type ErrorPanel (line 52) | type ErrorPanel struct
    method init (line 71) | func (epa *ErrorPanel) init(parent Controller) {
    method SetMargin (line 80) | func (epa *ErrorPanel) SetMargin(margin int) {
    method Printf (line 84) | func (epa *ErrorPanel) Printf(format string, v ...interface{}) {
    method Errorf (line 89) | func (epa *ErrorPanel) Errorf(format string, v ...interface{}) {
    method ShowAsError (line 94) | func (epa *ErrorPanel) ShowAsError(show bool) {
    method WndProc (line 103) | func (epa *ErrorPanel) WndProc(msg uint32, wparam, lparam uintptr) uin...
  function NewErrorPanel (line 59) | func NewErrorPanel(parent Controller) *ErrorPanel {
  type MultiPanel (line 124) | type MultiPanel struct
    method Count (line 145) | func (mpa *MultiPanel) Count() int { return len(mpa.panels) }
    method AddPanel (line 148) | func (mpa *MultiPanel) AddPanel(panel *Panel) {
    method ReplacePanel (line 157) | func (mpa *MultiPanel) ReplacePanel(index int, panel *Panel) {
    method DeletePanel (line 162) | func (mpa *MultiPanel) DeletePanel(index int) {
    method Current (line 166) | func (mpa *MultiPanel) Current() int {
    method SetCurrent (line 170) | func (mpa *MultiPanel) SetCurrent(index int) {
    method WndProc (line 188) | func (mpa *MultiPanel) WndProc(msg uint32, wparam, lparam uintptr) uin...
  function NewMultiPanel (line 130) | func NewMultiPanel(parent Controller) *MultiPanel {

FILE: path.go
  function knownFolderPath (line 17) | func knownFolderPath(id w32.CSIDL) (string, error) {
  function AppDataPath (line 27) | func AppDataPath() (string, error) {
  function CommonAppDataPath (line 31) | func CommonAppDataPath() (string, error) {
  function LocalAppDataPath (line 35) | func LocalAppDataPath() (string, error) {
  function EnsureAppDataPath (line 40) | func EnsureAppDataPath(company, product string) (string, error) {
  function DriveNames (line 56) | func DriveNames() ([]string, error) {

FILE: pen.go
  type Pen (line 12) | type Pen struct
    method Style (line 42) | func (pen *Pen) Style() uint {
    method Brush (line 46) | func (pen *Pen) Brush() *Brush {
    method GetHPEN (line 50) | func (pen *Pen) GetHPEN() w32.HPEN {
    method Dispose (line 54) | func (pen *Pen) Dispose() {
  function NewPen (line 18) | func NewPen(style uint, width uint, brush *Brush) *Pen {
  function NewNullPen (line 31) | func NewNullPen() *Pen {

FILE: progressbar.go
  type ProgressBar (line 11) | type ProgressBar struct
    method Value (line 25) | func (pr *ProgressBar) Value() int {
    method SetValue (line 30) | func (pr *ProgressBar) SetValue(v int) {
    method Range (line 34) | func (pr *ProgressBar) Range() (min, max uint) {
    method SetRange (line 40) | func (pr *ProgressBar) SetRange(min, max int) {
    method WndProc (line 44) | func (pr *ProgressBar) WndProc(msg uint32, wparam, lparam uintptr) uin...
  function NewProgressBar (line 15) | func NewProgressBar(parent Controller) *ProgressBar {

FILE: rect.go
  type Rect (line 12) | type Rect struct
    method Data (line 31) | func (re *Rect) Data() (left, top, right, bottom int32) {
    method Width (line 39) | func (re *Rect) Width() int {
    method Height (line 43) | func (re *Rect) Height() int {
    method GetW32Rect (line 47) | func (re *Rect) GetW32Rect() *w32.RECT {
    method Set (line 51) | func (re *Rect) Set(left, top, right, bottom int) {
    method IsEqual (line 55) | func (re *Rect) IsEqual(rect *Rect) bool {
    method Inflate (line 59) | func (re *Rect) Inflate(x, y int) {
    method Intersect (line 63) | func (re *Rect) Intersect(src *Rect) {
    method IsEmpty (line 67) | func (re *Rect) IsEmpty() bool {
    method Offset (line 71) | func (re *Rect) Offset(x, y int) {
    method IsPointIn (line 75) | func (re *Rect) IsPointIn(x, y int) bool {
    method Substract (line 79) | func (re *Rect) Substract(src *Rect) {
    method Union (line 83) | func (re *Rect) Union(src *Rect) {
  function NewEmptyRect (line 16) | func NewEmptyRect() *Rect {
  function NewRect (line 23) | func NewRect(left, top, right, bottom int) *Rect {

FILE: resizer.go
  type VResizer (line 11) | type VResizer struct
    method SetControl (line 37) | func (sp *VResizer) SetControl(control1, control2 Dockable, dir Direct...
    method update (line 85) | func (sp *VResizer) update(x int) {
    method WndProc (line 101) | func (sp *VResizer) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
  function NewVResizer (line 22) | func NewVResizer(parent Controller) *VResizer {
  type HResizer (line 132) | type HResizer struct
    method SetControl (line 158) | func (sp *HResizer) SetControl(control1, control2 Dockable, dir Direct...
    method update (line 168) | func (sp *HResizer) update(y int) {
    method WndProc (line 185) | func (sp *HResizer) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
  function NewHResizer (line 142) | func NewHResizer(parent Controller) *HResizer {

FILE: scrollview.go
  type ScrollView (line 13) | type ScrollView struct
    method SetChild (line 33) | func (sv *ScrollView) SetChild(child Dockable) {
    method UpdateScrollBars (line 37) | func (sv *ScrollView) UpdateScrollBars() {
    method scroll (line 58) | func (sv *ScrollView) scroll(sb int32, cmd uint16) int {
    method WndProc (line 98) | func (sv *ScrollView) WndProc(msg uint32, wparam, lparam uintptr) uint...
  function NewScrollView (line 18) | func NewScrollView(parent Controller) *ScrollView {

FILE: slider.go
  type Slider (line 9) | type Slider struct
    method OnScroll (line 31) | func (tb *Slider) OnScroll() *EventManager {
    method Value (line 35) | func (tb *Slider) Value() int {
    method SetValue (line 40) | func (tb *Slider) SetValue(v int) {
    method Range (line 45) | func (tb *Slider) Range() (min, max int) {
    method SetRange (line 51) | func (tb *Slider) SetRange(min, max int) {
    method SetPage (line 55) | func (tb *Slider) SetPage(pagesize int) {
    method WndProc (line 59) | func (tb *Slider) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
  function NewSlider (line 16) | func NewSlider(parent Controller) *Slider {

FILE: tabview.go
  type TabView (line 15) | type TabView struct
    method Panels (line 36) | func (tv *TabView) Panels() *MultiPanel {
    method tcitemFromPage (line 40) | func (tv *TabView) tcitemFromPage(panel *Panel) *w32.TCITEM {
    method AddPanel (line 50) | func (tv *TabView) AddPanel(text string) *Panel {
    method DeletePanel (line 66) | func (tv *TabView) DeletePanel(index int) {
    method Current (line 77) | func (tv *TabView) Current() int {
    method SetCurrent (line 81) | func (tv *TabView) SetCurrent(index int) {
    method WndProc (line 91) | func (tv *TabView) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
  function NewTabView (line 22) | func NewTabView(parent Controller) *TabView {

FILE: toolbar.go
  type Toolbar (line 14) | type Toolbar struct
    method SetImageList (line 86) | func (tb *Toolbar) SetImageList(imageList *ImageList) {
    method initButton (line 91) | func (tb *Toolbar) initButton(btn *ToolButton, state, style *byte, ima...
    method update (line 118) | func (tb *Toolbar) update(btn *ToolButton) {
    method AddSeparator (line 138) | func (tb *Toolbar) AddSeparator() {
    method AddButton (line 143) | func (tb *Toolbar) AddButton(text string, image int) *ToolButton {
    method WndProc (line 168) | func (tb *Toolbar) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
  type ToolButton (line 21) | type ToolButton struct
    method OnClick (line 33) | func (bt *ToolButton) OnClick() *EventManager {
    method update (line 37) | func (bt *ToolButton) update() { bt.tb.update(bt) }
    method IsSeparator (line 39) | func (bt *ToolButton) IsSeparator() bool { return bt.text == "-" }
    method SetSeparator (line 40) | func (bt *ToolButton) SetSeparator()     { bt.text = "-" }
    method Enabled (line 42) | func (bt *ToolButton) Enabled() bool     { return bt.enabled }
    method SetEnabled (line 43) | func (bt *ToolButton) SetEnabled(b bool) { bt.enabled = b; bt.update() }
    method Checkable (line 45) | func (bt *ToolButton) Checkable() bool     { return bt.checkable }
    method SetCheckable (line 46) | func (bt *ToolButton) SetCheckable(b bool) { bt.checkable = b; bt.upda...
    method Checked (line 48) | func (bt *ToolButton) Checked() bool     { return bt.checked }
    method SetChecked (line 49) | func (bt *ToolButton) SetChecked(b bool) { bt.checked = b; bt.update() }
    method Text (line 51) | func (bt *ToolButton) Text() string     { return bt.text }
    method SetText (line 52) | func (bt *ToolButton) SetText(s string) { bt.text = s; bt.update() }
    method Image (line 54) | func (bt *ToolButton) Image() int     { return bt.image }
    method SetImage (line 55) | func (bt *ToolButton) SetImage(i int) { bt.image = i; bt.update() }
  function NewHToolbar (line 58) | func NewHToolbar(parent Controller) *Toolbar {
  function NewToolbar (line 64) | func NewToolbar(parent Controller) *Toolbar {
  function newToolbar (line 69) | func newToolbar(parent Controller, style uint) *Toolbar {

FILE: tooltip.go
  type ToolTip (line 15) | type ToolTip struct
    method SetTip (line 28) | func (tp *ToolTip) SetTip(tool Controller, tip string) bool {
    method WndProc (line 41) | func (tp *ToolTip) WndProc(msg uint, wparam, lparam uintptr) uintptr {
  function NewToolTip (line 19) | func NewToolTip(parent Controller) *ToolTip {

FILE: treeview.go
  type TreeItem (line 16) | type TreeItem interface
  type treeViewItemInfo (line 21) | type treeViewItemInfo struct
  type StringTreeItem (line 27) | type StringTreeItem struct
    method Text (line 32) | func (s StringTreeItem) Text() string    { return s.Data }
    method ImageIndex (line 33) | func (s StringTreeItem) ImageIndex() int { return s.Image }
  type TreeView (line 35) | type TreeView struct
    method EnableDoubleBuffer (line 70) | func (tv *TreeView) EnableDoubleBuffer(enable bool) {
    method SelectedItem (line 79) | func (tv *TreeView) SelectedItem() TreeItem {
    method SetSelectedItem (line 83) | func (tv *TreeView) SetSelectedItem(item TreeItem) bool {
    method ItemAt (line 100) | func (tv *TreeView) ItemAt(x, y int) TreeItem {
    method Items (line 109) | func (tv *TreeView) Items() (list []TreeItem) {
    method InsertItem (line 116) | func (tv *TreeView) InsertItem(item, parent, insertAfter TreeItem) err...
    method UpdateItem (line 155) | func (tv *TreeView) UpdateItem(item TreeItem) bool {
    method DeleteItem (line 174) | func (tv *TreeView) DeleteItem(item TreeItem) bool {
    method DeleteAllItems (line 189) | func (tv *TreeView) DeleteAllItems() bool {
    method Expand (line 199) | func (tv *TreeView) Expand(item TreeItem) bool {
    method Collapse (line 206) | func (tv *TreeView) Collapse(item TreeItem) bool {
    method EnsureVisible (line 213) | func (tv *TreeView) EnsureVisible(item TreeItem) bool {
    method SetImageList (line 220) | func (tv *TreeView) SetImageList(imageList *ImageList) {
    method applyImage (line 225) | func (tv *TreeView) applyImage(tc *w32.TVITEM, item TreeItem) {
    method OnSelectedChange (line 233) | func (tv *TreeView) OnSelectedChange() *EventManager {
    method OnExpand (line 237) | func (tv *TreeView) OnExpand() *EventManager {
    method OnCollapse (line 241) | func (tv *TreeView) OnCollapse() *EventManager {
    method OnViewChange (line 245) | func (tv *TreeView) OnViewChange() *EventManager {
    method WndProc (line 250) | func (tv *TreeView) WndProc(msg uint32, wparam, lparam uintptr) uintptr {
  function NewTreeView (line 49) | func NewTreeView(parent Controller) *TreeView {

FILE: utils.go
  function internalTrackMouseEvent (line 16) | func internalTrackMouseEvent(hwnd w32.HWND) {
  function ToggleStyle (line 26) | func ToggleStyle(hwnd w32.HWND, b bool, style int) {
  function ToggleExStyle (line 38) | func ToggleExStyle(hwnd w32.HWND, b bool, style int) {
  function CreateWindow (line 50) | func CreateWindow(className string, parent Controller, exStyle, style ui...
  function RegisterClass (line 79) | func RegisterClass(className string, wndproc uintptr) {
  function getMonitorInfo (line 100) | func getMonitorInfo(hwnd w32.HWND) *w32.MONITORINFO {
  function getWindowInfo (line 107) | func getWindowInfo(hwnd w32.HWND) *w32.WINDOWINFO {
  function RegClassOnlyOnce (line 114) | func RegClassOnlyOnce(className string) {
  function ScreenToClientRect (line 129) | func ScreenToClientRect(hwnd w32.HWND, rect *w32.RECT) *Rect {

FILE: w32/comctl32.go
  function InitCommonControlsEx (line 27) | func InitCommonControlsEx(lpInitCtrls *INITCOMMONCONTROLSEX) bool {
  function ImageList_Create (line 34) | func ImageList_Create(cx, cy int, flags uint, cInitial, cGrow int) HIMAG...
  function ImageList_Destroy (line 49) | func ImageList_Destroy(himl HIMAGELIST) bool {
  function ImageList_GetImageCount (line 56) | func ImageList_GetImageCount(himl HIMAGELIST) int {
  function ImageList_SetImageCount (line 63) | func ImageList_SetImageCount(himl HIMAGELIST, uNewCount uint) bool {
  function ImageList_Add (line 71) | func ImageList_Add(himl HIMAGELIST, hbmImage, hbmMask HBITMAP) int {
  function ImageList_ReplaceIcon (line 80) | func ImageList_ReplaceIcon(himl HIMAGELIST, i int, hicon HICON) int {
  function ImageList_AddIcon (line 89) | func ImageList_AddIcon(himl HIMAGELIST, hicon HICON) int {
  function ImageList_Remove (line 93) | func ImageList_Remove(himl HIMAGELIST, i int) bool {
  function ImageList_RemoveAll (line 101) | func ImageList_RemoveAll(himl HIMAGELIST) bool {
  function TrackMouseEvent (line 105) | func TrackMouseEvent(tme *TRACKMOUSEEVENT) bool {

FILE: w32/comdlg32.go
  function GetOpenFileName (line 21) | func GetOpenFileName(ofn *OPENFILENAME) bool {
  function GetSaveFileName (line 28) | func GetSaveFileName(ofn *OPENFILENAME) bool {
  function CommDlgExtendedError (line 35) | func CommDlgExtendedError() uint {

FILE: w32/constants.go
  constant FALSE (line 9) | FALSE = 0
  constant TRUE (line 10) | TRUE  = 1
  constant NO_ERROR (line 14) | NO_ERROR                         = 0
  constant ERROR_SUCCESS (line 15) | ERROR_SUCCESS                    = 0
  constant ERROR_FILE_NOT_FOUND (line 16) | ERROR_FILE_NOT_FOUND             = 2
  constant ERROR_PATH_NOT_FOUND (line 17) | ERROR_PATH_NOT_FOUND             = 3
  constant ERROR_ACCESS_DENIED (line 18) | ERROR_ACCESS_DENIED              = 5
  constant ERROR_INVALID_HANDLE (line 19) | ERROR_INVALID_HANDLE             = 6
  constant ERROR_BAD_FORMAT (line 20) | ERROR_BAD_FORMAT                 = 11
  constant ERROR_INVALID_NAME (line 21) | ERROR_INVALID_NAME               = 123
  constant ERROR_MORE_DATA (line 22) | ERROR_MORE_DATA                  = 234
  constant ERROR_NO_MORE_ITEMS (line 23) | ERROR_NO_MORE_ITEMS              = 259
  constant ERROR_INVALID_SERVICE_CONTROL (line 24) | ERROR_INVALID_SERVICE_CONTROL    = 1052
  constant ERROR_SERVICE_REQUEST_TIMEOUT (line 25) | ERROR_SERVICE_REQUEST_TIMEOUT    = 1053
  constant ERROR_SERVICE_NO_THREAD (line 26) | ERROR_SERVICE_NO_THREAD          = 1054
  constant ERROR_SERVICE_DATABASE_LOCKED (line 27) | ERROR_SERVICE_DATABASE_LOCKED    = 1055
  constant ERROR_SERVICE_ALREADY_RUNNING (line 28) | ERROR_SERVICE_ALREADY_RUNNING    = 1056
  constant ERROR_SERVICE_DISABLED (line 29) | ERROR_SERVICE_DISABLED           = 1058
  constant ERROR_SERVICE_DOES_NOT_EXIST (line 30) | ERROR_SERVICE_DOES_NOT_EXIST     = 1060
  constant ERROR_SERVICE_CANNOT_ACCEPT_CTRL (line 31) | ERROR_SERVICE_CANNOT_ACCEPT_CTRL = 1061
  constant ERROR_SERVICE_NOT_ACTIVE (line 32) | ERROR_SERVICE_NOT_ACTIVE         = 1062
  constant ERROR_DATABASE_DOES_NOT_EXIST (line 33) | ERROR_DATABASE_DOES_NOT_EXIST    = 1065
  constant ERROR_SERVICE_DEPENDENCY_FAIL (line 34) | ERROR_SERVICE_DEPENDENCY_FAIL    = 1068
  constant ERROR_SERVICE_LOGON_FAILED (line 35) | ERROR_SERVICE_LOGON_FAILED       = 1069
  constant ERROR_SERVICE_MARKED_FOR_DELETE (line 36) | ERROR_SERVICE_MARKED_FOR_DELETE  = 1072
  constant ERROR_SERVICE_DEPENDENCY_DELETED (line 37) | ERROR_SERVICE_DEPENDENCY_DELETED = 1075
  constant SE_ERR_FNF (line 41) | SE_ERR_FNF             = 2
  constant SE_ERR_PNF (line 42) | SE_ERR_PNF             = 3
  constant SE_ERR_ACCESSDENIED (line 43) | SE_ERR_ACCESSDENIED    = 5
  constant SE_ERR_OOM (line 44) | SE_ERR_OOM             = 8
  constant SE_ERR_DLLNOTFOUND (line 45) | SE_ERR_DLLNOTFOUND     = 32
  constant SE_ERR_SHARE (line 46) | SE_ERR_SHARE           = 26
  constant SE_ERR_ASSOCINCOMPLETE (line 47) | SE_ERR_ASSOCINCOMPLETE = 27
  constant SE_ERR_DDETIMEOUT (line 48) | SE_ERR_DDETIMEOUT      = 28
  constant SE_ERR_DDEFAIL (line 49) | SE_ERR_DDEFAIL         = 29
  constant SE_ERR_DDEBUSY (line 50) | SE_ERR_DDEBUSY         = 30
  constant SE_ERR_NOASSOC (line 51) | SE_ERR_NOASSOC         = 31
  constant CW_USEDEFAULT (line 55) | CW_USEDEFAULT = ^0x7fffffff
  constant IMAGE_BITMAP (line 59) | IMAGE_BITMAP      = 0
  constant IMAGE_ICON (line 60) | IMAGE_ICON        = 1
  constant IMAGE_CURSOR (line 61) | IMAGE_CURSOR      = 2
  constant IMAGE_ENHMETAFILE (line 62) | IMAGE_ENHMETAFILE = 3
  constant SW_HIDE (line 67) | SW_HIDE            = 0
  constant SW_NORMAL (line 68) | SW_NORMAL          = 1
  constant SW_SHOWNORMAL (line 69) | SW_SHOWNORMAL      = 1
  constant SW_SHOWMINIMIZED (line 70) | SW_SHOWMINIMIZED   = 2
  constant SW_MAXIMIZE (line 71) | SW_MAXIMIZE        = 3
  constant SW_SHOWMAXIMIZED (line 72) | SW_SHOWMAXIMIZED   = 3
  constant SW_SHOWNOACTIVATE (line 73) | SW_SHOWNOACTIVATE  = 4
  constant SW_SHOW (line 74) | SW_SHOW            = 5
  constant SW_MINIMIZE (line 75) | SW_MINIMIZE        = 6
  constant SW_SHOWMINNOACTIVE (line 76) | SW_SHOWMINNOACTIVE = 7
  constant SW_SHOWNA (line 77) | SW_SHOWNA          = 8
  constant SW_RESTORE (line 78) | SW_RESTORE         = 9
  constant SW_SHOWDEFAULT (line 79) | SW_SHOWDEFAULT     = 10
  constant SW_FORCEMINIMIZE (line 80) | SW_FORCEMINIMIZE   = 11
  constant CS_VREDRAW (line 85) | CS_VREDRAW         = 0x00000001
  constant CS_HREDRAW (line 86) | CS_HREDRAW         = 0x00000002
  constant CS_KEYCVTWINDOW (line 87) | CS_KEYCVTWINDOW    = 0x00000004
  constant CS_DBLCLKS (line 88) | CS_DBLCLKS         = 0x00000008
  constant CS_OWNDC (line 89) | CS_OWNDC           = 0x00000020
  constant CS_CLASSDC (line 90) | CS_CLASSDC         = 0x00000040
  constant CS_PARENTDC (line 91) | CS_PARENTDC        = 0x00000080
  constant CS_NOKEYCVT (line 92) | CS_NOKEYCVT        = 0x00000100
  constant CS_NOCLOSE (line 93) | CS_NOCLOSE         = 0x00000200
  constant CS_SAVEBITS (line 94) | CS_SAVEBITS        = 0x00000800
  constant CS_BYTEALIGNCLIENT (line 95) | CS_BYTEALIGNCLIENT = 0x00001000
  constant CS_BYTEALIGNWINDOW (line 96) | CS_BYTEALIGNWINDOW = 0x00002000
  constant CS_GLOBALCLASS (line 97) | CS_GLOBALCLASS     = 0x00004000
  constant CS_IME (line 98) | CS_IME             = 0x00010000
  constant CS_DROPSHADOW (line 99) | CS_DROPSHADOW      = 0x00020000
  constant IDC_ARROW (line 104) | IDC_ARROW       = 32512
  constant IDC_IBEAM (line 105) | IDC_IBEAM       = 32513
  constant IDC_WAIT (line 106) | IDC_WAIT        = 32514
  constant IDC_CROSS (line 107) | IDC_CROSS       = 32515
  constant IDC_UPARROW (line 108) | IDC_UPARROW     = 32516
  constant IDC_SIZENWSE (line 109) | IDC_SIZENWSE    = 32642
  constant IDC_SIZENESW (line 110) | IDC_SIZENESW    = 32643
  constant IDC_SIZEWE (line 111) | IDC_SIZEWE      = 32644
  constant IDC_SIZENS (line 112) | IDC_SIZENS      = 32645
  constant IDC_SIZEALL (line 113) | IDC_SIZEALL     = 32646
  constant IDC_NO (line 114) | IDC_NO          = 32648
  constant IDC_HAND (line 115) | IDC_HAND        = 32649
  constant IDC_APPSTARTING (line 116) | IDC_APPSTARTING = 32650
  constant IDC_HELP (line 117) | IDC_HELP        = 32651
  constant IDC_ICON (line 118) | IDC_ICON        = 32641
  constant IDC_SIZE (line 119) | IDC_SIZE        = 32640
  constant IDI_APPLICATION (line 124) | IDI_APPLICATION = 32512
  constant IDI_HAND (line 125) | IDI_HAND        = 32513
  constant IDI_QUESTION (line 126) | IDI_QUESTION    = 32514
  constant IDI_EXCLAMATION (line 127) | IDI_EXCLAMATION = 32515
  constant IDI_ASTERISK (line 128) | IDI_ASTERISK    = 32516
  constant IDI_WINLOGO (line 129) | IDI_WINLOGO     = 32517
  constant IDI_WARNING (line 130) | IDI_WARNING     = IDI_EXCLAMATION
  constant IDI_ERROR (line 131) | IDI_ERROR       = IDI_HAND
  constant IDI_INFORMATION (line 132) | IDI_INFORMATION = IDI_ASTERISK
  constant BS_3STATE (line 137) | BS_3STATE          = 5
  constant BS_AUTO3STATE (line 138) | BS_AUTO3STATE      = 6
  constant BS_AUTOCHECKBOX (line 139) | BS_AUTOCHECKBOX    = 3
  constant BS_AUTORADIOBUTTON (line 140) | BS_AUTORADIOBUTTON = 9
  constant BS_BITMAP (line 141) | BS_BITMAP          = 128
  constant BS_BOTTOM (line 142) | BS_BOTTOM          = 0x800
  constant BS_CENTER (line 143) | BS_CENTER          = 0x300
  constant BS_CHECKBOX (line 144) | BS_CHECKBOX        = 2
  constant BS_DEFPUSHBUTTON (line 145) | BS_DEFPUSHBUTTON   = 1
  constant BS_GROUPBOX (line 146) | BS_GROUPBOX        = 7
  constant BS_ICON (line 147) | BS_ICON            = 64
  constant BS_LEFT (line 148) | BS_LEFT            = 256
  constant BS_LEFTTEXT (line 149) | BS_LEFTTEXT        = 32
  constant BS_MULTILINE (line 150) | BS_MULTILINE       = 0x2000
  constant BS_NOTIFY (line 151) | BS_NOTIFY          = 0x4000
  constant BS_OWNERDRAW (line 152) | BS_OWNERDRAW       = 0xB
  constant BS_PUSHBUTTON (line 153) | BS_PUSHBUTTON      = 0
  constant BS_PUSHLIKE (line 154) | BS_PUSHLIKE        = 4096
  constant BS_RADIOBUTTON (line 155) | BS_RADIOBUTTON     = 4
  constant BS_RIGHT (line 156) | BS_RIGHT           = 512
  constant BS_RIGHTBUTTON (line 157) | BS_RIGHTBUTTON     = 32
  constant BS_TEXT (line 158) | BS_TEXT            = 0
  constant BS_TOP (line 159) | BS_TOP             = 0x400
  constant BS_USERBUTTON (line 160) | BS_USERBUTTON      = 8
  constant BS_VCENTER (line 161) | BS_VCENTER         = 0xC00
  constant BS_FLAT (line 162) | BS_FLAT            = 0x8000
  constant BS_SPLITBUTTON (line 163) | BS_SPLITBUTTON     = 0x000C
  constant BS_DEFSPLITBUTTON (line 164) | BS_DEFSPLITBUTTON  = 0x000D
  constant BST_CHECKED (line 169) | BST_CHECKED       = 1
  constant BST_INDETERMINATE (line 170) | BST_INDETERMINATE = 2
  constant BST_UNCHECKED (line 171) | BST_UNCHECKED     = 0
  constant BST_FOCUS (line 172) | BST_FOCUS         = 8
  constant BST_PUSHED (line 173) | BST_PUSHED        = 4
  constant COLOR_3DDKSHADOW (line 178) | COLOR_3DDKSHADOW              = 21
  constant COLOR_3DFACE (line 179) | COLOR_3DFACE                  = 15
  constant COLOR_3DHILIGHT (line 180) | COLOR_3DHILIGHT               = 20
  constant COLOR_3DHIGHLIGHT (line 181) | COLOR_3DHIGHLIGHT             = 20
  constant COLOR_3DLIGHT (line 182) | COLOR_3DLIGHT                 = 22
  constant COLOR_BTNHILIGHT (line 183) | COLOR_BTNHILIGHT              = 20
  constant COLOR_3DSHADOW (line 184) | COLOR_3DSHADOW                = 16
  constant COLOR_ACTIVEBORDER (line 185) | COLOR_ACTIVEBORDER            = 10
  constant COLOR_ACTIVECAPTION (line 186) | COLOR_ACTIVECAPTION           = 2
  constant COLOR_APPWORKSPACE (line 187) | COLOR_APPWORKSPACE            = 12
  constant COLOR_BACKGROUND (line 188) | COLOR_BACKGROUND              = 1
  constant COLOR_DESKTOP (line 189) | COLOR_DESKTOP                 = 1
  constant COLOR_BTNFACE (line 190) | COLOR_BTNFACE                 = 15
  constant COLOR_BTNHIGHLIGHT (line 191) | COLOR_BTNHIGHLIGHT            = 20
  constant COLOR_BTNSHADOW (line 192) | COLOR_BTNSHADOW               = 16
  constant COLOR_BTNTEXT (line 193) | COLOR_BTNTEXT                 = 18
  constant COLOR_CAPTIONTEXT (line 194) | COLOR_CAPTIONTEXT             = 9
  constant COLOR_GRAYTEXT (line 195) | COLOR_GRAYTEXT                = 17
  constant COLOR_HIGHLIGHT (line 196) | COLOR_HIGHLIGHT               = 13
  constant COLOR_HIGHLIGHTTEXT (line 197) | COLOR_HIGHLIGHTTEXT           = 14
  constant COLOR_INACTIVEBORDER (line 198) | COLOR_INACTIVEBORDER          = 11
  constant COLOR_INACTIVECAPTION (line 199) | COLOR_INACTIVECAPTION         = 3
  constant COLOR_INACTIVECAPTIONTEXT (line 200) | COLOR_INACTIVECAPTIONTEXT     = 19
  constant COLOR_INFOBK (line 201) | COLOR_INFOBK                  = 24
  constant COLOR_INFOTEXT (line 202) | COLOR_INFOTEXT                = 23
  constant COLOR_MENU (line 203) | COLOR_MENU                    = 4
  constant COLOR_MENUTEXT (line 204) | COLOR_MENUTEXT                = 7
  constant COLOR_SCROLLBAR (line 205) | COLOR_SCROLLBAR               = 0
  constant COLOR_WINDOW (line 206) | COLOR_WINDOW                  = 5
  constant COLOR_WINDOWFRAME (line 207) | COLOR_WINDOWFRAME             = 6
  constant COLOR_WINDOWTEXT (line 208) | COLOR_WINDOWTEXT              = 8
  constant COLOR_HOTLIGHT (line 209) | COLOR_HOTLIGHT                = 26
  constant COLOR_GRADIENTACTIVECAPTION (line 210) | COLOR_GRADIENTACTIVECAPTION   = 27
  constant COLOR_GRADIENTINACTIVECAPTION (line 211) | COLOR_GRADIENTINACTIVECAPTION = 28
  constant BM_CLICK (line 216) | BM_CLICK    = 245
  constant BM_GETCHECK (line 217) | BM_GETCHECK = 240
  constant BM_GETIMAGE (line 218) | BM_GETIMAGE = 246
  constant BM_GETSTATE (line 219) | BM_GETSTATE = 242
  constant BM_SETCHECK (line 220) | BM_SETCHECK = 241
  constant BM_SETIMAGE (line 221) | BM_SETIMAGE = 247
  constant BM_SETSTATE (line 222) | BM_SETSTATE = 243
  constant BM_SETSTYLE (line 223) | BM_SETSTYLE = 244
  constant BN_CLICKED (line 228) | BN_CLICKED       = 0
  constant BN_PAINT (line 229) | BN_PAINT         = 1
  constant BN_HILITE (line 230) | BN_HILITE        = 2
  constant BN_PUSHED (line 231) | BN_PUSHED        = BN_HILITE
  constant BN_UNHILITE (line 232) | BN_UNHILITE      = 3
  constant BN_UNPUSHED (line 233) | BN_UNPUSHED      = BN_UNHILITE
  constant BN_DISABLE (line 234) | BN_DISABLE       = 4
  constant BN_DOUBLECLICKED (line 235) | BN_DOUBLECLICKED = 5
  constant BN_DBLCLK (line 236) | BN_DBLCLK        = BN_DOUBLECLICKED
  constant BN_SETFOCUS (line 237) | BN_SETFOCUS      = 6
  constant BN_KILLFOCUS (line 238) | BN_KILLFOCUS     = 7
  constant TPM_CENTERALIGN (line 243) | TPM_CENTERALIGN     = 0x0004
  constant TPM_LEFTALIGN (line 244) | TPM_LEFTALIGN       = 0x0000
  constant TPM_RIGHTALIGN (line 245) | TPM_RIGHTALIGN      = 0x0008
  constant TPM_BOTTOMALIGN (line 246) | TPM_BOTTOMALIGN     = 0x0020
  constant TPM_TOPALIGN (line 247) | TPM_TOPALIGN        = 0x0000
  constant TPM_VCENTERALIGN (line 248) | TPM_VCENTERALIGN    = 0x0010
  constant TPM_NONOTIFY (line 249) | TPM_NONOTIFY        = 0x0080
  constant TPM_RETURNCMD (line 250) | TPM_RETURNCMD       = 0x0100
  constant TPM_LEFTBUTTON (line 251) | TPM_LEFTBUTTON      = 0x0000
  constant TPM_RIGHTBUTTON (line 252) | TPM_RIGHTBUTTON     = 0x0002
  constant TPM_HORNEGANIMATION (line 253) | TPM_HORNEGANIMATION = 0x0800
  constant TPM_HORPOSANIMATION (line 254) | TPM_HORPOSANIMATION = 0x0400
  constant TPM_NOANIMATION (line 255) | TPM_NOANIMATION     = 0x4000
  constant TPM_VERNEGANIMATION (line 256) | TPM_VERNEGANIMATION = 0x2000
  constant TPM_VERPOSANIMATION (line 257) | TPM_VERPOSANIMATION = 0x1000
  constant TPM_HORIZONTAL (line 258) | TPM_HORIZONTAL      = 0x0000
  constant TPM_VERTICAL (line 259) | TPM_VERTICAL        = 0x0040
  constant GWL_EXSTYLE (line 264) | GWL_EXSTYLE     = -20
  constant GWL_STYLE (line 265) | GWL_STYLE       = -16
  constant GWL_WNDPROC (line 266) | GWL_WNDPROC     = -4
  constant GWLP_WNDPROC (line 267) | GWLP_WNDPROC    = -4
  constant GWL_HINSTANCE (line 268) | GWL_HINSTANCE   = -6
  constant GWLP_HINSTANCE (line 269) | GWLP_HINSTANCE  = -6
  constant GWL_HWNDPARENT (line 270) | GWL_HWNDPARENT  = -8
  constant GWLP_HWNDPARENT (line 271) | GWLP_HWNDPARENT = -8
  constant GWL_ID (line 272) | GWL_ID          = -12
  constant GWLP_ID (line 273) | GWLP_ID         = -12
  constant GWL_USERDATA (line 274) | GWL_USERDATA    = -21
  constant GWLP_USERDATA (line 275) | GWLP_USERDATA   = -21
  constant WS_OVERLAPPED (line 280) | WS_OVERLAPPED       = 0x00000000
  constant WS_POPUP (line 281) | WS_POPUP            = 0x80000000
  constant WS_CHILD (line 282) | WS_CHILD            = 0x40000000
  constant WS_MINIMIZE (line 283) | WS_MINIMIZE         = 0x20000000
  constant WS_VISIBLE (line 284) | WS_VISIBLE          = 0x10000000
  constant WS_DISABLED (line 285) | WS_DISABLED         = 0x08000000
  constant WS_CLIPSIBLINGS (line 286) | WS_CLIPSIBLINGS     = 0x04000000
  constant WS_CLIPCHILDREN (line 287) | WS_CLIPCHILDREN     = 0x02000000
  constant WS_MAXIMIZE (line 288) | WS_MAXIMIZE         = 0x01000000
  constant WS_CAPTION (line 289) | WS_CAPTION          = 0x00C00000
  constant WS_BORDER (line 290) | WS_BORDER           = 0x00800000
  constant WS_DLGFRAME (line 291) | WS_DLGFRAME         = 0x00400000
  constant WS_VSCROLL (line 292) | WS_VSCROLL          = 0x00200000
  constant WS_HSCROLL (line 293) | WS_HSCROLL          = 0x00100000
  constant WS_SYSMENU (line 294) | WS_SYSMENU          = 0x00080000
  constant WS_THICKFRAME (line 295) | WS_THICKFRAME       = 0x00040000
  constant WS_GROUP (line 296) | WS_GROUP            = 0x00020000
  constant WS_TABSTOP (line 297) | WS_TABSTOP          = 0x00010000
  constant WS_MINIMIZEBOX (line 298) | WS_MINIMIZEBOX      = 0x00020000
  constant WS_MAXIMIZEBOX (line 299) | WS_MAXIMIZEBOX      = 0x00010000
  constant WS_TILED (line 300) | WS_TILED            = 0x00000000
  constant WS_ICONIC (line 301) | WS_ICONIC           = 0x20000000
  constant WS_SIZEBOX (line 302) | WS_SIZEBOX          = 0x00040000
  constant WS_OVERLAPPEDWINDOW (line 303) | WS_OVERLAPPEDWINDOW = 0x00000000 | 0x00C00000 | 0x00080000 | 0x00040000 ...
  constant WS_POPUPWINDOW (line 304) | WS_POPUPWINDOW      = 0x80000000 | 0x00800000 | 0x00080000
  constant WS_CHILDWINDOW (line 305) | WS_CHILDWINDOW      = 0x40000000
  constant WS_EX_DLGMODALFRAME (line 310) | WS_EX_DLGMODALFRAME       = 0x00000001
  constant WS_EX_NOPARENTNOTIFY (line 311) | WS_EX_NOPARENTNOTIFY      = 0x00000004
  constant WS_EX_TOPMOST (line 312) | WS_EX_TOPMOST             = 0x00000008
  constant WS_EX_ACCEPTFILES (line 313) | WS_EX_ACCEPTFILES         = 0x00000010
  constant WS_EX_TRANSPARENT (line 314) | WS_EX_TRANSPARENT         = 0x00000020
  constant WS_EX_MDICHILD (line 315) | WS_EX_MDICHILD            = 0x00000040
  constant WS_EX_TOOLWINDOW (line 316) | WS_EX_TOOLWINDOW          = 0x00000080
  constant WS_EX_WINDOWEDGE (line 317) | WS_EX_WINDOWEDGE          = 0x00000100
  constant WS_EX_CLIENTEDGE (line 318) | WS_EX_CLIENTEDGE          = 0x00000200
  constant WS_EX_CONTEXTHELP (line 319) | WS_EX_CONTEXTHELP         = 0x00000400
  constant WS_EX_RIGHT (line 320) | WS_EX_RIGHT               = 0x00001000
  constant WS_EX_LEFT (line 321) | WS_EX_LEFT                = 0x00000000
  constant WS_EX_RTLREADING (line 322) | WS_EX_RTLREADING          = 0x00002000
  constant WS_EX_LTRREADING (line 323) | WS_EX_LTRREADING          = 0x00000000
  constant WS_EX_LEFTSCROLLBAR (line 324) | WS_EX_LEFTSCROLLBAR       = 0x00004000
  constant WS_EX_RIGHTSCROLLBAR (line 325) | WS_EX_RIGHTSCROLLBAR      = 0x00000000
  constant WS_EX_CONTROLPARENT (line 326) | WS_EX_CONTROLPARENT       = 0x00010000
  constant WS_EX_STATICEDGE (line 327) | WS_EX_STATICEDGE          = 0x00020000
  constant WS_EX_APPWINDOW (line 328) | WS_EX_APPWINDOW           = 0x00040000
  constant WS_EX_OVERLAPPEDWINDOW (line 329) | WS_EX_OVERLAPPEDWINDOW    = 0x00000100 | 0x00000200
  constant WS_EX_PALETTEWINDOW (line 330) | WS_EX_PALETTEWINDOW       = 0x00000100 | 0x00000080 | 0x00000008
  constant WS_EX_LAYERED (line 331) | WS_EX_LAYERED             = 0x00080000
  constant WS_EX_NOINHERITLAYOUT (line 332) | WS_EX_NOINHERITLAYOUT     = 0x00100000
  constant WS_EX_NOREDIRECTIONBITMAP (line 333) | WS_EX_NOREDIRECTIONBITMAP = 0x00200000
  constant WS_EX_LAYOUTRTL (line 334) | WS_EX_LAYOUTRTL           = 0x00400000
  constant WS_EX_NOACTIVATE (line 335) | WS_EX_NOACTIVATE          = 0x08000000
  constant WM_APP (line 340) | WM_APP                    = 32768
  constant WM_ACTIVATE (line 341) | WM_ACTIVATE               = 6
  constant WM_ACTIVATEAPP (line 342) | WM_ACTIVATEAPP            = 28
  constant WM_AFXFIRST (line 343) | WM_AFXFIRST               = 864
  constant WM_AFXLAST (line 344) | WM_AFXLAST                = 895
  constant WM_ASKCBFORMATNAME (line 345) | WM_ASKCBFORMATNAME        = 780
  constant WM_CANCELJOURNAL (line 346) | WM_CANCELJOURNAL          = 75
  constant WM_CANCELMODE (line 347) | WM_CANCELMODE             = 31
  constant WM_CAPTURECHANGED (line 348) | WM_CAPTURECHANGED         = 533
  constant WM_CHANGECBCHAIN (line 349) | WM_CHANGECBCHAIN          = 781
  constant WM_CHAR (line 350) | WM_CHAR                   = 258
  constant WM_CHARTOITEM (line 351) | WM_CHARTOITEM             = 47
  constant WM_CHILDACTIVATE (line 352) | WM_CHILDACTIVATE          = 34
  constant WM_CLEAR (line 353) | WM_CLEAR                  = 771
  constant WM_CLOSE (line 354) | WM_CLOSE                  = 16
  constant WM_COMMAND (line 355) | WM_COMMAND                = 273
  constant WM_COMMNOTIFY (line 356) | WM_COMMNOTIFY             = 68
  constant WM_COMPACTING (line 357) | WM_COMPACTING             = 65
  constant WM_COMPAREITEM (line 358) | WM_COMPAREITEM            = 57
  constant WM_CONTEXTMENU (line 359) | WM_CONTEXTMENU            = 123
  constant WM_COPY (line 360) | WM_COPY                   = 769
  constant WM_COPYDATA (line 361) | WM_COPYDATA               = 74
  constant WM_CREATE (line 362) | WM_CREATE                 = 1
  constant WM_CTLCOLORBTN (line 363) | WM_CTLCOLORBTN            = 309
  constant WM_CTLCOLORDLG (line 364) | WM_CTLCOLORDLG            = 310
  constant WM_CTLCOLOREDIT (line 365) | WM_CTLCOLOREDIT           = 307
  constant WM_CTLCOLORLISTBOX (line 366) | WM_CTLCOLORLISTBOX        = 308
  constant WM_CTLCOLORMSGBOX (line 367) | WM_CTLCOLORMSGBOX         = 306
  constant WM_CTLCOLORSCROLLBAR (line 368) | WM_CTLCOLORSCROLLBAR      = 311
  constant WM_CTLCOLORSTATIC (line 369) | WM_CTLCOLORSTATIC         = 312
  constant WM_CUT (line 370) | WM_CUT                    = 768
  constant WM_DEADCHAR (line 371) | WM_DEADCHAR               = 259
  constant WM_DELETEITEM (line 372) | WM_DELETEITEM             = 45
  constant WM_DESTROY (line 373) | WM_DESTROY                = 2
  constant WM_DESTROYCLIPBOARD (line 374) | WM_DESTROYCLIPBOARD       = 775
  constant WM_DEVICECHANGE (line 375) | WM_DEVICECHANGE           = 537
  constant WM_DEVMODECHANGE (line 376) | WM_DEVMODECHANGE          = 27
  constant WM_DISPLAYCHANGE (line 377) | WM_DISPLAYCHANGE          = 126
  constant WM_DRAWCLIPBOARD (line 378) | WM_DRAWCLIPBOARD          = 776
  constant WM_DRAWITEM (line 379) | WM_DRAWITEM               = 43
  constant WM_DROPFILES (line 380) | WM_DROPFILES              = 563
  constant WM_ENABLE (line 381) | WM_ENABLE                 = 10
  constant WM_ENDSESSION (line 382) | WM_ENDSESSION             = 22
  constant WM_ENTERIDLE (line 383) | WM_ENTERIDLE              = 289
  constant WM_ENTERMENULOOP (line 384) | WM_ENTERMENULOOP          = 529
  constant WM_ENTERSIZEMOVE (line 385) | WM_ENTERSIZEMOVE          = 561
  constant WM_ERASEBKGND (line 386) | WM_ERASEBKGND             = 20
  constant WM_EXITMENULOOP (line 387) | WM_EXITMENULOOP           = 530
  constant WM_EXITSIZEMOVE (line 388) | WM_EXITSIZEMOVE           = 562
  constant WM_FONTCHANGE (line 389) | WM_FONTCHANGE             = 29
  constant WM_GETDLGCODE (line 390) | WM_GETDLGCODE             = 135
  constant WM_GETFONT (line 391) | WM_GETFONT                = 49
  constant WM_GETHOTKEY (line 392) | WM_GETHOTKEY              = 51
  constant WM_GETICON (line 393) | WM_GETICON                = 127
  constant WM_GETMINMAXINFO (line 394) | WM_GETMINMAXINFO          = 36
  constant WM_GETTEXT (line 395) | WM_GETTEXT                = 13
  constant WM_GETTEXTLENGTH (line 396) | WM_GETTEXTLENGTH          = 14
  constant WM_HANDHELDFIRST (line 397) | WM_HANDHELDFIRST          = 856
  constant WM_HANDHELDLAST (line 398) | WM_HANDHELDLAST           = 863
  constant WM_HELP (line 399) | WM_HELP                   = 83
  constant WM_HOTKEY (line 400) | WM_HOTKEY                 = 786
  constant WM_HSCROLL (line 401) | WM_HSCROLL                = 276
  constant WM_HSCROLLCLIPBOARD (line 402) | WM_HSCROLLCLIPBOARD       = 782
  constant WM_ICONERASEBKGND (line 403) | WM_ICONERASEBKGND         = 39
  constant WM_INITDIALOG (line 404) | WM_INITDIALOG             = 272
  constant WM_INITMENU (line 405) | WM_INITMENU               = 278
  constant WM_INITMENUPOPUP (line 406) | WM_INITMENUPOPUP          = 279
  constant WM_INPUT (line 407) | WM_INPUT                  = 0x00FF
  constant WM_INPUTLANGCHANGE (line 408) | WM_INPUTLANGCHANGE        = 81
  constant WM_INPUTLANGCHANGEREQUEST (line 409) | WM_INPUTLANGCHANGEREQUEST = 80
  constant WM_KEYDOWN (line 410) | WM_KEYDOWN                = 256
  constant WM_KEYUP (line 411) | WM_KEYUP                  = 257
  constant WM_KILLFOCUS (line 412) | WM_KILLFOCUS              = 8
  constant WM_MDIACTIVATE (line 413) | WM_MDIACTIVATE            = 546
  constant WM_MDICASCADE (line 414) | WM_MDICASCADE             = 551
  constant WM_MDICREATE (line 415) | WM_MDICREATE              = 544
  constant WM_MDIDESTROY (line 416) | WM_MDIDESTROY             = 545
  constant WM_MDIGETACTIVE (line 417) | WM_MDIGETACTIVE           = 553
  constant WM_MDIICONARRANGE (line 418) | WM_MDIICONARRANGE         = 552
  constant WM_MDIMAXIMIZE (line 419) | WM_MDIMAXIMIZE            = 549
  constant WM_MDINEXT (line 420) | WM_MDINEXT                = 548
  constant WM_MDIREFRESHMENU (line 421) | WM_MDIREFRESHMENU         = 564
  constant WM_MDIRESTORE (line 422) | WM_MDIRESTORE             = 547
  constant WM_MDISETMENU (line 423) | WM_MDISETMENU             = 560
  constant WM_MDITILE (line 424) | WM_MDITILE                = 550
  constant WM_MEASUREITEM (line 425) | WM_MEASUREITEM            = 44
  constant WM_GETOBJECT (line 426) | WM_GETOBJECT              = 0x003D
  constant WM_CHANGEUISTATE (line 427) | WM_CHANGEUISTATE          = 0x0127
  constant WM_UPDATEUISTATE (line 428) | WM_UPDATEUISTATE          = 0x0128
  constant WM_QUERYUISTATE (line 429) | WM_QUERYUISTATE           = 0x0129
  constant WM_UNINITMENUPOPUP (line 430) | WM_UNINITMENUPOPUP        = 0x0125
  constant WM_MENURBUTTONUP (line 431) | WM_MENURBUTTONUP          = 290
  constant WM_MENUCOMMAND (line 432) | WM_MENUCOMMAND            = 0x0126
  constant WM_MENUGETOBJECT (line 433) | WM_MENUGETOBJECT          = 0x0124
  constant WM_MENUDRAG (line 434) | WM_MENUDRAG               = 0x0123
  constant WM_APPCOMMAND (line 435) | WM_APPCOMMAND             = 0x0319
  constant WM_MENUCHAR (line 436) | WM_MENUCHAR               = 288
  constant WM_MENUSELECT (line 437) | WM_MENUSELECT             = 287
  constant WM_MOVE (line 438) | WM_MOVE                   = 3
  constant WM_MOVING (line 439) | WM_MOVING                 = 534
  constant WM_NCACTIVATE (line 440) | WM_NCACTIVATE             = 134
  constant WM_NCCALCSIZE (line 441) | WM_NCCALCSIZE             = 131
  constant WM_NCCREATE (line 442) | WM_NCCREATE               = 129
  constant WM_NCDESTROY (line 443) | WM_NCDESTROY              = 130
  constant WM_NCHITTEST (line 444) | WM_NCHITTEST              = 132
  constant WM_NCLBUTTONDBLCLK (line 445) | WM_NCLBUTTONDBLCLK        = 163
  constant WM_NCLBUTTONDOWN (line 446) | WM_NCLBUTTONDOWN          = 161
  constant WM_NCLBUTTONUP (line 447) | WM_NCLBUTTONUP            = 162
  constant WM_NCMBUTTONDBLCLK (line 448) | WM_NCMBUTTONDBLCLK        = 169
  constant WM_NCMBUTTONDOWN (line 449) | WM_NCMBUTTONDOWN          = 167
  constant WM_NCMBUTTONUP (line 450) | WM_NCMBUTTONUP            = 168
  constant WM_NCXBUTTONDOWN (line 451) | WM_NCXBUTTONDOWN          = 171
  constant WM_NCXBUTTONUP (line 452) | WM_NCXBUTTONUP            = 172
  constant WM_NCXBUTTONDBLCLK (line 453) | WM_NCXBUTTONDBLCLK        = 173
  constant WM_NCMOUSEHOVER (line 454) | WM_NCMOUSEHOVER           = 0x02A0
  constant WM_NCMOUSELEAVE (line 455) | WM_NCMOUSELEAVE           = 0x02A2
  constant WM_NCMOUSEMOVE (line 456) | WM_NCMOUSEMOVE            = 160
  constant WM_NCPAINT (line 457) | WM_NCPAINT                = 133
  constant WM_NCRBUTTONDBLCLK (line 458) | WM_NCRBUTTONDBLCLK        = 166
  constant WM_NCRBUTTONDOWN (line 459) | WM_NCRBUTTONDOWN          = 164
  constant WM_NCRBUTTONUP (line 460) | WM_NCRBUTTONUP            = 165
  constant WM_NEXTDLGCTL (line 461) | WM_NEXTDLGCTL             = 40
  constant WM_NEXTMENU (line 462) | WM_NEXTMENU               = 531
  constant WM_NOTIFY (line 463) | WM_NOTIFY                 = 78
  constant WM_NOTIFYFORMAT (line 464) | WM_NOTIFYFORMAT           = 85
  constant WM_NULL (line 465) | WM_NULL                   = 0
  constant WM_PAINT (line 466) | WM_PAINT                  = 15
  constant WM_PAINTCLIPBOARD (line 467) | WM_PAINTCLIPBOARD         = 777
  constant WM_PAINTICON (line 468) | WM_PAINTICON              = 38
  constant WM_PALETTECHANGED (line 469) | WM_PALETTECHANGED         = 785
  constant WM_PALETTEISCHANGING (line 470) | WM_PALETTEISCHANGING      = 784
  constant WM_PARENTNOTIFY (line 471) | WM_PARENTNOTIFY           = 528
  constant WM_PASTE (line 472) | WM_PASTE                  = 770
  constant WM_PENWINFIRST (line 473) | WM_PENWINFIRST            = 896
  constant WM_PENWINLAST (line 474) | WM_PENWINLAST             = 911
  constant WM_POWER (line 475) | WM_POWER                  = 72
  constant WM_POWERBROADCAST (line 476) | WM_POWERBROADCAST         = 536
  constant WM_PRINT (line 477) | WM_PRINT                  = 791
  constant WM_PRINTCLIENT (line 478) | WM_PRINTCLIENT            = 792
  constant WM_QUERYDRAGICON (line 479) | WM_QUERYDRAGICON          = 55
  constant WM_QUERYENDSESSION (line 480) | WM_QUERYENDSESSION        = 17
  constant WM_QUERYNEWPALETTE (line 481) | WM_QUERYNEWPALETTE        = 783
  constant WM_QUERYOPEN (line 482) | WM_QUERYOPEN              = 19
  constant WM_QUEUESYNC (line 483) | WM_QUEUESYNC              = 35
  constant WM_QUIT (line 484) | WM_QUIT                   = 18
  constant WM_RENDERALLFORMATS (line 485) | WM_RENDERALLFORMATS       = 774
  constant WM_RENDERFORMAT (line 486) | WM_RENDERFORMAT           = 773
  constant WM_SETCURSOR (line 487) | WM_SETCURSOR              = 32
  constant WM_SETFOCUS (line 488) | WM_SETFOCUS               = 7
  constant WM_SETFONT (line 489) | WM_SETFONT                = 48
  constant WM_SETHOTKEY (line 490) | WM_SETHOTKEY              = 50
  constant WM_SETICON (line 491) | WM_SETICON                = 128
  constant WM_SETREDRAW (line 492) | WM_SETREDRAW              = 11
  constant WM_SETTEXT (line 493) | WM_SETTEXT                = 12
  constant WM_SETTINGCHANGE (line 494) | WM_SETTINGCHANGE          = 26
  constant WM_SHOWWINDOW (line 495) | WM_SHOWWINDOW             = 24
  constant WM_SIZE (line 496) | WM_SIZE                   = 5
  constant WM_SIZECLIPBOARD (line 497) | WM_SIZECLIPBOARD          = 779
  constant WM_SIZING (line 498) | WM_SIZING                 = 532
  constant WM_SPOOLERSTATUS (line 499) | WM_SPOOLERSTATUS          = 42
  constant WM_STYLECHANGED (line 500) | WM_STYLECHANGED           = 125
  constant WM_STYLECHANGING (line 501) | WM_STYLECHANGING          = 124
  constant WM_SYSCHAR (line 502) | WM_SYSCHAR                = 262
  constant WM_SYSCOLORCHANGE (line 503) | WM_SYSCOLORCHANGE         = 21
  constant WM_SYSCOMMAND (line 504) | WM_SYSCOMMAND             = 274
  constant WM_SYSDEADCHAR (line 505) | WM_SYSDEADCHAR            = 263
  constant WM_SYSKEYDOWN (line 506) | WM_SYSKEYDOWN             = 260
  constant WM_SYSKEYUP (line 507) | WM_SYSKEYUP               = 261
  constant WM_TCARD (line 508) | WM_TCARD                  = 82
  constant WM_THEMECHANGED (line 509) | WM_THEMECHANGED           = 794
  constant WM_TIMECHANGE (line 510) | WM_TIMECHANGE             = 30
  constant WM_TIMER (line 511) | WM_TIMER                  = 275
  constant WM_UNDO (line 512) | WM_UNDO                   = 772
  constant WM_USER (line 513) | WM_USER                   = 1024
  constant WM_USERCHANGED (line 514) | WM_USERCHANGED            = 84
  constant WM_VKEYTOITEM (line 515) | WM_VKEYTOITEM             = 46
  constant WM_VSCROLL (line 516) | WM_VSCROLL                = 277
  constant WM_VSCROLLCLIPBOARD (line 517) | WM_VSCROLLCLIPBOARD       = 778
  constant WM_WINDOWPOSCHANGED (line 518) | WM_WINDOWPOSCHANGED       = 71
  constant WM_WINDOWPOSCHANGING (line 519) | WM_WINDOWPOSCHANGING      = 70
  constant WM_WININICHANGE (line 520) | WM_WININICHANGE           = 26
  constant WM_KEYFIRST (line 521) | WM_KEYFIRST               = 256
  constant WM_KEYLAST (line 522) | WM_KEYLAST                = 264
  constant WM_SYNCPAINT (line 523) | WM_SYNCPAINT              = 136
  constant WM_MOUSEACTIVATE (line 524) | WM_MOUSEACTIVATE          = 33
  constant WM_MOUSEMOVE (line 525) | WM_MOUSEMOVE              = 512
  constant WM_LBUTTONDOWN (line 526) | WM_LBUTTONDOWN            = 513
  constant WM_LBUTTONUP (line 527) | WM_LBUTTONUP              = 514
  constant WM_LBUTTONDBLCLK (line 528) | WM_LBUTTONDBLCLK          = 515
  constant WM_RBUTTONDOWN (line 529) | WM_RBUTTONDOWN            = 516
  constant WM_RBUTTONUP (line 530) | WM_RBUTTONUP              = 517
  constant WM_RBUTTONDBLCLK (line 531) | WM_RBUTTONDBLCLK          = 518
  constant WM_MBUTTONDOWN (line 532) | WM_MBUTTONDOWN            = 519
  constant WM_MBUTTONUP (line 533) | WM_MBUTTONUP              = 520
  constant WM_MBUTTONDBLCLK (line 534) | WM_MBUTTONDBLCLK          = 521
  constant WM_MOUSEWHEEL (line 535) | WM_MOUSEWHEEL             = 522
  constant WM_MOUSEFIRST (line 536) | WM_MOUSEFIRST             = 512
  constant WM_XBUTTONDOWN (line 537) | WM_XBUTTONDOWN            = 523
  constant WM_XBUTTONUP (line 538) | WM_XBUTTONUP              = 524
  constant WM_XBUTTONDBLCLK (line 539) | WM_XBUTTONDBLCLK          = 525
  constant WM_MOUSELAST (line 540) | WM_MOUSELAST              = 525
  constant WM_MOUSEHOVER (line 541) | WM_MOUSEHOVER             = 0x2A1
  constant WM_MOUSELEAVE (line 542) | WM_MOUSELEAVE             = 0x2A3
  constant WM_CLIPBOARDUPDATE (line 543) | WM_CLIPBOARDUPDATE        = 0x031D
  constant WA_INACTIVE (line 548) | WA_INACTIVE    = 0
  constant WA_ACTIVE (line 549) | WA_ACTIVE      = 1
  constant WA_CLICKACTIVE (line 550) | WA_CLICKACTIVE = 2
  constant LF_FACESIZE (line 553) | LF_FACESIZE = 32
  constant FW_DONTCARE (line 557) | FW_DONTCARE   = 0
  constant FW_THIN (line 558) | FW_THIN       = 100
  constant FW_EXTRALIGHT (line 559) | FW_EXTRALIGHT = 200
  constant FW_ULTRALIGHT (line 560) | FW_ULTRALIGHT = FW_EXTRALIGHT
  constant FW_LIGHT (line 561) | FW_LIGHT      = 300
  constant FW_NORMAL (line 562) | FW_NORMAL     = 400
  constant FW_REGULAR (line 563) | FW_REGULAR    = 400
  constant FW_MEDIUM (line 564) | FW_MEDIUM     = 500
  constant FW_SEMIBOLD (line 565) | FW_SEMIBOLD   = 600
  constant FW_DEMIBOLD (line 566) | FW_DEMIBOLD   = FW_SEMIBOLD
  constant FW_BOLD (line 567) | FW_BOLD       = 700
  constant FW_EXTRABOLD (line 568) | FW_EXTRABOLD  = 800
  constant FW_ULTRABOLD (line 569) | FW_ULTRABOLD  = FW_EXTRABOLD
  constant FW_HEAVY (line 570) | FW_HEAVY      = 900
  constant FW_BLACK (line 571) | FW_BLACK      = FW_HEAVY
  constant ANSI_CHARSET (line 576) | ANSI_CHARSET        = 0
  constant DEFAULT_CHARSET (line 577) | DEFAULT_CHARSET     = 1
  constant SYMBOL_CHARSET (line 578) | SYMBOL_CHARSET      = 2
  constant SHIFTJIS_CHARSET (line 579) | SHIFTJIS_CHARSET    = 128
  constant HANGEUL_CHARSET (line 580) | HANGEUL_CHARSET     = 129
  constant HANGUL_CHARSET (line 581) | HANGUL_CHARSET      = 129
  constant GB2312_CHARSET (line 582) | GB2312_CHARSET      = 134
  constant CHINESEBIG5_CHARSET (line 583) | CHINESEBIG5_CHARSET = 136
  constant GREEK_CHARSET (line 584) | GREEK_CHARSET       = 161
  constant TURKISH_CHARSET (line 585) | TURKISH_CHARSET     = 162
  constant HEBREW_CHARSET (line 586) | HEBREW_CHARSET      = 177
  constant ARABIC_CHARSET (line 587) | ARABIC_CHARSET      = 178
  constant BALTIC_CHARSET (line 588) | BALTIC_CHARSET      = 186
  constant RUSSIAN_CHARSET (line 589) | RUSSIAN_CHARSET     = 204
  constant THAI_CHARSET (line 590) | THAI_CHARSET        = 222
  constant EASTEUROPE_CHARSET (line 591) | EASTEUROPE_CHARSET  = 238
  constant OEM_CHARSET (line 592) | OEM_CHARSET         = 255
  constant JOHAB_CHARSET (line 593) | JOHAB_CHARSET       = 130
  constant VIETNAMESE_CHARSET (line 594) | VIETNAMESE_CHARSET  = 163
  constant MAC_CHARSET (line 595) | MAC_CHARSET         = 77
  constant OUT_DEFAULT_PRECIS (line 600) | OUT_DEFAULT_PRECIS   = 0
  constant OUT_STRING_PRECIS (line 601) | OUT_STRING_PRECIS    = 1
  constant OUT_CHARACTER_PRECIS (line 602) | OUT_CHARACTER_PRECIS = 2
  constant OUT_STROKE_PRECIS (line 603) | OUT_STROKE_PRECIS    = 3
  constant OUT_TT_PRECIS (line 604) | OUT_TT_PRECIS        = 4
  constant OUT_DEVICE_PRECIS (line 605) | OUT_DEVICE_PRECIS    = 5
  constant OUT_RASTER_PRECIS (line 606) | OUT_RASTER_PRECIS    = 6
  constant OUT_TT_ONLY_PRECIS (line 607) | OUT_TT_ONLY_PRECIS   = 7
  constant OUT_OUTLINE_PRECIS (line 608) | OUT_OUTLINE_PRECIS   = 8
  constant OUT_PS_ONLY_PRECIS (line 609) | OUT_PS_ONLY_PRECIS   = 10
  constant CLIP_DEFAULT_PRECIS (line 614) | CLIP_DEFAULT_PRECIS   = 0
  constant CLIP_CHARACTER_PRECIS (line 615) | CLIP_CHARACTER_PRECIS = 1
  constant CLIP_STROKE_PRECIS (line 616) | CLIP_STROKE_PRECIS    = 2
  constant CLIP_MASK (line 617) | CLIP_MASK             = 15
  constant CLIP_LH_ANGLES (line 618) | CLIP_LH_ANGLES        = 16
  constant CLIP_TT_ALWAYS (line 619) | CLIP_TT_ALWAYS        = 32
  constant CLIP_EMBEDDED (line 620) | CLIP_EMBEDDED         = 128
  constant DEFAULT_QUALITY (line 625) | DEFAULT_QUALITY        = 0
  constant DRAFT_QUALITY (line 626) | DRAFT_QUALITY          = 1
  constant PROOF_QUALITY (line 627) | PROOF_QUALITY          = 2
  constant NONANTIALIASED_QUALITY (line 628) | NONANTIALIASED_QUALITY = 3
  constant ANTIALIASED_QUALITY (line 629) | ANTIALIASED_QUALITY    = 4
  constant CLEARTYPE_QUALITY (line 630) | CLEARTYPE_QUALITY      = 5
  constant DEFAULT_PITCH (line 635) | DEFAULT_PITCH  = 0
  constant FIXED_PITCH (line 636) | FIXED_PITCH    = 1
  constant VARIABLE_PITCH (line 637) | VARIABLE_PITCH = 2
  constant FF_DECORATIVE (line 642) | FF_DECORATIVE = 80
  constant FF_DONTCARE (line 643) | FF_DONTCARE   = 0
  constant FF_MODERN (line 644) | FF_MODERN     = 48
  constant FF_ROMAN (line 645) | FF_ROMAN      = 16
  constant FF_SCRIPT (line 646) | FF_SCRIPT     = 64
  constant FF_SWISS (line 647) | FF_SWISS      = 32
  constant DC_FIELDS (line 652) | DC_FIELDS            = 1
  constant DC_PAPERS (line 653) | DC_PAPERS            = 2
  constant DC_PAPERSIZE (line 654) | DC_PAPERSIZE         = 3
  constant DC_MINEXTENT (line 655) | DC_MINEXTENT         = 4
  constant DC_MAXEXTENT (line 656) | DC_MAXEXTENT         = 5
  constant DC_BINS (line 657) | DC_BINS              = 6
  constant DC_DUPLEX (line 658) | DC_DUPLEX            = 7
  constant DC_SIZE (line 659) | DC_SIZE              = 8
  constant DC_EXTRA (line 660) | DC_EXTRA             = 9
  constant DC_VERSION (line 661) | DC_VERSION           = 10
  constant DC_DRIVER (line 662) | DC_DRIVER            = 11
  constant DC_BINNAMES (line 663) | DC_BINNAMES          = 12
  constant DC_ENUMRESOLUTIONS (line 664) | DC_ENUMRESOLUTIONS   = 13
  constant DC_FILEDEPENDENCIES (line 665) | DC_FILEDEPENDENCIES  = 14
  constant DC_TRUETYPE (line 666) | DC_TRUETYPE          = 15
  constant DC_PAPERNAMES (line 667) | DC_PAPERNAMES        = 16
  constant DC_ORIENTATION (line 668) | DC_ORIENTATION       = 17
  constant DC_COPIES (line 669) | DC_COPIES            = 18
  constant DC_BINADJUST (line 670) | DC_BINADJUST         = 19
  constant DC_EMF_COMPLIANT (line 671) | DC_EMF_COMPLIANT     = 20
  constant DC_DATATYPE_PRODUCED (line 672) | DC_DATATYPE_PRODUCED = 21
  constant DC_COLLATE (line 673) | DC_COLLATE           = 22
  constant DC_MANUFACTURER (line 674) | DC_MANUFACTURER      = 23
  constant DC_MODEL (line 675) | DC_MODEL             = 24
  constant DC_PERSONALITY (line 676) | DC_PERSONALITY       = 25
  constant DC_PRINTRATE (line 677) | DC_PRINTRATE         = 26
  constant DC_PRINTRATEUNIT (line 678) | DC_PRINTRATEUNIT     = 27
  constant DC_PRINTERMEM (line 679) | DC_PRINTERMEM        = 28
  constant DC_MEDIAREADY (line 680) | DC_MEDIAREADY        = 29
  constant DC_STAPLE (line 681) | DC_STAPLE            = 30
  constant DC_PRINTRATEPPM (line 682) | DC_PRINTRATEPPM      = 31
  constant DC_COLORDEVICE (line 683) | DC_COLORDEVICE       = 32
  constant DC_NUP (line 684) | DC_NUP               = 33
  constant DC_MEDIATYPENAMES (line 685) | DC_MEDIATYPENAMES    = 34
  constant DC_MEDIATYPES (line 686) | DC_MEDIATYPES        = 35
  constant DRIVERVERSION (line 691) | DRIVERVERSION   = 0
  constant TECHNOLOGY (line 692) | TECHNOLOGY      = 2
  constant HORZSIZE (line 693) | HORZSIZE        = 4
  constant VERTSIZE (line 694) | VERTSIZE        = 6
  constant HORZRES (line 695) | HORZRES         = 8
  constant VERTRES (line 696) | VERTRES         = 10
  constant LOGPIXELSX (line 697) | LOGPIXELSX      = 88
  constant LOGPIXELSY (line 698) | LOGPIXELSY      = 90
  constant BITSPIXEL (line 699) | BITSPIXEL       = 12
  constant PLANES (line 700) | PLANES          = 14
  constant NUMBRUSHES (line 701) | NUMBRUSHES      = 16
  constant NUMPENS (line 702) | NUMPENS         = 18
  constant NUMFONTS (line 703) | NUMFONTS        = 22
  constant NUMCOLORS (line 704) | NUMCOLORS       = 24
  constant NUMMARKERS (line 705) | NUMMARKERS      = 20
  constant ASPECTX (line 706) | ASPECTX         = 40
  constant ASPECTY (line 707) | ASPECTY         = 42
  constant ASPECTXY (line 708) | ASPECTXY        = 44
  constant PDEVICESIZE (line 709) | PDEVICESIZE     = 26
  constant CLIPCAPS (line 710) | CLIPCAPS        = 36
  constant SIZEPALETTE (line 711) | SIZEPALETTE     = 104
  constant NUMRESERVED (line 712) | NUMRESERVED     = 106
  constant COLORRES (line 713) | COLORRES        = 108
  constant PHYSICALWIDTH (line 714) | PHYSICALWIDTH   = 110
  constant PHYSICALHEIGHT (line 715) | PHYSICALHEIGHT  = 111
  constant PHYSICALOFFSETX (line 716) | PHYSICALOFFSETX = 112
  constant PHYSICALOFFSETY (line 717) | PHYSICALOFFSETY = 113
  constant SCALINGFACTORX (line 718) | SCALINGFACTORX  = 114
  constant SCALINGFACTORY (line 719) | SCALINGFACTORY  = 115
  constant VREFRESH (line 720) | VREFRESH        = 116
  constant DESKTOPHORZRES (line 721) | DESKTOPHORZRES  = 118
  constant DESKTOPVERTRES (line 722) | DESKTOPVERTRES  = 117
  constant BLTALIGNMENT (line 723) | BLTALIGNMENT    = 119
  constant SHADEBLENDCAPS (line 724) | SHADEBLENDCAPS  = 120
  constant COLORMGMTCAPS (line 725) | COLORMGMTCAPS   = 121
  constant RASTERCAPS (line 726) | RASTERCAPS      = 38
  constant CURVECAPS (line 727) | CURVECAPS       = 28
  constant LINECAPS (line 728) | LINECAPS        = 30
  constant POLYGONALCAPS (line 729) | POLYGONALCAPS   = 32
  constant TEXTCAPS (line 730) | TEXTCAPS        = 34
  constant DT_PLOTTER (line 735) | DT_PLOTTER    = 0
  constant DT_RASDISPLAY (line 736) | DT_RASDISPLAY = 1
  constant DT_RASPRINTER (line 737) | DT_RASPRINTER = 2
  constant DT_RASCAMERA (line 738) | DT_RASCAMERA  = 3
  constant DT_CHARSTREAM (line 739) | DT_CHARSTREAM = 4
  constant DT_METAFILE (line 740) | DT_METAFILE   = 5
  constant DT_DISPFILE (line 741) | DT_DISPFILE   = 6
  constant SB_NONE (line 746) | SB_NONE          = 0x00
  constant SB_CONST_ALPHA (line 747) | SB_CONST_ALPHA   = 0x01
  constant SB_PIXEL_ALPHA (line 748) | SB_PIXEL_ALPHA   = 0x02
  constant SB_PREMULT_ALPHA (line 749) | SB_PREMULT_ALPHA = 0x04
  constant SB_GRAD_RECT (line 750) | SB_GRAD_RECT     = 0x10
  constant SB_GRAD_TRI (line 751) | SB_GRAD_TRI      = 0x20
  constant CM_NONE (line 756) | CM_NONE       = 0x00
  constant CM_DEVICE_ICM (line 757) | CM_DEVICE_ICM = 0x01
  constant CM_GAMMA_RAMP (line 758) | CM_GAMMA_RAMP = 0x02
  constant CM_CMYK_COLOR (line 759) | CM_CMYK_COLOR = 0x04
  constant RC_BANDING (line 764) | RC_BANDING      = 2
  constant RC_BITBLT (line 765) | RC_BITBLT       = 1
  constant RC_BITMAP64 (line 766) | RC_BITMAP64     = 8
  constant RC_DI_BITMAP (line 767) | RC_DI_BITMAP    = 128
  constant RC_DIBTODEV (line 768) | RC_DIBTODEV     = 512
  constant RC_FLOODFILL (line 769) | RC_FLOODFILL    = 4096
  constant RC_GDI20_OUTPUT (line 770) | RC_GDI20_OUTPUT = 16
  constant RC_PALETTE (line 771) | RC_PALETTE      = 256
  constant RC_SCALING (line 772) | RC_SCALING      = 4
  constant RC_STRETCHBLT (line 773) | RC_STRETCHBLT   = 2048
  constant RC_STRETCHDIB (line 774) | RC_STRETCHDIB   = 8192
  constant RC_DEVBITS (line 775) | RC_DEVBITS      = 0x8000
  constant RC_OP_DX_OUTPUT (line 776) | RC_OP_DX_OUTPUT = 0x4000
  constant CC_NONE (line 781) | CC_NONE       = 0
  constant CC_CIRCLES (line 782) | CC_CIRCLES    = 1
  constant CC_PIE (line 783) | CC_PIE        = 2
  constant CC_CHORD (line 784) | CC_CHORD      = 4
  constant CC_ELLIPSES (line 785) | CC_ELLIPSES   = 8
  constant CC_WIDE (line 786) | CC_WIDE       = 16
  constant CC_STYLED (line 787) | CC_STYLED     = 32
  constant CC_WIDESTYLED (line 788) | CC_WIDESTYLED = 64
  constant CC_INTERIORS (line 789) | CC_INTERIORS  = 128
  constant CC_ROUNDRECT (line 790) | CC_ROUNDRECT  = 256
  constant LC_NONE (line 795) | LC_NONE       = 0
  constant LC_POLYLINE (line 796) | LC_POLYLINE   = 2
  constant LC_MARKER (line 797) | LC_MARKER     = 4
  constant LC_POLYMARKER (line 798) | LC_POLYMARKER = 8
  constant LC_WIDE (line 799) | LC_WIDE       = 16
  constant LC_STYLED (line 800) | LC_STYLED     = 32
  constant LC_WIDESTYLED (line 801) | LC_WIDESTYLED = 64
  constant LC_INTERIORS (line 802) | LC_INTERIORS  = 128
  constant PC_NONE (line 807) | PC_NONE        = 0
  constant PC_POLYGON (line 808) | PC_POLYGON     = 1
  constant PC_POLYPOLYGON (line 809) | PC_POLYPOLYGON = 256
  constant PC_PATHS (line 810) | PC_PATHS       = 512
  constant PC_RECTANGLE (line 811) | PC_RECTANGLE   = 2
  constant PC_WINDPOLYGON (line 812) | PC_WINDPOLYGON = 4
  constant PC_SCANLINE (line 813) | PC_SCANLINE    = 8
  constant PC_TRAPEZOID (line 814) | PC_TRAPEZOID   = 4
  constant PC_WIDE (line 815) | PC_WIDE        = 16
  constant PC_STYLED (line 816) | PC_STYLED      = 32
  constant PC_WIDESTYLED (line 817) | PC_WIDESTYLED  = 64
  constant PC_INTERIORS (line 818) | PC_INTERIORS   = 128
  constant TC_OP_CHARACTER (line 823) | TC_OP_CHARACTER = 1
  constant TC_OP_STROKE (line 824) | TC_OP_STROKE    = 2
  constant TC_CP_STROKE (line 825) | TC_CP_STROKE    = 4
  constant TC_CR_90 (line 826) | TC_CR_90        = 8
  constant TC_CR_ANY (line 827) | TC_CR_ANY       = 16
  constant TC_SF_X_YINDEP (line 828) | TC_SF_X_YINDEP  = 32
  constant TC_SA_DOUBLE (line 829) | TC_SA_DOUBLE    = 64
  constant TC_SA_INTEGER (line 830) | TC_SA_INTEGER   = 128
  constant TC_SA_CONTIN (line 831) | TC_SA_CONTIN    = 256
  constant TC_EA_DOUBLE (line 832) | TC_EA_DOUBLE    = 512
  constant TC_IA_ABLE (line 833) | TC_IA_ABLE      = 1024
  constant TC_UA_ABLE (line 834) | TC_UA_ABLE      = 2048
  constant TC_SO_ABLE (line 835) | TC_SO_ABLE      = 4096
  constant TC_RA_ABLE (line 836) | TC_RA_ABLE      = 8192
  constant TC_VA_ABLE (line 837) | TC_VA_ABLE      = 16384
  constant TC_RESERVED (line 838) | TC_RESERVED     = 32768
  constant TC_SCROLLBLT (line 839) | TC_SCROLLBLT    = 65536
  constant SS_BITMAP (line 844) | SS_BITMAP          = 14
  constant SS_BLACKFRAME (line 845) | SS_BLACKFRAME      = 7
  constant SS_BLACKRECT (line 846) | SS_BLACKRECT       = 4
  constant SS_CENTER (line 847) | SS_CENTER          = 1
  constant SS_CENTERIMAGE (line 848) | SS_CENTERIMAGE     = 512
  constant SS_EDITCONTROL (line 849) | SS_EDITCONTROL     = 0x2000
  constant SS_ENHMETAFILE (line 850) | SS_ENHMETAFILE     = 15
  constant SS_ETCHEDFRAME (line 851) | SS_ETCHEDFRAME     = 18
  constant SS_ETCHEDHORZ (line 852) | SS_ETCHEDHORZ      = 16
  constant SS_ETCHEDVERT (line 853) | SS_ETCHEDVERT      = 17
  constant SS_GRAYFRAME (line 854) | SS_GRAYFRAME       = 8
  constant SS_GRAYRECT (line 855) | SS_GRAYRECT        = 5
  constant SS_ICON (line 856) | SS_ICON            = 3
  constant SS_LEFT (line 857) | SS_LEFT            = 0
  constant SS_LEFTNOWORDWRAP (line 858) | SS_LEFTNOWORDWRAP  = 0xc
  constant SS_NOPREFIX (line 859) | SS_NOPREFIX        = 128
  constant SS_NOTIFY (line 860) | SS_NOTIFY          = 256
  constant SS_OWNERDRAW (line 861) | SS_OWNERDRAW       = 0xd
  constant SS_REALSIZECONTROL (line 862) | SS_REALSIZECONTROL = 0x040
  constant SS_REALSIZEIMAGE (line 863) | SS_REALSIZEIMAGE   = 0x800
  constant SS_RIGHT (line 864) | SS_RIGHT           = 2
  constant SS_RIGHTJUST (line 865) | SS_RIGHTJUST       = 0x400
  constant SS_SIMPLE (line 866) | SS_SIMPLE          = 11
  constant SS_SUNKEN (line 867) | SS_SUNKEN          = 4096
  constant SS_WHITEFRAME (line 868) | SS_WHITEFRAME      = 9
  constant SS_WHITERECT (line 869) | SS_WHITERECT       = 6
  constant SS_USERITEM (line 870) | SS_USERITEM        = 10
  constant SS_TYPEMASK (line 871) | SS_TYPEMASK        = 0x0000001F
  constant SS_ENDELLIPSIS (line 872) | SS_ENDELLIPSIS     = 0x00004000
  constant SS_PATHELLIPSIS (line 873) | SS_PATHELLIPSIS    = 0x00008000
  constant SS_WORDELLIPSIS (line 874) | SS_WORDELLIPSIS    = 0x0000C000
  constant SS_ELLIPSISMASK (line 875) | SS_ELLIPSISMASK    = 0x0000C000
  constant ES_LEFT (line 880) | ES_LEFT        = 0x0000
  constant ES_CENTER (line 881) | ES_CENTER      = 0x0001
  constant ES_RIGHT (line 882) | ES_RIGHT       = 0x0002
  constant ES_MULTILINE (line 883) | ES_MULTILINE   = 0x0004
  constant ES_UPPERCASE (line 884) | ES_UPPERCASE   = 0x0008
  constant ES_LOWERCASE (line 885) | ES_LOWERCASE   = 0x0010
  constant ES_PASSWORD (line 886) | ES_PASSWORD    = 0x0020
  constant ES_AUTOVSCROLL (line 887) | ES_AUTOVSCROLL = 0x0040
  constant ES_AUTOHSCROLL (line 888) | ES_AUTOHSCROLL = 0x0080
  constant ES_NOHIDESEL (line 889) | ES_NOHIDESEL   = 0x0100
  constant ES_OEMCONVERT (line 890) | ES_OEMCONVERT  = 0x0400
  constant ES_READONLY (line 891) | ES_READONLY    = 0x0800
  constant ES_WANTRETURN (line 892) | ES_WANTRETURN  = 0x1000
  constant ES_NUMBER (line 893) | ES_NUMBER      = 0x2000
  constant EN_SETFOCUS (line 898) | EN_SETFOCUS     = 0x0100
  constant EN_KILLFOCUS (line 899) | EN_KILLFOCUS    = 0x0200
  constant EN_CHANGE (line 900) | EN_CHANGE       = 0x0300
  constant EN_UPDATE (line 901) | EN_UPDATE       = 0x0400
  constant EN_ERRSPACE (line 902) | EN_ERRSPACE     = 0x0500
  constant EN_MAXTEXT (line 903) | EN_MAXTEXT      = 0x0501
  constant EN_HSCROLL (line 904) | EN_HSCROLL      = 0x0601
  constant EN_VSCROLL (line 905) | EN_VSCROLL      = 0x0602
  constant EN_ALIGN_LTR_EC (line 906) | EN_ALIGN_LTR_EC = 0x0700
  constant EN_ALIGN_RTL_EC (line 907) | EN_ALIGN_RTL_EC = 0x0701
  constant EM_GETSEL (line 912) | EM_GETSEL              = 0x00B0
  constant EM_SETSEL (line 913) | EM_SETSEL              = 0x00B1
  constant EM_GETRECT (line 914) | EM_GETRECT             = 0x00B2
  constant EM_SETRECT (line 915) | EM_SETRECT             = 0x00B3
  constant EM_SETRECTNP (line 916) | EM_SETRECTNP           = 0x00B4
  constant EM_SCROLL (line 917) | EM_SCROLL              = 0x00B5
  constant EM_LINESCROLL (line 918) | EM_LINESCROLL          = 0x00B6
  constant EM_SCROLLCARET (line 919) | EM_SCROLLCARET         = 0x00B7
  constant EM_GETMODIFY (line 920) | EM_GETMODIFY           = 0x00B8
  constant EM_SETMODIFY (line 921) | EM_SETMODIFY           = 0x00B9
  constant EM_GETLINECOUNT (line 922) | EM_GETLINECOUNT        = 0x00BA
  constant EM_LINEINDEX (line 923) | EM_LINEINDEX           = 0x00BB
  constant EM_SETHANDLE (line 924) | EM_SETHANDLE           = 0x00BC
  constant EM_GETHANDLE (line 925) | EM_GETHANDLE           = 0x00BD
  constant EM_GETTHUMB (line 926) | EM_GETTHUMB            = 0x00BE
  constant EM_LINELENGTH (line 927) | EM_LINELENGTH          = 0x00C1
  constant EM_REPLACESEL (line 928) | EM_REPLACESEL          = 0x00C2
  constant EM_GETLINE (line 929) | EM_GETLINE             = 0x00C4
  constant EM_LIMITTEXT (line 930) | EM_LIMITTEXT           = 0x00C5
  constant EM_CANUNDO (line 931) | EM_CANUNDO             = 0x00C6
  constant EM_UNDO (line 932) | EM_UNDO                = 0x00C7
  constant EM_FMTLINES (line 933) | EM_FMTLINES            = 0x00C8
  constant EM_LINEFROMCHAR (line 934) | EM_LINEFROMCHAR        = 0x00C9
  constant EM_SETTABSTOPS (line 935) | EM_SETTABSTOPS         = 0x00CB
  constant EM_SETPASSWORDCHAR (line 936) | EM_SETPASSWORDCHAR     = 0x00CC
  constant EM_EMPTYUNDOBUFFER (line 937) | EM_EMPTYUNDOBUFFER     = 0x00CD
  constant EM_GETFIRSTVISIBLELINE (line 938) | EM_GETFIRSTVISIBLELINE = 0x00CE
  constant EM_SETREADONLY (line 939) | EM_SETREADONLY         = 0x00CF
  constant EM_SETWORDBREAKPROC (line 940) | EM_SETWORDBREAKPROC    = 0x00D0
  constant EM_GETWORDBREAKPROC (line 941) | EM_GETWORDBREAKPROC    = 0x00D1
  constant EM_GETPASSWORDCHAR (line 942) | EM_GETPASSWORDCHAR     = 0x00D2
  constant EM_SETMARGINS (line 943) | EM_SETMARGINS          = 0x00D3
  constant EM_GETMARGINS (line 944) | EM_GETMARGINS          = 0x00D4
  constant EM_SETLIMITTEXT (line 945) | EM_SETLIMITTEXT        = EM_LIMITTEXT
  constant EM_GETLIMITTEXT (line 946) | EM_GETLIMITTEXT        = 0x00D5
  constant EM_POSFROMCHAR (line 947) | EM_POSFROMCHAR         = 0x00D6
  constant EM_CHARFROMPOS (line 948) | EM_CHARFROMPOS         = 0x00D7
  constant EM_SETIMESTATUS (line 949) | EM_SETIMESTATUS        = 0x00D8
  constant EM_GETIMESTATUS (line 950) | EM_GETIMESTATUS        = 0x00D9
  constant EM_SETCUEBANNER (line 951) | EM_SETCUEBANNER        = 0x1501
  constant EM_GETCUEBANNER (line 952) | EM_GETCUEBANNER        = 0x1502
  constant CCM_FIRST (line 956) | CCM_FIRST            = 0x2000
  constant CCM_LAST (line 957) | CCM_LAST             = CCM_FIRST + 0x200
  constant CCM_SETBKCOLOR (line 958) | CCM_SETBKCOLOR       = 8193
  constant CCM_SETCOLORSCHEME (line 959) | CCM_SETCOLORSCHEME   = 8194
  constant CCM_GETCOLORSCHEME (line 960) | CCM_GETCOLORSCHEME   = 8195
  constant CCM_GETDROPTARGET (line 961) | CCM_GETDROPTARGET    = 8196
  constant CCM_SETUNICODEFORMAT (line 962) | CCM_SETUNICODEFORMAT = 8197
  constant CCM_GETUNICODEFORMAT (line 963) | CCM_GETUNICODEFORMAT = 8198
  constant CCM_SETVERSION (line 964) | CCM_SETVERSION       = 0x2007
  constant CCM_GETVERSION (line 965) | CCM_GETVERSION       = 0x2008
  constant CCM_SETNOTIFYWINDOW (line 966) | CCM_SETNOTIFYWINDOW  = 0x2009
  constant CCM_SETWINDOWTHEME (line 967) | CCM_SETWINDOWTHEME   = 0x200b
  constant CCM_DPISCALE (line 968) | CCM_DPISCALE         = 0x200c
  constant CCS_TOP (line 973) | CCS_TOP           = 1
  constant CCS_NOMOVEY (line 974) | CCS_NOMOVEY       = 2
  constant CCS_BOTTOM (line 975) | CCS_BOTTOM        = 3
  constant CCS_NORESIZE (line 976) | CCS_NORESIZE      = 4
  constant CCS_NOPARENTALIGN (line 977) | CCS_NOPARENTALIGN = 8
  constant CCS_ADJUSTABLE (line 978) | CCS_ADJUSTABLE    = 32
  constant CCS_NODIVIDER (line 979) | CCS_NODIVIDER     = 64
  constant CCS_VERT (line 980) | CCS_VERT          = 128
  constant CCS_LEFT (line 981) | CCS_LEFT          = 129
  constant CCS_NOMOVEX (line 982) | CCS_NOMOVEX       = 130
  constant CCS_RIGHT (line 983) | CCS_RIGHT         = 131
  constant PROGRESS_CLASS (line 988) | PROGRESS_CLASS  = "msctls_progress32"
  constant PBM_SETPOS (line 989) | PBM_SETPOS      = WM_USER + 2
  constant PBM_DELTAPOS (line 990) | PBM_DELTAPOS    = WM_USER + 3
  constant PBM_SETSTEP (line 991) | PBM_SETSTEP     = WM_USER + 4
  constant PBM_STEPIT (line 992) | PBM_STEPIT      = WM_USER + 5
  constant PBM_SETRANGE32 (line 993) | PBM_SETRANGE32  = 1030
  constant PBM_GETRANGE (line 994) | PBM_GETRANGE    = 1031
  constant PBM_GETPOS (line 995) | PBM_GETPOS      = 1032
  constant PBM_SETBARCOLOR (line 996) | PBM_SETBARCOLOR = 1033
  constant PBM_SETBKCOLOR (line 997) | PBM_SETBKCOLOR  = CCM_SETBKCOLOR
  constant PBS_SMOOTH (line 998) | PBS_SMOOTH      = 1
  constant PBS_VERTICAL (line 999) | PBS_VERTICAL    = 4
  constant TBS_AUTOTICKS (line 1004) | TBS_AUTOTICKS      = 1
  constant TBS_VERT (line 1005) | TBS_VERT           = 2
  constant TBS_HORZ (line 1006) | TBS_HORZ           = 0
  constant TBS_TOP (line 1007) | TBS_TOP            = 4
  constant TBS_BOTTOM (line 1008) | TBS_BOTTOM         = 0
  constant TBS_LEFT (line 1009) | TBS_LEFT           = 4
  constant TBS_RIGHT (line 1010) | TBS_RIGHT          = 0
  constant TBS_BOTH (line 1011) | TBS_BOTH           = 8
  constant TBS_NOTICKS (line 1012) | TBS_NOTICKS        = 16
  constant TBS_ENABLESELRANGE (line 1013) | TBS_ENABLESELRANGE = 32
  constant TBS_FIXEDLENGTH (line 1014) | TBS_FIXEDLENGTH    = 64
  constant TBS_NOTHUMB (line 1015) | TBS_NOTHUMB        = 128
  constant TBS_TOOLTIPS (line 1016) | TBS_TOOLTIPS       = 0x0100
  constant TBM_GETPOS (line 1020) | TBM_GETPOS         = (WM_USER)
  constant TBM_GETRANGEMIN (line 1021) | TBM_GETRANGEMIN    = (WM_USER + 1)
  constant TBM_GETRANGEMAX (line 1022) | TBM_GETRANGEMAX    = (WM_USER + 2)
  constant TBM_GETTIC (line 1023) | TBM_GETTIC         = (WM_USER + 3)
  constant TBM_SETTIC (line 1024) | TBM_SETTIC         = (WM_USER + 4)
  constant TBM_SETPOS (line 1025) | TBM_SETPOS         = (WM_USER + 5)
  constant TBM_SETRANGE (line 1026) | TBM_SETRANGE       = (WM_USER + 6)
  constant TBM_SETRANGEMIN (line 1027) | TBM_SETRANGEMIN    = (WM_USER + 7)
  constant TBM_SETRANGEMAX (line 1028) | TBM_SETRANGEMAX    = (WM_USER + 8)
  constant TBM_CLEARTICS (line 1029) | TBM_CLEARTICS      = (WM_USER + 9)
  constant TBM_SETSEL (line 1030) | TBM_SETSEL         = (WM_USER + 10)
  constant TBM_SETSELSTART (line 1031) | TBM_SETSELSTART    = (WM_USER + 11)
  constant TBM_SETSELEND (line 1032) | TBM_SETSELEND      = (WM_USER + 12)
  constant TBM_GETPTICS (line 1033) | TBM_GETPTICS       = (WM_USER + 14)
  constant TBM_GETTICPOS (line 1034) | TBM_GETTICPOS      = (WM_USER + 15)
  constant TBM_GETNUMTICS (line 1035) | TBM_GETNUMTICS     = (WM_USER + 16)
  constant TBM_GETSELSTART (line 1036) | TBM_GETSELSTART    = (WM_USER + 17)
  constant TBM_GETSELEND (line 1037) | TBM_GETSELEND      = (WM_USER + 18)
  constant TBM_CLEARSEL (line 1038) | TBM_CLEARSEL       = (WM_USER + 19)
  constant TBM_SETTICFREQ (line 1039) | TBM_SETTICFREQ     = (WM_USER + 20)
  constant TBM_SETPAGESIZE (line 1040) | TBM_SETPAGESIZE    = (WM_USER + 21)
  constant TBM_GETPAGESIZE (line 1041) | TBM_GETPAGESIZE    = (WM_USER + 22)
  constant TBM_SETLINESIZE (line 1042) | TBM_SETLINESIZE    = (WM_USER + 23)
  constant TBM_GETLINESIZE (line 1043) | TBM_GETLINESIZE    = (WM_USER + 24)
  constant TBM_GETTHUMBRECT (line 1044) | TBM_GETTHUMBRECT   = (WM_USER + 25)
  constant TBM_GETCHANNELRECT (line 1045) | TBM_GETCHANNELRECT = (WM_USER + 26)
  constant TBM_SETTHUMBLENGTH (line 1046) | TBM_SETTHUMBLENGTH = (WM_USER + 27)
  constant TBM_GETTHUMBLENGTH (line 1047) | TBM_GETTHUMBLENGTH = (WM_USER + 28)
  constant TBM_SETTOOLTIPS (line 1048) | TBM_SETTOOLTIPS    = (WM_USER + 29)
  constant TBM_GETTOOLTIPS (line 1049) | TBM_GETTOOLTIPS    = (WM_USER + 30)
  constant TBM_SETTIPSIDE (line 1050) | TBM_SETTIPSIDE     = (WM_USER + 31)
  constant TBM_SETBUDDY (line 1051) | TBM_SETBUDDY       = (WM_USER + 32)
  constant TBM_GETBUDDY (line 1052) | TBM_GETBUDDY       = (WM_USER + 33)
  constant TB_LINEUP (line 1056) | TB_LINEUP        = 0
  constant TB_LINEDOWN (line 1057) | TB_LINEDOWN      = 1
  constant TB_PAGEUP (line 1058) | TB_PAGEUP        = 2
  constant TB_PAGEDOWN (line 1059) | TB_PAGEDOWN      = 3
  constant TB_THUMBPOSITION (line 1060) | TB_THUMBPOSITION = 4
  constant TB_THUMBTRACK (line 1061) | TB_THUMBTRACK    = 5
  constant TB_TOP (line 1062) | TB_TOP           = 6
  constant TB_BOTTOM (line 1063) | TB_BOTTOM        = 7
  constant TB_ENDTRACK (line 1064) | TB_ENDTRACK      = 8
  constant OFN_EX_NOPLACESBAR (line 1069) | OFN_EX_NOPLACESBAR = 0x00000001
  constant OFN_ALLOWMULTISELECT (line 1074) | OFN_ALLOWMULTISELECT     = 0x00000200
  constant OFN_CREATEPROMPT (line 1075) | OFN_CREATEPROMPT         = 0x00002000
  constant OFN_DONTADDTORECENT (line 1076) | OFN_DONTADDTORECENT      = 0x02000000
  constant OFN_ENABLEHOOK (line 1077) | OFN_ENABLEHOOK           = 0x00000020
  constant OFN_ENABLEINCLUDENOTIFY (line 1078) | OFN_ENABLEINCLUDENOTIFY  = 0x00400000
  constant OFN_ENABLESIZING (line 1079) | OFN_ENABLESIZING         = 0x00800000
  constant OFN_ENABLETEMPLATE (line 1080) | OFN_ENABLETEMPLATE       = 0x00000040
  constant OFN_ENABLETEMPLATEHANDLE (line 1081) | OFN_ENABLETEMPLATEHANDLE = 0x00000080
  constant OFN_EXPLORER (line 1082) | OFN_EXPLORER             = 0x00080000
  constant OFN_EXTENSIONDIFFERENT (line 1083) | OFN_EXTENSIONDIFFERENT   = 0x00000400
  constant OFN_FILEMUSTEXIST (line 1084) | OFN_FILEMUSTEXIST        = 0x00001000
  constant OFN_FORCESHOWHIDDEN (line 1085) | OFN_FORCESHOWHIDDEN      = 0x10000000
  constant OFN_HIDEREADONLY (line 1086) | OFN_HIDEREADONLY         = 0x00000004
  constant OFN_LONGNAMES (line 1087) | OFN_LONGNAMES            = 0x00200000
  constant OFN_NOCHANGEDIR (line 1088) | OFN_NOCHANGEDIR          = 0x00000008
  constant OFN_NODEREFERENCELINKS (line 1089) | OFN_NODEREFERENCELINKS   = 0x00100000
  constant OFN_NOLONGNAMES (line 1090) | OFN_NOLONGNAMES          = 0x00040000
  constant OFN_NONETWORKBUTTON (line 1091) | OFN_NONETWORKBUTTON      = 0x00020000
  constant OFN_NOREADONLYRETURN (line 1092) | OFN_NOREADONLYRETURN     = 0x00008000
  constant OFN_NOTESTFILECREATE (line 1093) | OFN_NOTESTFILECREATE     = 0x00010000
  constant OFN_NOVALIDATE (line 1094) | OFN_NOVALIDATE           = 0x00000100
  constant OFN_OVERWRITEPROMPT (line 1095) | OFN_OVERWRITEPROMPT      = 0x00000002
  constant OFN_PATHMUSTEXIST (line 1096) | OFN_PATHMUSTEXIST        = 0x00000800
  constant OFN_READONLY (line 1097) | OFN_READONLY             = 0x00000001
  constant OFN_SHAREAWARE (line 1098) | OFN_SHAREAWARE           = 0x00004000
  constant OFN_SHOWHELP (line 1099) | OFN_SHOWHELP             = 0x00000010
  constant BIF_RETURNONLYFSDIRS (line 1104) | BIF_RETURNONLYFSDIRS    = 0x00000001
  constant BIF_DONTGOBELOWDOMAIN (line 1105) | BIF_DONTGOBELOWDOMAIN   = 0x00000002
  constant BIF_STATUSTEXT (line 1106) | BIF_STATUSTEXT          = 0x00000004
  constant BIF_RETURNFSANCESTORS (line 1107) | BIF_RETURNFSANCESTORS   = 0x00000008
  constant BIF_EDITBOX (line 1108) | BIF_EDITBOX             = 0x00000010
  constant BIF_VALIDATE (line 1109) | BIF_VALIDATE            = 0x00000020
  constant BIF_NEWDIALOGSTYLE (line 1110) | BIF_NEWDIALOGSTYLE      = 0x00000040
  constant BIF_BROWSEINCLUDEURLS (line 1111) | BIF_BROWSEINCLUDEURLS   = 0x00000080
  constant BIF_USENEWUI (line 1112) | BIF_USENEWUI            = BIF_EDITBOX | BIF_NEWDIALOGSTYLE
  constant BIF_UAHINT (line 1113) | BIF_UAHINT              = 0x00000100
  constant BIF_NONEWFOLDERBUTTON (line 1114) | BIF_NONEWFOLDERBUTTON   = 0x00000200
  constant BIF_NOTRANSLATETARGETS (line 1115) | BIF_NOTRANSLATETARGETS  = 0x00000400
  constant BIF_BROWSEFORCOMPUTER (line 1116) | BIF_BROWSEFORCOMPUTER   = 0x00001000
  constant BIF_BROWSEFORPRINTER (line 1117) | BIF_BROWSEFORPRINTER    = 0x00002000
  constant BIF_BROWSEINCLUDEFILES (line 1118) | BIF_BROWSEINCLUDEFILES  = 0x00004000
  constant BIF_SHAREABLE (line 1119) | BIF_SHAREABLE           = 0x00008000
  constant BIF_BROWSEFILEJUNCTIONS (line 1120) | BIF_BROWSEFILEJUNCTIONS = 0x00010000
  constant MB_OK (line 1125) | MB_OK                = 0x00000000
  constant MB_OKCANCEL (line 1126) | MB_OKCANCEL          = 0x00000001
  constant MB_ABORTRETRYIGNORE (line 1127) | MB_ABORTRETRYIGNORE  = 0x00000002
  constant MB_YESNOCANCEL (line 1128) | MB_YESNOCANCEL       = 0x00000003
  constant MB_YESNO (line 1129) | MB_YESNO             = 0x00000004
  constant MB_RETRYCANCEL (line 1130) | MB_RETRYCANCEL       = 0x00000005
  constant MB_CANCELTRYCONTINUE (line 1131) | MB_CANCELTRYCONTINUE = 0x00000006
  constant MB_ICONHAND (line 1132) | MB_ICONHAND          = 0x00000010
  constant MB_ICONQUESTION (line 1133) | MB_ICONQUESTION      = 0x00000020
  constant MB_ICONEXCLAMATION (line 1134) | MB_ICONEXCLAMATION   = 0x00000030
  constant MB_ICONASTERISK (line 1135) | MB_ICONASTERISK      = 0x00000040
  constant MB_USERICON (line 1136) | MB_USERICON          = 0x00000080
  constant MB_ICONWARNING (line 1137) | MB_ICONWARNING       = MB_ICONEXCLAMATION
  constant MB_ICONERROR (line 1138) | MB_ICONERROR         = MB_ICONHAND
  constant MB_ICONINFORMATION (line 1139) | MB_ICONINFORMATION   = MB_ICONASTERISK
  constant MB_ICONSTOP (line 1140) | MB_ICONSTOP          = MB_ICONHAND
  constant MB_DEFBUTTON1 (line 1141) | MB_DEFBUTTON1        = 0x00000000
  constant MB_DEFBUTTON2 (line 1142) | MB_DEFBUTTON2        = 0x00000100
  constant MB_DEFBUTTON3 (line 1143) | MB_DEFBUTTON3        = 0x00000200
  constant MB_DEFBUTTON4 (line 1144) | MB_DEFBUTTON4        = 0x00000300
  constant E_INVALIDARG (line 1149) | E_INVALIDARG  = 0x80070057
  constant E_OUTOFMEMORY (line 1150) | E_OUTOFMEMORY = 0x8007000E
  constant E_UNEXPECTED (line 1151) | E_UNEXPECTED  = 0x8000FFFF
  constant S_OK (line 1155) | S_OK               = 0
  constant S_FALSE (line 1156) | S_FALSE            = 0x0001
  constant RPC_E_CHANGED_MODE (line 1157) | RPC_E_CHANGED_MODE = 0x80010106
  constant SM_CXSCREEN (line 1162) | SM_CXSCREEN             = 0
  constant SM_CYSCREEN (line 1163) | SM_CYSCREEN             = 1
  constant SM_CXVSCROLL (line 1164) | SM_CXVSCROLL            = 2
  constant SM_CYHSCROLL (line 1165) | SM_CYHSCROLL            = 3
  constant SM_CYCAPTION (line 1166) | SM_CYCAPTION            = 4
  constant SM_CXBORDER (line 1167) | SM_CXBORDER             = 5
  constant SM_CYBORDER (line 1168) | SM_CYBORDER             = 6
  constant SM_CXDLGFRAME (line 1169) | SM_CXDLGFRAME           = 7
  constant SM_CYDLGFRAME (line 1170) | SM_CYDLGFRAME           = 8
  constant SM_CYVTHUMB (line 1171) | SM_CYVTHUMB             = 9
  constant SM_CXHTHUMB (line 1172) | SM_CXHTHUMB             = 10
  constant SM_CXICON (line 1173) | SM_CXICON               = 11
  constant SM_CYICON (line 1174) | SM_CYICON               = 12
  constant SM_CXCURSOR (line 1175) | SM_CXCURSOR             = 13
  constant SM_CYCURSOR (line 1176) | SM_CYCURSOR             = 14
  constant SM_CYMENU (line 1177) | SM_CYMENU               = 15
  constant SM_CXFULLSCREEN (line 1178) | SM_CXFULLSCREEN         = 16
  constant SM_CYFULLSCREEN (line 1179) | SM_CYFULLSCREEN         = 17
  constant SM_CYKANJIWINDOW (line 1180) | SM_CYKANJIWINDOW        = 18
  constant SM_MOUSEPRESENT (line 1181) | SM_MOUSEPRESENT         = 19
  constant SM_CYVSCROLL (line 1182) | SM_CYVSCROLL            = 20
  constant SM_CXHSCROLL (line 1183) | SM_CXHSCROLL            = 21
  constant SM_DEBUG (line 1184) | SM_DEBUG                = 22
  constant SM_SWAPBUTTON (line 1185) | SM_SWAPBUTTON           = 23
  constant SM_RESERVED1 (line 1186) | SM_RESERVED1            = 24
  constant SM_RESERVED2 (line 1187) | SM_RESERVED2            = 25
  constant SM_RESERVED3 (line 1188) | SM_RESERVED3            = 26
  constant SM_RESERVED4 (line 1189) | SM_RESERVED4            = 27
  constant SM_CXMIN (line 1190) | SM_CXMIN                = 28
  constant SM_CYMIN (line 1191) | SM_CYMIN                = 29
  constant SM_CXSIZE (line 1192) | SM_CXSIZE               = 30
  constant SM_CYSIZE (line 1193) | SM_CYSIZE               = 31
  constant SM_CXFRAME (line 1194) | SM_CXFRAME              = 32
  constant SM_CYFRAME (line 1195) | SM_CYFRAME              = 33
  constant SM_CXMINTRACK (line 1196) | SM_CXMINTRACK           = 34
  constant SM_CYMINTRACK (line 1197) | SM_CYMINTRACK           = 35
  constant SM_CXDOUBLECLK (line 1198) | SM_CXDOUBLECLK          = 36
  constant SM_CYDOUBLECLK (line 1199) | SM_CYDOUBLECLK          = 37
  constant SM_CXICONSPACING (line 1200) | SM_CXICONSPACING        = 38
  constant SM_CYICONSPACING (line 1201) | SM_CYICONSPACING        = 39
  constant SM_MENUDROPALIGNMENT (line 1202) | SM_MENUDROPALIGNMENT    = 40
  constant SM_PENWINDOWS (line 1203) | SM_PENWINDOWS           = 41
  constant SM_DBCSENABLED (line 1204) | SM_DBCSENABLED          = 42
  constant SM_CMOUSEBUTTONS (line 1205) | SM_CMOUSEBUTTONS        = 43
  constant SM_CXFIXEDFRAME (line 1206) | SM_CXFIXEDFRAME         = SM_CXDLGFRAME
  constant SM_CYFIXEDFRAME (line 1207) | SM_CYFIXEDFRAME         = SM_CYDLGFRAME
  constant SM_CXSIZEFRAME (line 1208) | SM_CXSIZEFRAME          = SM_CXFRAME
  constant SM_CYSIZEFRAME (line 1209) | SM_CYSIZEFRAME          = SM_CYFRAME
  constant SM_SECURE (line 1210) | SM_SECURE               = 44
  constant SM_CXEDGE (line 1211) | SM_CXEDGE               = 45
  constant SM_CYEDGE (line 1212) | SM_CYEDGE               = 46
  constant SM_CXMINSPACING (line 1213) | SM_CXMINSPACING         = 47
  constant SM_CYMINSPACING (line 1214) | SM_CYMINSPACING         = 48
  constant SM_CXSMICON (line 1215) | SM_CXSMICON             = 49
  constant SM_CYSMICON (line 1216) | SM_CYSMICON             = 50
  constant SM_CYSMCAPTION (line 1217) | SM_CYSMCAPTION          = 51
  constant SM_CXSMSIZE (line 1218) | SM_CXSMSIZE             = 52
  constant SM_CYSMSIZE (line 1219) | SM_CYSMSIZE             = 53
  constant SM_CXMENUSIZE (line 1220) | SM_CXMENUSIZE           = 54
  constant SM_CYMENUSIZE (line 1221) | SM_CYMENUSIZE           = 55
  constant SM_ARRANGE (line 1222) | SM_ARRANGE              = 56
  constant SM_CXMINIMIZED (line 1223) | SM_CXMINIMIZED          = 57
  constant SM_CYMINIMIZED (line 1224) | SM_CYMINIMIZED          = 58
  constant SM_CXMAXTRACK (line 1225) | SM_CXMAXTRACK           = 59
  constant SM_CYMAXTRACK (line 1226) | SM_CYMAXTRACK           = 60
  constant SM_CXMAXIMIZED (line 1227) | SM_CXMAXIMIZED          = 61
  constant SM_CYMAXIMIZED (line 1228) | SM_CYMAXIMIZED          = 62
  constant SM_NETWORK (line 1229) | SM_NETWORK              = 63
  constant SM_CLEANBOOT (line 1230) | SM_CLEANBOOT            = 67
  constant SM_CXDRAG (line 1231) | SM_CXDRAG               = 68
  constant SM_CYDRAG (line 1232) | SM_CYDRAG               = 69
  constant SM_SHOWSOUNDS (line 1233) | SM_SHOWSOUNDS           = 70
  constant SM_CXMENUCHECK (line 1234) | SM_CXMENUCHECK          = 71
  constant SM_CYMENUCHECK (line 1235) | SM_CYMENUCHECK          = 72
  constant SM_SLOWMACHINE (line 1236) | SM_SLOWMACHINE          = 73
  constant SM_MIDEASTENABLED (line 1237) | SM_MIDEASTENABLED       = 74
  constant SM_MOUSEWHEELPRESENT (line 1238) | SM_MOUSEWHEELPRESENT    = 75
  constant SM_XVIRTUALSCREEN (line 1239) | SM_XVIRTUALSCREEN       = 76
  constant SM_YVIRTUALSCREEN (line 1240) | SM_YVIRTUALSCREEN       = 77
  constant SM_CXVIRTUALSCREEN (line 1241) | SM_CXVIRTUALSCREEN      = 78
  constant SM_CYVIRTUALSCREEN (line 1242) | SM_CYVIRTUALSCREEN      = 79
  constant SM_CMONITORS (line 1243) | SM_CMONITORS            = 80
  constant SM_SAMEDISPLAYFORMAT (line 1244) | SM_SAMEDISPLAYFORMAT    = 81
  constant SM_IMMENABLED (line 1245) | SM_IMMENABLED           = 82
  constant SM_CXFOCUSBORDER (line 1246) | SM_CXFOCUSBORDER        = 83
  constant SM_CYFOCUSBORDER (line 1247) | SM_CYFOCUSBORDER        = 84
  constant SM_TABLETPC (line 1248) | SM_TABLETPC             = 86
  constant SM_MEDIACENTER (line 1249) | SM_MEDIACENTER          = 87
  constant SM_STARTER (line 1250) | SM_STARTER              = 88
  constant SM_SERVERR2 (line 1251) | SM_SERVERR2             = 89
  constant SM_CMETRICS (line 1252) | SM_CMETRICS             = 91
  constant SM_REMOTESESSION (line 1253) | SM_REMOTESESSION        = 0x1000
  constant SM_SHUTTINGDOWN (line 1254) | SM_SHUTTINGDOWN         = 0x2000
  constant SM_REMOTECONTROL (line 1255) | SM_REMOTECONTROL        = 0x2001
  constant SM_CARETBLINKINGENABLED (line 1256) | SM_CARETBLINKINGENABLED = 0x2002
  constant CLSCTX_INPROC_SERVER (line 1260) | CLSCTX_INPROC_SERVER   = 1
  constant CLSCTX_INPROC_HANDLER (line 1261) | CLSCTX_INPROC_HANDLER  = 2
  constant CLSCTX_LOCAL_SERVER (line 1262) | CLSCTX_LOCAL_SERVER    = 4
  constant CLSCTX_INPROC_SERVER16 (line 1263) | CLSCTX_INPROC_SERVER16 = 8
  constant CLSCTX_REMOTE_SERVER (line 1264) | CLSCTX_REMOTE_SERVER   = 16
  constant CLSCTX_ALL (line 1265) | CLSCTX_ALL             = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | ...
  constant CLSCTX_INPROC (line 1266) | CLSCTX_INPROC          = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER
  constant CLSCTX_SERVER (line 1267) | CLSCTX_SERVER          = CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CL...
  constant COINIT_APARTMENTTHREADED (line 1271) | COINIT_APARTMENTTHREADED = 0x2
  constant COINIT_MULTITHREADED (line 1272) | COINIT_MULTITHREADED     = 0x0
  constant COINIT_DISABLE_OLE1DDE (line 1273) | COINIT_DISABLE_OLE1DDE   = 0x4
  constant COINIT_SPEED_OVER_MEMORY (line 1274) | COINIT_SPEED_OVER_MEMORY = 0x8
  constant DISPATCH_METHOD (line 1278) | DISPATCH_METHOD         = 1
  constant DISPATCH_PROPERTYGET (line 1279) | DISPATCH_PROPERTYGET    = 2
  constant DISPATCH_PROPERTYPUT (line 1280) | DISPATCH_PROPERTYPUT    = 4
  constant DISPATCH_PROPERTYPUTREF (line 1281) | DISPATCH_PROPERTYPUTREF = 8
  constant CC_FASTCALL (line 1285) | CC_FASTCALL = iota
  constant CC_CDECL (line 1286) | CC_CDECL
  constant CC_MSCPASCAL (line 1287) | CC_MSCPASCAL
  constant CC_PASCAL (line 1288) | CC_PASCAL = CC_MSCPASCAL
  constant CC_MACPASCAL (line 1289) | CC_MACPASCAL
  constant CC_STDCALL (line 1290) | CC_STDCALL
  constant CC_FPFASTCALL (line 1291) | CC_FPFASTCALL
  constant CC_SYSCALL (line 1292) | CC_SYSCALL
  constant CC_MPWCDECL (line 1293) | CC_MPWCDECL
  constant CC_MPWPASCAL (line 1294) | CC_MPWPASCAL
  constant CC_MAX (line 1295) | CC_MAX = CC_MPWPASCAL
  constant VT_EMPTY (line 1299) | VT_EMPTY           = 0x0
  constant VT_NULL (line 1300) | VT_NULL            = 0x1
  constant VT_I2 (line 1301) | VT_I2              = 0x2
  constant VT_I4 (line 1302) | VT_I4              = 0x3
  constant VT_R4 (line 1303) | VT_R4              = 0x4
  constant VT_R8 (line 1304) | VT_R8              = 0x5
  constant VT_CY (line 1305) | VT_CY              = 0x6
  constant VT_DATE (line 1306) | VT_DATE            = 0x7
  constant VT_BSTR (line 1307) | VT_BSTR            = 0x8
  constant VT_DISPATCH (line 1308) | VT_DISPATCH        = 0x9
  constant VT_ERROR (line 1309) | VT_ERROR           = 0xa
  constant VT_BOOL (line 1310) | VT_BOOL            = 0xb
  constant VT_VARIANT (line 1311) | VT_VARIANT         = 0xc
  constant VT_UNKNOWN (line 1312) | VT_UNKNOWN         = 0xd
  constant VT_DECIMAL (line 1313) | VT_DECIMAL         = 0xe
  constant VT_I1 (line 1314) | VT_I1              = 0x10
  constant VT_UI1 (line 1315) | VT_UI1             = 0x11
  constant VT_UI2 (line 1316) | VT_UI2             = 0x12
  constant VT_UI4 (line 1317) | VT_UI4             = 0x13
  constant VT_I8 (line 1318) | VT_I8              = 0x14
  constant VT_UI8 (line 1319) | VT_UI8             = 0x15
  constant VT_INT (line 1320) | VT_INT             = 0x16
  constant VT_UINT (line 1321) | VT_UINT            = 0x17
  constant VT_VOID (line 1322) | VT_VOID            = 0x18
  constant VT_HRESULT (line 1323) | VT_HRESULT         = 0x19
  constant VT_PTR (line 1324) | VT_PTR             = 0x1a
  constant VT_SAFEARRAY (line 1325) | VT_SAFEARRAY       = 0x1b
  constant VT_CARRAY (line 1326) | VT_CARRAY          = 0x1c
  constant VT_USERDEFINED (line 1327) | VT_USERDEFINED     = 0x1d
  constant VT_LPSTR (line 1328) | VT_LPSTR           = 0x1e
  constant VT_LPWSTR (line 1329) | VT_LPWSTR          = 0x1f
  constant VT_RECORD (line 1330) | VT_RECORD          = 0x24
  constant VT_INT_PTR (line 1331) | VT_INT_PTR         = 0x25
  constant VT_UINT_PTR (line 1332) | VT_UINT_PTR        = 0x26
  constant VT_FILETIME (line 1333) | VT_FILETIME        = 0x40
  constant VT_BLOB (line 1334) | VT_BLOB            = 0x41
  constant VT_STREAM (line 1335) | VT_STREAM          = 0x42
  constant VT_STORAGE (line 1336) | VT_STORAGE         = 0x43
  constant VT_STREAMED_OBJECT (line 1337) | VT_STREAMED_OBJECT = 0x44
  constant VT_STORED_OBJECT (line 1338) | VT_STORED_OBJECT   = 0x45
  constant VT_BLOB_OBJECT (line 1339) | VT_BLOB_OBJECT     = 0x46
  constant VT_CF (line 1340) | VT_CF              = 0x47
  constant VT_CLSID (line 1341) | VT_CLSID           = 0x48
  constant VT_BSTR_BLOB (line 1342) | VT_BSTR_BLOB       = 0xfff
  constant VT_VECTOR (line 1343) | VT_VECTOR          = 0x1000
  constant VT_ARRAY (line 1344) | VT_ARRAY           = 0x2000
  constant VT_BYREF (line 1345) | VT_BYREF           = 0x4000
  constant VT_RESERVED (line 1346) | VT_RESERVED        = 0x8000
  constant VT_ILLEGAL (line 1347) | VT_ILLEGAL         = 0xffff
  constant VT_ILLEGALMASKED (line 1348) | VT_ILLEGALMASKED   = 0xfff
  constant VT_TYPEMASK (line 1349) | VT_TYPEMASK        = 0xfff
  constant DISPID_UNKNOWN (line 1353) | DISPID_UNKNOWN     = -1
  constant DISPID_VALUE (line 1354) | DISPID_VALUE       = 0
  constant DISPID_PROPERTYPUT (line 1355) | DISPID_PROPERTYPUT = -3
  constant DISPID_NEWENUM (line 1356) | DISPID_NEWENUM     = -4
  constant DISPID_EVALUATE (line 1357) | DISPID_EVALUATE    = -5
  constant DISPID_CONSTRUCTOR (line 1358) | DISPID_CONSTRUCTOR = -6
  constant DISPID_DESTRUCTOR (line 1359) | DISPID_DESTRUCTOR  = -7
  constant DISPID_COLLECT (line 1360) | DISPID_COLLECT     = -8
  constant MONITOR_DEFAULTTONULL (line 1364) | MONITOR_DEFAULTTONULL    = 0x00000000
  constant MONITOR_DEFAULTTOPRIMARY (line 1365) | MONITOR_DEFAULTTOPRIMARY = 0x00000001
  constant MONITOR_DEFAULTTONEAREST (line 1366) | MONITOR_DEFAULTTONEAREST = 0x00000002
  constant MONITORINFOF_PRIMARY (line 1368) | MONITORINFOF_PRIMARY = 0x00000001
  constant CCHDEVICENAME (line 1372) | CCHDEVICENAME = 32
  constant CCHFORMNAME (line 1373) | CCHFORMNAME   = 32
  constant IDOK (line 1377) | IDOK       = 1
  constant IDCANCEL (line 1378) | IDCANCEL   = 2
  constant IDABORT (line 1379) | IDABORT    = 3
  constant IDRETRY (line 1380) | IDRETRY    = 4
  constant IDIGNORE (line 1381) | IDIGNORE   = 5
  constant IDYES (line 1382) | IDYES      = 6
  constant IDNO (line 1383) | IDNO       = 7
  constant IDCLOSE (line 1384) | IDCLOSE    = 8
  constant IDHELP (line 1385) | IDHELP     = 9
  constant IDTRYAGAIN (line 1386) | IDTRYAGAIN = 10
  constant IDCONTINUE (line 1387) | IDCONTINUE = 11
  constant IDTIMEOUT (line 1388) | IDTIMEOUT  = 32000
  constant NM_FIRST (line 1393) | NM_FIRST           = 0
  constant NM_OUTOFMEMORY (line 1394) | NM_OUTOFMEMORY     = NM_FIRST - 1
  constant NM_CLICK (line 1395) | NM_CLICK           = NM_FIRST - 2
  constant NM_DBLCLK (line 1396) | NM_DBLCLK          = NM_FIRST - 3
  constant NM_RETURN (line 1397) | NM_RETURN          = NM_FIRST - 4
  constant NM_RCLICK (line 1398) | NM_RCLICK          = NM_FIRST - 5
  constant NM_RDBLCLK (line 1399) | NM_RDBLCLK         = NM_FIRST - 6
  constant NM_SETFOCUS (line 1400) | NM_SETFOCUS        = NM_FIRST - 7
  constant NM_KILLFOCUS (line 1401) | NM_KILLFOCUS       = NM_FIRST - 8
  constant NM_CUSTOMDRAW (line 1402) | NM_CUSTOMDRAW      = NM_FIRST - 12
  constant NM_HOVER (line 1403) | NM_HOVER           = NM_FIRST - 13
  constant NM_NCHITTEST (line 1404) | NM_NCHITTEST       = NM_FIRST - 14
  constant NM_KEYDOWN (line 1405) | NM_KEYDOWN         = NM_FIRST - 15
  constant NM_RELEASEDCAPTURE (line 1406) | NM_RELEASEDCAPTURE = NM_FIRST - 16
  constant NM_SETCURSOR (line 1407) | NM_SETCURSOR       = NM_FIRST - 17
  constant NM_CHAR (line 1408) | NM_CHAR            = NM_FIRST - 18
  constant NM_TOOLTIPSCREATED (line 1409) | NM_TOOLTIPSCREATED = NM_FIRST - 19
  constant NM_LAST (line 1410) | NM_LAST            = NM_FIRST - 99
  constant LVM_FIRST (line 1415) | LVM_FIRST                    = 0x1000
  constant LVM_GETITEMCOUNT (line 1416) | LVM_GETITEMCOUNT             = LVM_FIRST + 4
  constant LVM_SETIMAGELIST (line 1417) | LVM_SETIMAGELIST             = LVM_FIRST + 3
  constant LVM_GETIMAGELIST (line 1418) | LVM_GETIMAGELIST             = LVM_FIRST + 2
  constant LVM_GETITEM (line 1419) | LVM_GETITEM                  = LVM_FIRST + 75
  constant LVM_SETITEM (line 1420) | LVM_SETITEM                  = LVM_FIRST + 76
  constant LVM_INSERTITEM (line 1421) | LVM_INSERTITEM               = LVM_FIRST + 77
  constant LVM_DELETEITEM (line 1422) | LVM_DELETEITEM               = LVM_FIRST + 8
  constant LVM_DELETEALLITEMS (line 1423) | LVM_DELETEALLITEMS           = LVM_FIRST + 9
  constant LVM_GETCALLBACKMASK (line 1424) | LVM_GETCALLBACKMASK          = LVM_FIRST + 10
  constant LVM_SETCALLBACKMASK (line 1425) | LVM_SETCALLBACKMASK          = LVM_FIRST + 11
  constant LVM_SETUNICODEFORMAT (line 1426) | LVM_SETUNICODEFORMAT         = CCM_SETUNICODEFORMAT
  constant LVM_GETNEXTITEM (line 1427) | LVM_GETNEXTITEM              = LVM_FIRST + 12
  constant LVM_FINDITEM (line 1428) | LVM_FINDITEM                 = LVM_FIRST + 83
  constant LVM_GETITEMRECT (line 1429) | LVM_GETITEMRECT              = LVM_FIRST + 14
  constant LVM_GETSTRINGWIDTH (line 1430) | LVM_GETSTRINGWIDTH           = LVM_FIRST + 87
  constant LVM_HITTEST (line 1431) | LVM_HITTEST                  = LVM_FIRST + 18
  constant LVM_ENSUREVISIBLE (line 1432) | LVM_ENSUREVISIBLE            = LVM_FIRST + 19
  constant LVM_SCROLL (line 1433) | LVM_SCROLL                   = LVM_FIRST + 20
  constant LVM_REDRAWITEMS (line 1434) | LVM_REDRAWITEMS              = LVM_FIRST + 21
  constant LVM_ARRANGE (line 1435) | LVM_ARRANGE                  = LVM_FIRST + 22
  constant LVM_EDITLABEL (line 1436) | LVM_EDITLABEL                = LVM_FIRST + 118
  constant LVM_GETEDITCONTROL (line 1437) | LVM_GETEDITCONTROL           = LVM_FIRST + 24
  constant LVM_GETCOLUMN (line 1438) | LVM_GETCOLUMN                = LVM_FIRST + 95
  constant LVM_SETCOLUMN (line 1439) | LVM_SETCOLUMN                = LVM_FIRST + 96
  constant LVM_INSERTCOLUMN (line 1440) | LVM_INSERTCOLUMN             = LVM_FIRST + 97
  constant LVM_DELETECOLUMN (line 1441) | LVM_DELETECOLUMN             = LVM_FIRST + 28
  constant LVM_GETCOLUMNWIDTH (line 1442) | LVM_GETCOLUMNWIDTH           = LVM_FIRST + 29
  constant LVM_SETCOLUMNWIDTH (line 1443) | LVM_SETCOLUMNWIDTH           = LVM_FIRST + 30
  constant LVM_GETHEADER (line 1444) | LVM_GETHEADER                = LVM_FIRST + 31
  constant LVM_CREATEDRAGIMAGE (line 1445) | LVM_CREATEDRAGIMAGE          = LVM_FIRST + 33
  constant LVM_GETVIEWRECT (line 1446) | LVM_GETVIEWRECT              = LVM_FIRST + 34
  constant LVM_GETTEXTCOLOR (line 1447) | LVM_GETTEXTCOLOR             = LVM_FIRST + 35
  constant LVM_SETTEXTCOLOR (line 1448) | LVM_SETTEXTCOLOR             = LVM_FIRST + 36
  constant LVM_GETTEXTBKCOLOR (line 1449) | LVM_GETTEXTBKCOLOR           = LVM_FIRST + 37
  constant LVM_SETTEXTBKCOLOR (line 1450) | LVM_SETTEXTBKCOLOR           = LVM_FIRST + 38
  constant LVM_GETTOPINDEX (line 1451) | LVM_GETTOPINDEX              = LVM_FIRST + 39
  constant LVM_GETCOUNTPERPAGE (line 1452) | LVM_GETCOUNTPERPAGE          = LVM_FIRST + 40
  constant LVM_GETORIGIN (line 1453) | LVM_GETORIGIN                = LVM_FIRST + 41
  constant LVM_UPDATE (line 1454) | LVM_UPDATE                   = LVM_FIRST + 42
  constant LVM_SETITEMSTATE (line 1455) | LVM_SETITEMSTATE             = LVM_FIRST + 43
  constant LVM_GETITEMSTATE (line 1456) | LVM_GETITEMSTATE             = LVM_FIRST + 44
  constant LVM_GETITEMTEXT (line 1457) | LVM_GETITEMTEXT              = LVM_FIRST + 115
  constant LVM_SETITEMTEXT (line 1458) | LVM_SETITEMTEXT              = LVM_FIRST + 116
  constant LVM_SETITEMCOUNT (line 1459) | LVM_SETITEMCOUNT             = LVM_FIRST + 47
  constant LVM_SORTITEMS (line 1460) | LVM_SORTITEMS                = LVM_FIRST + 48
  constant LVM_SETITEMPOSITION32 (line 1461) | LVM_SETITEMPOSITION32        = LVM_FIRST + 49
  constant LVM_GETSELECTEDCOUNT (line 1462) | LVM_GETSELECTEDCOUNT         = LVM_FIRST + 50
  constant LVM_GETITEMSPACING (line 1463) | LVM_GETITEMSPACING           = LVM_FIRST + 51
  constant LVM_GETISEARCHSTRING (line 1464) | LVM_GETISEARCHSTRING         = LVM_FIRST + 117
  constant LVM_SETICONSPACING (line 1465) | LVM_SETICONSPACING           = LVM_FIRST + 53
  constant LVM_SETEXTENDEDLISTVIEWSTYLE (line 1466) | LVM_SETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 54
  constant LVM_GETEXTENDEDLISTVIEWSTYLE (line 1467) | LVM_GETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 55
  constant LVM_GETSUBITEMRECT (line 1468) | LVM_GETSUBITEMRECT           = LVM_FIRST + 56
  constant LVM_SUBITEMHITTEST (line 1469) | LVM_SUBITEMHITTEST           = LVM_FIRST + 57
  constant LVM_SETCOLUMNORDERARRAY (line 1470) | LVM_SETCOLUMNORDERARRAY      = LVM_FIRST + 58
  constant LVM_GETCOLUMNORDERARRAY (line 1471) | LVM_GETCOLUMNORDERARRAY      = LVM_FIRST + 59
  constant LVM_SETHOTITEM (line 1472) | LVM_SETHOTITEM               = LVM_FIRST + 60
  constant LVM_GETHOTITEM (line 1473) | LVM_GETHOTITEM               = LVM_FIRST + 61
  constant LVM_SETHOTCURSOR (line 1474) | LVM_SETHOTCURSOR             = LVM_FIRST + 62
  constant LVM_GETHOTCURSOR (line 1475) | LVM_GETHOTCURSOR             = LVM_FIRST + 63
  constant LVM_APPROXIMATEVIEWRECT (line 1476) | LVM_APPROXIMATEVIEWRECT      = LVM_FIRST + 64
  constant LVM_SETWORKAREAS (line 1477) | LVM_SETWORKAREAS             = LVM_FIRST + 65
  constant LVM_GETWORKAREAS (line 1478) | LVM_GETWORKAREAS             = LVM_FIRST + 70
  constant LVM_GETNUMBEROFWORKAREAS (line 1479) | LVM_GETNUMBEROFWORKAREAS     = LVM_FIRST + 73
  constant LVM_GETSELECTIONMARK (line 1480) | LVM_GETSELECTIONMARK         = LVM_FIRST + 66
  constant LVM_SETSELECTIONMARK (line 1481) | LVM_SETSELECTIONMARK         = LVM_FIRST + 67
  constant LVM_SETHOVERTIME (line 1482) | LVM_SETHOVERTIME             = LVM_FIRST + 71
  constant LVM_GETHOVERTIME (line 1483) | LVM_GETHOVERTIME             = LVM_FIRST + 72
  constant LVM_SETTOOLTIPS (line 1484) | LVM_SETTOOLTIPS              = LVM_FIRST + 74
  constant LVM_GETTOOLTIPS (line 1485) | LVM_GETTOOLTIPS              = LVM_FIRST + 78
  constant LVM_SORTITEMSEX (line 1486) | LVM_SORTITEMSEX              = LVM_FIRST + 81
  constant LVM_SETBKIMAGE (line 1487) | LVM_SETBKIMAGE               = LVM_FIRST + 138
  constant LVM_GETBKIMAGE (line 1488) | LVM_GETBKIMAGE               = LVM_FIRST + 139
  constant LVM_SETSELECTEDCOLUMN (line 1489) | LVM_SETSELECTEDCOLUMN        = LVM_FIRST + 140
  constant LVM_SETVIEW (line 1490) | LVM_SETVIEW                  = LVM_FIRST + 142
  constant LVM_GETVIEW (line 1491) | LVM_GETVIEW                  = LVM_FIRST + 143
  constant LVM_INSERTGROUP (line 1492) | LVM_INSERTGROUP              = LVM_FIRST + 145
  constant LVM_SETGROUPINFO (line 1493) | LVM_SETGROUPINFO             = LVM_FIRST + 147
  constant LVM_GETGROUPINFO (line 1494) | LVM_GETGROUPINFO             = LVM_FIRST + 149
  constant LVM_REMOVEGROUP (line 1495) | LVM_REMOVEGROUP              = LVM_FIRST + 150
  constant LVM_MOVEGROUP (line 1496) | LVM_MOVEGROUP                = LVM_FIRST + 151
  constant LVM_GETGROUPCOUNT (line 1497) | LVM_GETGROUPCOUNT            = LVM_FIRST + 152
  constant LVM_GETGROUPINFOBYINDEX (line 1498) | LVM_GETGROUPINFOBYINDEX      = LVM_FIRST + 153
  constant LVM_MOVEITEMTOGROUP (line 1499) | LVM_MOVEITEMTOGROUP          = LVM_FIRST + 154
  constant LVM_GETGROUPRECT (line 1500) | LVM_GETGROUPRECT             = LVM_FIRST + 98
  constant LVM_SETGROUPMETRICS (line 1501) | LVM_SETGROUPMETRICS          = LVM_FIRST + 155
  constant LVM_GETGROUPMETRICS (line 1502) | LVM_GETGROUPMETRICS          = LVM_FIRST + 156
  constant LVM_ENABLEGROUPVIEW (line 1503) | LVM_ENABLEGROUPVIEW          = LVM_FIRST + 157
  constant LVM_SORTGROUPS (line 1504) | LVM_SORTGROUPS               = LVM_FIRST + 158
  constant LVM_INSERTGROUPSORTED (line 1505) | LVM_INSERTGROUPSORTED        = LVM_FIRST + 159
  constant LVM_REMOVEALLGROUPS (line 1506) | LVM_REMOVEALLGROUPS          = LVM_FIRST + 160
  constant LVM_HASGROUP (line 1507) | LVM_HASGROUP                 = LVM_FIRST + 161
  constant LVM_GETGROUPSTATE (line 1508) | LVM_GETGROUPSTATE            = LVM_FIRST + 92
  constant LVM_GETFOCUSEDGROUP (line 1509) | LVM_GETFOCUSEDGROUP          = LVM_FIRST + 93
  constant LVM_SETTILEVIEWINFO (line 1510) | LVM_SETTILEVIEWINFO          = LVM_FIRST + 162
  constant LVM_GETTILEVIEWINFO (line 1511) | LVM_GETTILEVIEWINFO          = LVM_FIRST + 163
  constant LVM_SETTILEINFO (line 1512) | LVM_SETTILEINFO              = LVM_FIRST + 164
  constant LVM_GETTILEINFO (line 1513) | LVM_GETTILEINFO              = LVM_FIRST + 165
  constant LVM_SETINSERTMARK (line 1514) | LVM_SETINSERTMARK            = LVM_FIRST + 166
  constant LVM_GETINSERTMARK (line 1515) | LVM_GETINSERTMARK            = LVM_FIRST + 167
  constant LVM_INSERTMARKHITTEST (line 1516) | LVM_INSERTMARKHITTEST        = LVM_FIRST + 168
  constant LVM_GETINSERTMARKRECT (line 1517) | LVM_GETINSERTMARKRECT        = LVM_FIRST + 169
  constant LVM_SETINSERTMARKCOLOR (line 1518) | LVM_SETINSERTMARKCOLOR       = LVM_FIRST + 170
  constant LVM_GETINSERTMARKCOLOR (line 1519) | LVM_GETINSERTMARKCOLOR       = LVM_FIRST + 171
  constant LVM_SETINFOTIP (line 1520) | LVM_SETINFOTIP               = LVM_FIRST + 173
  constant LVM_GETSELECTEDCOLUMN (line 1521) | LVM_GETSELECTEDCOLUMN        = LVM_FIRST + 174
  constant LVM_ISGROUPVIEWENABLED (line 1522) | LVM_ISGROUPVIEWENABLED       = LVM_FIRST + 175
  constant LVM_GETOUTLINECOLOR (line 1523) | LVM_GETOUTLINECOLOR          = LVM_FIRST + 176
  constant LVM_SETOUTLINECOLOR (line 1524) | LVM_SETOUTLINECOLOR          = LVM_FIRST + 177
  constant LVM_CANCELEDITLABEL (line 1525) | LVM_CANCELEDITLABEL          = LVM_FIRST + 179
  constant LVM_MAPINDEXTOID (line 1526) | LVM_MAPINDEXTOID             = LVM_FIRST + 180
  constant LVM_MAPIDTOINDEX (line 1527) | LVM_MAPIDTOINDEX             = LVM_FIRST + 181
  constant LVM_ISITEMVISIBLE (line 1528) | LVM_ISITEMVISIBLE            = LVM_FIRST + 182
  constant LVM_GETNEXTITEMINDEX (line 1529) | LVM_GETNEXTITEMINDEX         = LVM_FIRST + 211
  constant LVN_FIRST (line 1534) | LVN_FIRST = -100
  constant LVN_ITEMCHANGING (line 1536) | LVN_ITEMCHANGING      = LVN_FIRST - 0
  constant LVN_ITEMCHANGED (line 1537) | LVN_ITEMCHANGED       = LVN_FIRST - 1
  constant LVN_INSERTITEM (line 1538) | LVN_INSERTITEM        = LVN_FIRST - 2
  constant LVN_DELETEITEM (line 1539) | LVN_DELETEITEM        = LVN_FIRST - 3
  constant LVN_DELETEALLITEMS (line 1540) | LVN_DELETEALLITEMS    = LVN_FIRST - 4
  constant LVN_BEGINLABELEDITA (line 1541) | LVN_BEGINLABELEDITA   = LVN_FIRST - 5
  constant LVN_BEGINLABELEDITW (line 1542) | LVN_BEGINLABELEDITW   = LVN_FIRST - 75
  constant LVN_ENDLABELEDITA (line 1543) | LVN_ENDLABELEDITA     = LVN_FIRST - 6
  constant LVN_ENDLABELEDITW (line 1544) | LVN_ENDLABELEDITW     = LVN_FIRST - 76
  constant LVN_COLUMNCLICK (line 1545) | LVN_COLUMNCLICK       = LVN_FIRST - 8
  constant LVN_BEGINDRAG (line 1546) | LVN_BEGINDRAG         = LVN_FIRST - 9
  constant LVN_BEGINRDRAG (line 1547) | LVN_BEGINRDRAG        = LVN_FIRST - 11
  constant LVN_ODCACHEHINT (line 1548) | LVN_ODCACHEHINT       = LVN_FIRST - 13
  constant LVN_ODFINDITEMA (line 1549) | LVN_ODFINDITEMA       = LVN_FIRST - 52
  constant LVN_ODFINDITEMW (line 1550) | LVN_ODFINDITEMW       = LVN_FIRST - 79
  constant LVN_ITEMACTIVATE (line 1551) | LVN_ITEMACTIVATE      = LVN_FIRST - 14
  constant LVN_ODSTATECHANGED (line 1552) | LVN_ODSTATECHANGED    = LVN_FIRST - 15
  constant LVN_HOTTRACK (line 1553) | LVN_HOTTRACK          = LVN_FIRST - 21
  constant LVN_GETDISPINFO (line 1554) | LVN_GETDISPINFO       = LVN_FIRST - 77
  constant LVN_SETDISPINFO (line 1555) | LVN_SETDISPINFO       = LVN_FIRST - 78
  constant LVN_KEYDOWN (line 1556) | LVN_KEYDOWN           = LVN_FIRST - 55
  constant LVN_MARQUEEBEGIN (line 1557) | LVN_MARQUEEBEGIN      = LVN_FIRST - 56
  constant LVN_GETINFOTIP (line 1558) | LVN_GETINFOTIP        = LVN_FIRST - 58
  constant LVN_INCREMENTALSEARCH (line 1559) | LVN_INCREMENTALSEARCH = LVN_FIRST - 63
  constant LVN_BEGINSCROLL (line 1560) | LVN_BEGINSCROLL       = LVN_FIRST - 80
  constant LVN_ENDSCROLL (line 1561) | LVN_ENDSCROLL         = LVN_FIRST - 81
  constant LVSCW_AUTOSIZE (line 1565) | LVSCW_AUTOSIZE           = ^uintptr(0)
  constant LVSCW_AUTOSIZE_USEHEADER (line 1566) | LVSCW_AUTOSIZE_USEHEADER = ^uintptr(1)
  constant LVNI_ALL (line 1571) | LVNI_ALL         = 0
  constant LVNI_FOCUSED (line 1572) | LVNI_FOCUSED     = 1
  constant LVNI_SELECTED (line 1573) | LVNI_SELECTED    = 2
  constant LVNI_CUT (line 1574) | LVNI_CUT         = 4
  constant LVNI_DROPHILITED (line 1575) | LVNI_DROPHILITED = 8
  constant LVNI_ABOVE (line 1576) | LVNI_ABOVE       = 256
  constant LVNI_BELOW (line 1577) | LVNI_BELOW       = 512
  constant LVNI_TOLEFT (line 1578) | LVNI_TOLEFT      = 1024
  constant LVNI_TORIGHT (line 1579) | LVNI_TORIGHT     = 2048
  constant LVS_ICON (line 1584) | LVS_ICON            = 0x0000
  constant LVS_REPORT (line 1585) | LVS_REPORT          = 0x0001
  constant LVS_SMALLICON (line 1586) | LVS_SMALLICON       = 0x0002
  constant LVS_LIST (line 1587) | LVS_LIST            = 0x0003
  constant LVS_TYPEMASK (line 1588) | LVS_TYPEMASK        = 0x0003
  constant LVS_SINGLESEL (line 1589) | LVS_SINGLESEL       = 0x0004
  constant LVS_SHOWSELALWAYS (line 1590) | LVS_SHOWSELALWAYS   = 0x0008
  constant LVS_SORTASCENDING (line 1591) | LVS_SORTASCENDING   = 0x0010
  constant LVS_SORTDESCENDING (line 1592) | LVS_SORTDESCENDING  = 0x0020
  constant LVS_SHAREIMAGELISTS (line 1593) | LVS_SHAREIMAGELISTS = 0x0040
  constant LVS_NOLABELWRAP (line 1594) | LVS_NOLABELWRAP     = 0x0080
  constant LVS_AUTOARRANGE (line 1595) | LVS_AUTOARRANGE     = 0x0100
  constant LVS_EDITLABELS (line 1596) | LVS_EDITLABELS      = 0x0200
  constant LVS_OWNERDATA (line 1597) | LVS_OWNERDATA       = 0x1000
  constant LVS_NOSCROLL (line 1598) | LVS_NOSCROLL        = 0x2000
  constant LVS_TYPESTYLEMASK (line 1599) | LVS_TYPESTYLEMASK   = 0xfc00
  constant LVS_ALIGNTOP (line 1600) | LVS_ALIGNTOP        = 0x0000
  constant LVS_ALIGNLEFT (line 1601) | LVS_ALIGNLEFT       = 0x0800
  constant LVS_ALIGNMASK (line 1602) | LVS_ALIGNMASK       = 0x0c00
  constant LVS_OWNERDRAWFIXED (line 1603) | LVS_OWNERDRAWFIXED  = 0x0400
  constant LVS_NOCOLUMNHEADER (line 1604) | LVS_NOCOLUMNHEADER  = 0x4000
  constant LVS_NOSORTHEADER (line 1605) | LVS_NOSORTHEADER    = 0x8000
  constant LVS_EX_GRIDLINES (line 1610) | LVS_EX_GRIDLINES        = 0x00000001
  constant LVS_EX_SUBITEMIMAGES (line 1611) | LVS_EX_SUBITEMIMAGES    = 0x00000002
  constant LVS_EX_CHECKBOXES (line 1612) | LVS_EX_CHECKBOXES       = 0x00000004
  constant LVS_EX_TRACKSELECT (line 1613) | LVS_EX_TRACKSELECT      = 0x00000008
  constant LVS_EX_HEADERDRAGDROP (line 1614) | LVS_EX_HEADERDRAGDROP   = 0x00000010
  constant LVS_EX_FULLROWSELECT (line 1615) | LVS_EX_FULLROWSELECT    = 0x00000020
  constant LVS_EX_ONECLICKACTIVATE (line 1616) | LVS_EX_ONECLICKACTIVATE = 0x00000040
  constant LVS_EX_TWOCLICKACTIVATE (line 1617) | LVS_EX_TWOCLICKACTIVATE = 0x00000080
  constant LVS_EX_FLATSB (line 1618) | LVS_EX_FLATSB           = 0x00000100
  constant LVS_EX_REGIONAL (line 1619) | LVS_EX_REGIONAL         = 0x00000200
  constant LVS_EX_INFOTIP (line 1620) | LVS_EX_INFOTIP          = 0x00000400
  constant LVS_EX_UNDERLINEHOT (line 1621) | LVS_EX_UNDERLINEHOT     = 0x00000800
  constant LVS_EX_UNDERLINECOLD (line 1622) | LVS_EX_UNDERLINECOLD    = 0x00001000
  constant LVS_EX_MULTIWORKAREAS (line 1623) | LVS_EX_MULTIWORKAREAS   = 0x00002000
  constant LVS_EX_LABELTIP (line 1624) | LVS_EX_LABELTIP         = 0x00004000
  constant LVS_EX_BORDERSELECT (line 1625) | LVS_EX_BORDERSELECT     = 0x00008000
  constant LVS_EX_DOUBLEBUFFER (line 1626) | LVS_EX_DOUBLEBUFFER     = 0x00010000
  constant LVS_EX_HIDELABELS (line 1627) | LVS_EX_HIDELABELS       = 0x00020000
  constant LVS_EX_SINGLEROW (line 1628) | LVS_EX_SINGLEROW        = 0x00040000
  constant LVS_EX_SNAPTOGRID (line 1629) | LVS_EX_SNAPTOGRID       = 0x00080000
  constant LVS_EX_SIMPLESELECT (line 1630) | LVS_EX_SIMPLESELECT     = 0x00100000
  constant LVCF_FMT (line 1635) | LVCF_FMT     = 0x0001
  constant LVCF_WIDTH (line 1636) | LVCF_WIDTH   = 0x0002
  constant LVCF_TEXT (line 1637) | LVCF_TEXT    = 0x0004
  constant LVCF_SUBITEM (line 1638) | LVCF_SUBITEM = 0x0008
  constant LVCF_IMAGE (line 1639) | LVCF_IMAGE   = 0x0010
  constant LVCF_ORDER (line 1640) | LVCF_ORDER   = 0x0020
  constant LVCFMT_LEFT (line 1645) | LVCFMT_LEFT            = 0x0000
  constant LVCFMT_RIGHT (line 1646) | LVCFMT_RIGHT           = 0x0001
  constant LVCFMT_CENTER (line 1647) | LVCFMT_CENTER          = 0x0002
  constant LVCFMT_JUSTIFYMASK (line 1648) | LVCFMT_JUSTIFYMASK     = 0x0003
  constant LVCFMT_IMAGE (line 1649) | LVCFMT_IMAGE           = 0x0800
  constant LVCFMT_BITMAP_ON_RIGHT (line 1650) | LVCFMT_BITMAP_ON_RIGHT = 0x1000
  constant LVCFMT_COL_HAS_IMAGES (line 1651) | LVCFMT_COL_HAS_IMAGES  = 0x8000
  constant LVIF_TEXT (line 1656) | LVIF_TEXT        = 0x00000001
  constant LVIF_IMAGE (line 1657) | LVIF_IMAGE       = 0x00000002
  constant LVIF_PARAM (line 1658) | LVIF_PARAM       = 0x00000004
  constant LVIF_STATE (line 1659) | LVIF_STATE       = 0x00000008
  constant LVIF_INDENT (line 1660) | LVIF_INDENT      = 0x00000010
  constant LVIF_NORECOMPUTE (line 1661) | LVIF_NORECOMPUTE = 0x00000800
  constant LVIF_GROUPID (line 1662) | LVIF_GROUPID     = 0x00000100
  constant LVIF_COLUMNS (line 1663) | LVIF_COLUMNS     = 0x00000200
  constant LVFI_PARAM (line 1666) | LVFI_PARAM = 0x0001
  constant LVIS_FOCUSED (line 1670) | LVIS_FOCUSED        = 1
  constant LVIS_SELECTED (line 1671) | LVIS_SELECTED       = 2
  constant LVIS_CUT (line 1672) | LVIS_CUT            = 4
  constant LVIS_DROPHILITED (line 1673) | LVIS_DROPHILITED    = 8
  constant LVIS_OVERLAYMASK (line 1674) | LVIS_OVERLAYMASK    = 0xF00
  constant LVIS_STATEIMAGEMASK (line 1675) | LVIS_STATEIMAGEMASK = 0xF000
  constant LVHT_NOWHERE (line 1680) | LVHT_NOWHERE         = 0x00000001
  constant LVHT_ONITEMICON (line 1681) | LVHT_ONITEMICON      = 0x00000002
  constant LVHT_ONITEMLABEL (line 1682) | LVHT_ONITEMLABEL     = 0x00000004
  constant LVHT_ONITEMSTATEICON (line 1683) | LVHT_ONITEMSTATEICON = 0x00000008
  constant LVHT_ONITEM (line 1684) | LVHT_ONITEM          = LVHT_ONITEMICON | LVHT_ONITEMLABEL | LVHT_ONITEMS...
  constant LVHT_ABOVE (line 1686) | LVHT_ABOVE   = 0x00000008
  constant LVHT_BELOW (line 1687) | LVHT_BELOW   = 0x00000010
  constant LVHT_TORIGHT (line 1688) | LVHT_TORIGHT = 0x00000020
  constant LVHT_TOLEFT (line 1689) | LVHT_TOLEFT  = 0x00000040
  constant LVSIL_NORMAL (line 1694) | LVSIL_NORMAL      = 0
  constant LVSIL_SMALL (line 1695) | LVSIL_SMALL       = 1
  constant LVSIL_STATE (line 1696) | LVSIL_STATE       = 2
  constant LVSIL_GROUPHEADER (line 1697) | LVSIL_GROUPHEADER = 3
  constant ICC_LISTVIEW_CLASSES (line 1702) | ICC_LISTVIEW_CLASSES   = 1
  constant ICC_TREEVIEW_CLASSES (line 1703) | ICC_TREEVIEW_CLASSES   = 2
  constant ICC_BAR_CLASSES (line 1704) | ICC_BAR_CLASSES        = 4
  constant ICC_TAB_CLASSES (line 1705) | ICC_TAB_CLASSES        = 8
  constant ICC_UPDOWN_CLASS (line 1706) | ICC_UPDOWN_CLASS       = 16
  constant ICC_PROGRESS_CLASS (line 1707) | ICC_PROGRESS_CLASS     = 32
  constant ICC_HOTKEY_CLASS (line 1708) | ICC_HOTKEY_CLASS       = 64
  constant ICC_ANIMATE_CLASS (line 1709) | ICC_ANIMATE_CLASS      = 128
  constant ICC_WIN95_CLASSES (line 1710) | ICC_WIN95_CLASSES      = 255
  constant ICC_DATE_CLASSES (line 1711) | ICC_DATE_CLASSES       = 256
  constant ICC_USEREX_CLASSES (line 1712) | ICC_USEREX_CLASSES     = 512
  constant ICC_COOL_CLASSES (line 1713) | ICC_COOL_CLASSES       = 1024
  constant ICC_INTERNET_CLASSES (line 1714) | ICC_INTERNET_CLASSES   = 2048
  constant ICC_PAGESCROLLER_CLASS (line 1715) | ICC_PAGESCROLLER_CLASS = 4096
  constant ICC_NATIVEFNTCTL_CLASS (line 1716) | ICC_NATIVEFNTCTL_CLASS = 8192
  constant INFOTIPSIZE (line 1717) | INFOTIPSIZE            = 1024
  constant ICC_STANDARD_CLASSES (line 1718) | ICC_STANDARD_CLASSES   = 0x00004000
  constant ICC_LINK_CLASS (line 1719) | ICC_LINK_CLASS         = 0x00008000
  constant DLGC_WANTARROWS (line 1724) | DLGC_WANTARROWS      = 0x0001
  constant DLGC_WANTTAB (line 1725) | DLGC_WANTTAB         = 0x0002
  constant DLGC_WANTALLKEYS (line 1726) | DLGC_WANTALLKEYS     = 0x0004
  constant DLGC_WANTMESSAGE (line 1727) | DLGC_WANTMESSAGE     = 0x0004
  constant DLGC_HASSETSEL (line 1728) | DLGC_HASSETSEL       = 0x0008
  constant DLGC_DEFPUSHBUTTON (line 1729) | DLGC_DEFPUSHBUTTON   = 0x0010
  constant DLGC_UNDEFPUSHBUTTON (line 1730) | DLGC_UNDEFPUSHBUTTON = 0x0020
  constant DLGC_RADIOBUTTON (line 1731) | DLGC_RADIOBUTTON     = 0x0040
  constant DLGC_WANTCHARS (line 1732) | DLGC_WANTCHARS       = 0x0080
  constant DLGC_STATIC (line 1733) | DLGC_STATIC          = 0x0100
  constant DLGC_BUTTON (line 1734) | DLGC_BUTTON          = 0x2000
  constant DWL_MSGRESULT (line 1739) | DWL_MSGRESULT = 0
  constant DWL_DLGPROC (line 1740) | DWL_DLGPROC   = 4
  constant DWL_USER (line 1741) | DWL_USER      = 8
  constant HKEY_CLASSES_ROOT (line 1746) | HKEY_CLASSES_ROOT     HKEY = 0x80000000
  constant HKEY_CURRENT_USER (line 1747) | HKEY_CURRENT_USER     HKEY = 0x80000001
  constant HKEY_LOCAL_MACHINE (line 1748) | HKEY_LOCAL_MACHINE    HKEY = 0x80000002
  constant HKEY_USERS (line 1749) | HKEY_USERS            HKEY = 0x80000003
  constant HKEY_PERFORMANCE_DATA (line 1750) | HKEY_PERFORMANCE_DATA HKEY = 0x80000004
  constant HKEY_CURRENT_CONFIG (line 1751) | HKEY_CURRENT_CONFIG   HKEY = 0x80000005
  constant HKEY_DYN_DATA (line 1752) | HKEY_DYN_DATA         HKEY = 0x80000006
  constant KEY_ALL_ACCESS (line 1757) | KEY_ALL_ACCESS         = 0xF003F
  constant KEY_CREATE_SUB_KEY (line 1758) | KEY_CREATE_SUB_KEY     = 0x0004
  constant KEY_ENUMERATE_SUB_KEYS (line 1759) | KEY_ENUMERATE_SUB_KEYS = 0x0008
  constant KEY_NOTIFY (line 1760) | KEY_NOTIFY             = 0x0010
  constant KEY_QUERY_VALUE (line 1761) | KEY_QUERY_VALUE        = 0x0001
  constant KEY_SET_VALUE (line 1762) | KEY_SET_VALUE          = 0x0002
  constant KEY_READ (line 1763) | KEY_READ               = 0x20019
  constant KEY_WRITE (line 1764) | KEY_WRITE              = 0x20006
  constant NFR_ANSI (line 1768) | NFR_ANSI    = 1
  constant NFR_UNICODE (line 1769) | NFR_UNICODE = 2
  constant NF_QUERY (line 1770) | NF_QUERY    = 3
  constant NF_REQUERY (line 1771) | NF_REQUERY  = 4
  constant RRF_RT_REG_NONE (line 1776) | RRF_RT_REG_NONE         = 0x00000001
  constant RRF_RT_REG_SZ (line 1777) | RRF_RT_REG_SZ           = 0x00000002
  constant RRF_RT_REG_EXPAND_SZ (line 1778) | RRF_RT_REG_EXPAND_SZ    = 0x00000004
  constant RRF_RT_REG_BINARY (line 1779) | RRF_RT_REG_BINARY       = 0x00000008
  constant RRF_RT_REG_DWORD (line 1780) | RRF_RT_REG_DWORD        = 0x00000010
  constant RRF_RT_REG_MULTI_SZ (line 1781) | RRF_RT_REG_MULTI_SZ     = 0x00000020
  constant RRF_RT_REG_QWORD (line 1782) | RRF_RT_REG_QWORD        = 0x00000040
  constant RRF_RT_DWORD (line 1783) | RRF_RT_DWORD            = (RRF_RT_REG_BINARY | RRF_RT_REG_DWORD)
  constant RRF_RT_QWORD (line 1784) | RRF_RT_QWORD            = (RRF_RT_REG_BINARY | RRF_RT_REG_QWORD)
  constant RRF_RT_ANY (line 1785) | RRF_RT_ANY              = 0x0000ffff
  constant RRF_NOEXPAND (line 1786) | RRF_NOEXPAND            = 0x10000000
  constant RRF_ZEROONFAILURE (line 1787) | RRF_ZEROONFAILURE       = 0x20000000
  constant REG_PROCESS_APPKEY (line 1788) | REG_PROCESS_APPKEY      = 0x00000001
  constant REG_MUI_STRING_TRUNCATE (line 1789) | REG_MUI_STRING_TRUNCATE = 0x00000001
  constant PM_NOREMOVE (line 1794) | PM_NOREMOVE = 0x000
  constant PM_REMOVE (line 1795) | PM_REMOVE   = 0x001
  constant PM_NOYIELD (line 1796) | PM_NOYIELD  = 0x002
  constant ILC_MASK (line 1801) | ILC_MASK             = 0x00000001
  constant ILC_COLOR (line 1802) | ILC_COLOR            = 0x00000000
  constant ILC_COLORDDB (line 1803) | ILC_COLORDDB         = 0x000000FE
  constant ILC_COLOR4 (line 1804) | ILC_COLOR4           = 0x00000004
  constant ILC_COLOR8 (line 1805) | ILC_COLOR8           = 0x00000008
  constant ILC_COLOR16 (line 1806) | ILC_COLOR16          = 0x00000010
  constant ILC_COLOR24 (line 1807) | ILC_COLOR24          = 0x00000018
  constant ILC_COLOR32 (line 1808) | ILC_COLOR32          = 0x00000020
  constant ILC_PALETTE (line 1809) | ILC_PALETTE          = 0x00000800
  constant ILC_MIRROR (line 1810) | ILC_MIRROR           = 0x00002000
  constant ILC_PERITEMMIRROR (line 1811) | ILC_PERITEMMIRROR    = 0x00008000
  constant ILC_ORIGINALSIZE (line 1812) | ILC_ORIGINALSIZE     = 0x00010000
  constant ILC_HIGHQUALITYSCALE (line 1813) | ILC_HIGHQUALITYSCALE = 0x00020000
  constant KF_EXTENDED (line 1818) | KF_EXTENDED = 0x0100
  constant KF_DLGMODE (line 1819) | KF_DLGMODE  = 0x0800
  constant KF_MENUMODE (line 1820) | KF_MENUMODE = 0x1000
  constant KF_ALTDOWN (line 1821) | KF_ALTDOWN  = 0x2000
  constant KF_REPEAT (line 1822) | KF_REPEAT   = 0x4000
  constant KF_UP (line 1823) | KF_UP       = 0x8000
  constant REG_NONE (line 1992) | REG_NONE                       = 0
  constant REG_SZ (line 1993) | REG_SZ                         = 1
  constant REG_EXPAND_SZ (line 1994) | REG_EXPAND_SZ                  = 2
  constant REG_BINARY (line 1995) | REG_BINARY                     = 3
  constant REG_DWORD (line 1996) | REG_DWORD                      = 4
  constant REG_DWORD_LITTLE_ENDIAN (line 1997) | REG_DWORD_LITTLE_ENDIAN        = 4
  constant REG_DWORD_BIG_ENDIAN (line 1998) | REG_DWORD_BIG_ENDIAN           = 5
  constant REG_LINK (line 1999) | REG_LINK                       = 6
  constant REG_MULTI_SZ (line 2000) | REG_MULTI_SZ                   = 7
  constant REG_RESOURCE_LIST (line 2001) | REG_RESOURCE_LIST              = 8
  constant REG_FULL_RESOURCE_DESCRIPTOR (line 2002) | REG_FULL_RESOURCE_DESCRIPTOR   = 9
  constant REG_RESOURCE_REQUIREMENTS_LIST (line 2003) | REG_RESOURCE_REQUIREMENTS_LIST = 10
  constant REG_QWORD (line 2004) | REG_QWORD                      = 11
  constant REG_QWORD_LITTLE_ENDIAN (line 2005) | REG_QWORD_LITTLE_ENDIAN        = 11
  constant TTS_ALWAYSTIP (line 2010) | TTS_ALWAYSTIP      = 0x01
  constant TTS_NOPREFIX (line 2011) | TTS_NOPREFIX       = 0x02
  constant TTS_NOANIMATE (line 2012) | TTS_NOANIMATE      = 0x10
  constant TTS_NOFADE (line 2013) | TTS_NOFADE         = 0x20
  constant TTS_BALLOON (line 2014) | TTS_BALLOON        = 0x40
  constant TTS_CLOSE (line 2015) | TTS_CLOSE          = 0x80
  constant TTS_USEVISUALSTYLE (line 2016) | TTS_USEVISUALSTYLE = 0x100
  constant TTM_ACTIVATE (line 2021) | TTM_ACTIVATE        = (WM_USER + 1)
  constant TTM_SETDELAYTIME (line 2022) | TTM_SETDELAYTIME    = (WM_USER + 3)
  constant TTM_ADDTOOL (line 2023) | TTM_ADDTOOL         = (WM_USER + 50)
  constant TTM_DELTOOL (line 2024) | TTM_DELTOOL         = (WM_USER + 51)
  constant TTM_NEWTOOLRECT (line 2025) | TTM_NEWTOOLRECT     = (WM_USER + 52)
  constant TTM_RELAYEVENT (line 2026) | TTM_RELAYEVENT      = (WM_USER + 7)
  constant TTM_GETTOOLINFO (line 2027) | TTM_GETTOOLINFO     = (WM_USER + 53)
  constant TTM_SETTOOLINFO (line 2028) | TTM_SETTOOLINFO     = (WM_USER + 54)
  constant TTM_HITTEST (line 2029) | TTM_HITTEST         = (WM_USER + 55)
  constant TTM_GETTEXT (line 2030) | TTM_GETTEXT         = (WM_USER + 56)
  constant TTM_UPDATETIPTEXT (line 2031) | TTM_UPDATETIPTEXT   = (WM_USER + 57)
  constant TTM_GETTOOLCOUNT (line 2032) | TTM_GETTOOLCOUNT    = (WM_USER + 13)
  constant TTM_ENUMTOOLS (line 2033) | TTM_ENUMTOOLS       = (WM_USER + 58)
  constant TTM_GETCURRENTTOOL (line 2034) | TTM_GETCURRENTTOOL  = (WM_USER + 59)
  constant TTM_WINDOWFROMPOINT (line 2035) | TTM_WINDOWFROMPOINT = (WM_USER + 16)
  constant TTM_TRACKACTIVATE (line 2036) | TTM_TRACKACTIVATE   = (WM_USER + 17)
  constant TTM_TRACKPOSITION (line 2037) | TTM_TRACKPOSITION   = (WM_USER + 18)
  constant TTM_SETTIPBKCOLOR (line 2038) | TTM_SETTIPBKCOLOR   = (WM_USER + 19)
  constant TTM_SETTIPTEXTCOLOR (line 2039) | TTM_SETTIPTEXTCOLOR = (WM_USER + 20)
  constant TTM_GETDELAYTIME (line 2040) | TTM_GETDELAYTIME    = (WM_USER + 21)
  constant TTM_GETTIPBKCOLOR (line 2041) | TTM_GETTIPBKCOLOR   = (WM_USER + 22)
  constant TTM_GETTIPTEXTCOLOR (line 2042) | TTM_GETTIPTEXTCOLOR = (WM_USER + 23)
  constant TTM_SETMAXTIPWIDTH (line 2043) | TTM_SETMAXTIPWIDTH  = (WM_USER + 24)
  constant TTM_GETMAXTIPWIDTH (line 2044) | TTM_GETMAXTIPWIDTH  = (WM_USER + 25)
  constant TTM_SETMARGIN (line 2045) | TTM_SETMARGIN       = (WM_USER + 26)
  constant TTM_GETMARGIN (line 2046) | TTM_GETMARGIN       = (WM_USER + 27)
  constant TTM_POP (line 2047) | TTM_POP             = (WM_USER + 28)
  constant TTM_UPDATE (line 2048) | TTM_UPDATE          = (WM_USER + 29)
  constant TTM_GETBUBBLESIZE (line 2049) | TTM_GETBUBBLESIZE   = (WM_USER + 30)
  constant TTM_ADJUSTRECT (line 2050) | TTM_ADJUSTRECT      = (WM_USER + 31)
  constant TTM_SETTITLE (line 2051) | TTM_SETTITLE        = (WM_USER + 33)
  constant TTM_POPUP (line 2052) | TTM_POPUP           = (WM_USER + 34)
  constant TTM_GETTITLE (line 2053) | TTM_GETTITLE        = (WM_USER + 35)
  constant TTI_NONE (line 2058) | TTI_NONE          = 0
  constant TTI_INFO (line 2059) | TTI_INFO          = 1
  constant TTI_WARNING (line 2060) | TTI_WARNING       = 2
  constant TTI_ERROR (line 2061) | TTI_ERROR         = 3
  constant TTI_INFO_LARGE (line 2062) | TTI_INFO_LARGE    = 4
  constant TTI_WARNING_LARGE (line 2063) | TTI_WARNING_LARGE = 5
  constant TTI_ERROR_LARGE (line 2064) | TTI_ERROR_LARGE   = 6
  constant TTN_FIRST (line 2069) | TTN_FIRST       = -520
  constant TTN_LAST (line 2070) | TTN_LAST        = -549
  constant TTN_GETDISPINFO (line 2071) | TTN_GETDISPINFO = (TTN_FIRST - 10)
  constant TTN_SHOW (line 2072) | TTN_SHOW        = (TTN_FIRST - 1)
  constant TTN_POP (line 2073) | TTN_POP         = (TTN_FIRST - 2)
  constant TTN_LINKCLICK (line 2074) | TTN_LINKCLICK   = (TTN_FIRST - 3)
  constant TTN_NEEDTEXT (line 2075) | TTN_NEEDTEXT    = TTN_GETDISPINFO
  constant TTF_IDISHWND (line 2079) | TTF_IDISHWND    = 0x0001
  constant TTF_CENTERTIP (line 2080) | TTF_CENTERTIP   = 0x0002
  constant TTF_RTLREADING (line 2081) | TTF_RTLREADING  = 0x0004
  constant TTF_SUBCLASS (line 2082) | TTF_SUBCLASS    = 0x0010
  constant TTF_TRACK (line 2083) | TTF_TRACK       = 0x0020
  constant TTF_ABSOLUTE (line 2084) | TTF_ABSOLUTE    = 0x0080
  constant TTF_TRANSPARENT (line 2085) | TTF_TRANSPARENT = 0x0100
  constant TTF_PARSELINKS (line 2086) | TTF_PARSELINKS  = 0x1000
  constant TTF_DI_SETITEM (line 2087) | TTF_DI_SETITEM  = 0x8000
  constant SWP_NOSIZE (line 2091) | SWP_NOSIZE         = 0x0001
  constant SWP_NOMOVE (line 2092) | SWP_NOMOVE         = 0x0002
  constant SWP_NOZORDER (line 2093) | SWP_NOZORDER       = 0x0004
  constant SWP_NOREDRAW (line 2094) | SWP_NOREDRAW       = 0x0008
  constant SWP_NOACTIVATE (line 2095) | SWP_NOACTIVATE     = 0x0010
  constant SWP_FRAMECHANGED (line 2096) | SWP_FRAMECHANGED   = 0x0020
  constant SWP_SHOWWINDOW (line 2097) | SWP_SHOWWINDOW     = 0x0040
  constant SWP_HIDEWINDOW (line 2098) | SWP_HIDEWINDOW     = 0x0080
  constant SWP_NOCOPYBITS (line 2099) | SWP_NOCOPYBITS     = 0x0100
  constant SWP_NOOWNERZORDER (line 2100) | SWP_NOOWNERZORDER  = 0x0200
  constant SWP_NOSENDCHANGING (line 2101) | SWP_NOSENDCHANGING = 0x0400
  constant SWP_DRAWFRAME (line 2102) | SWP_DRAWFRAME      = SWP_FRAMECHANGED
  constant SWP_NOREPOSITION (line 2103) | SWP_NOREPOSITION   = SWP_NOOWNERZORDER
  constant SWP_DEFERERASE (line 2104) | SWP_DEFERERASE     = 0x2000
  constant SWP_ASYNCWINDOWPOS (line 2105) | SWP_ASYNCWINDOWPOS = 0x4000
  constant HWND_BROADCAST (line 2110) | HWND_BROADCAST = HWND(0xFFFF)
  constant HWND_BOTTOM (line 2111) | HWND_BOTTOM    = HWND(1)
  constant HWND_NOTOPMOST (line 2112) | HWND_NOTOPMOST = ^HWND(1)
  constant HWND_TOP (line 2113) | HWND_TOP       = HWND(0)
  constant HWND_TOPMOST (line 2114) | HWND_TOPMOST   = ^HWND(0)
  constant HWND_DESKTOP (line 2115) | HWND_DESKTOP   = HWND(0)
  constant HWND_MESSAGE (line 2116) | HWND_MESSAGE   = ^HWND(2)
  constant PS_COSMETIC (line 2121) | PS_COSMETIC  = 0x00000000
  constant PS_GEOMETRIC (line 2122) | PS_GEOMETRIC = 0x00010000
  constant PS_TYPE_MASK (line 2123) | PS_TYPE_MASK = 0x000F0000
  constant PS_SOLID (line 2128) | PS_SOLID       = 0
  constant PS_DASH (line 2129) | PS_DASH        = 1
  constant PS_DOT (line 2130) | PS_DOT         = 2
  constant PS_DASHDOT (line 2131) | PS_DASHDOT     = 3
  constant PS_DASHDOTDOT (line 2132) | PS_DASHDOTDOT  = 4
  constant PS_NULL (line 2133) | PS_NULL        = 5
  constant PS_INSIDEFRAME (line 2134) | PS_INSIDEFRAME = 6
  constant PS_USERSTYLE (line 2135) | PS_USERSTYLE   = 7
  constant PS_ALTERNATE (line 2136) | PS_ALTERNATE   = 8
  constant PS_STYLE_MASK (line 2137) | PS_STYLE_MASK  = 0x0000000F
  constant PS_ENDCAP_ROUND (line 2142) | PS_ENDCAP_ROUND  = 0x00000000
  constant PS_ENDCAP_SQUARE (line 2143) | PS_ENDCAP_SQUARE = 0x00000100
  constant PS_ENDCAP_FLAT (line 2144) | PS_ENDCAP_FLAT   = 0x00000200
  constant PS_ENDCAP_MASK (line 2145) | PS_ENDCAP_MASK   = 0x00000F00
  constant PS_JOIN_ROUND (line 2150) | PS_JOIN_ROUND = 0x00000000
  constant PS_JOIN_BEVEL (line 2151) | PS_JOIN_BEVEL = 0x00001000
  constant PS_JOIN_MITER (line 2152) | PS_JOIN_MITER = 0x00002000
  constant PS_JOIN_MASK (line 2153) | PS_JOIN_MASK  = 0x0000F000
  constant HS_HORIZONTAL (line 2158) | HS_HORIZONTAL = 0
  constant HS_VERTICAL (line 2159) | HS_VERTICAL   = 1
  constant HS_FDIAGONAL (line 2160) | HS_FDIAGONAL  = 2
  constant HS_BDIAGONAL (line 2161) | HS_BDIAGONAL  = 3
  constant HS_CROSS (line 2162) | HS_CROSS      = 4
  constant HS_DIAGCROSS (line 2163) | HS_DIAGCROSS  = 5
  constant WHITE_BRUSH (line 2168) | WHITE_BRUSH         = 0
  constant LTGRAY_BRUSH (line 2169) | LTGRAY_BRUSH        = 1
  constant GRAY_BRUSH (line 2170) | GRAY_BRUSH          = 2
  constant DKGRAY_BRUSH (line 2171) | DKGRAY_BRUSH        = 3
  constant BLACK_BRUSH (line 2172) | BLACK_BRUSH         = 4
  constant NULL_BRUSH (line 2173) | NULL_BRUSH          = 5
  constant HOLLOW_BRUSH (line 2174) | HOLLOW_BRUSH        = NULL_BRUSH
  constant WHITE_PEN (line 2175) | WHITE_PEN           = 6
  constant BLACK_PEN (line 2176) | BLACK_PEN           = 7
  constant NULL_PEN (line 2177) | NULL_PEN            = 8
  constant OEM_FIXED_FONT (line 2178) | OEM_FIXED_FONT      = 10
  constant ANSI_FIXED_FONT (line 2179) | ANSI_FIXED_FONT     = 11
  constant ANSI_VAR_FONT (line 2180) | ANSI_VAR_FONT       = 12
  constant SYSTEM_FONT (line 2181) | SYSTEM_FONT         = 13
  constant DEVICE_DEFAULT_FONT (line 2182) | DEVICE_DEFAULT_FONT = 14
  constant DEFAULT_PALETTE (line 2183) | DEFAULT_PALETTE     = 15
  constant SYSTEM_FIXED_FONT (line 2184) | SYSTEM_FIXED_FONT   = 16
  constant DEFAULT_GUI_FONT (line 2185) | DEFAULT_GUI_FONT    = 17
  constant DC_BRUSH (line 2186) | DC_BRUSH            = 18
  constant DC_PEN (line 2187) | DC_PEN              = 19
  constant BS_SOLID (line 2192) | BS_SOLID         = 0
  constant BS_NULL (line 2193) | BS_NULL          = 1
  constant BS_HOLLOW (line 2194) | BS_HOLLOW        = BS_NULL
  constant BS_HATCHED (line 2195) | BS_HATCHED       = 2
  constant BS_PATTERN (line 2196) | BS_PATTERN       = 3
  constant BS_INDEXED (line 2197) | BS_INDEXED       = 4
  constant BS_DIBPATTERN (line 2198) | BS_DIBPATTERN    = 5
  constant BS_DIBPATTERNPT (line 2199) | BS_DIBPATTERNPT  = 6
  constant BS_PATTERN8X8 (line 2200) | BS_PATTERN8X8    = 7
  constant BS_DIBPATTERN8X8 (line 2201) | BS_DIBPATTERN8X8 = 8
  constant BS_MONOPATTERN (line 2202) | BS_MONOPATTERN   = 9
  constant TME_HOVER (line 2207) | TME_HOVER     = 0x00000001
  constant TME_LEAVE (line 2208) | TME_LEAVE     = 0x00000002
  constant TME_NONCLIENT (line 2209) | TME_NONCLIENT = 0x00000010
  constant TME_QUERY (line 2210) | TME_QUERY     = 0x40000000
  constant TME_CANCEL (line 2211) | TME_CANCEL    = 0x80000000
  constant HOVER_DEFAULT (line 2213) | HOVER_DEFAULT = 0xFFFFFFFF
  constant HTERROR (line 2218) | HTERROR       = (-2)
  constant HTTRANSPARENT (line 2219) | HTTRANSPARENT = (-1)
  constant HTNOWHERE (line 2220) | HTNOWHERE     = 0
  constant HTCLIENT (line 2221) | HTCLIENT      = 1
  constant HTCAPTION (line 2222) | HTCAPTION     = 2
  constant HTSYSMENU (line 2223) | HTSYSMENU     = 3
  constant HTGROWBOX (line 2224) | HTGROWBOX     = 4
  constant HTSIZE (line 2225) | HTSIZE        = HTGROWBOX
  constant HTMENU (line 2226) | HTMENU        = 5
  constant HTHSCROLL (line 2227) | HTHSCROLL     = 6
  constant HTVSCROLL (line 2228) | HTVSCROLL     = 7
  constant HTMINBUTTON (line 2229) | HTMINBUTTON   = 8
  constant HTMAXBUTTON (line 2230) | HTMAXBUTTON   = 9
  constant HTLEFT (line 2231) | HTLEFT        = 10
  constant HTRIGHT (line 2232) | HTRIGHT       = 11
  constant HTTOP (line 2233) | HTTOP         = 12
  constant HTTOPLEFT (line 2234) | HTTOPLEFT     = 13
  constant HTTOPRIGHT (line 2235) | HTTOPRIGHT    = 14
  constant HTBOTTOM (line 2236) | HTBOTTOM      = 15
  constant HTBOTTOMLEFT (line 2237) | HTBOTTOMLEFT  = 16
  constant HTBOTTOMRIGHT (line 2238) | HTBOTTOMRIGHT = 17
  constant HTBORDER (line 2239) | HTBORDER      = 18
  constant HTREDUCE (line 2240) | HTREDUCE      = HTMINBUTTON
  constant HTZOOM (line 2241) | HTZOOM        = HTMAXBUTTON
  constant HTSIZEFIRST (line 2242) | HTSIZEFIRST   = HTLEFT
  constant HTSIZELAST (line 2243) | HTSIZELAST    = HTBOTTOMRIGHT
  constant HTOBJECT (line 2244) | HTOBJECT      = 19
  constant HTCLOSE (line 2245) | HTCLOSE       = 20
  constant HTHELP (line 2246) | HTHELP        = 21
  constant DT_TOP (line 2251) | DT_TOP                  = 0x00000000
  constant DT_LEFT (line 2252) | DT_LEFT                 = 0x00000000
  constant DT_CENTER (line 2253) | DT_CENTER               = 0x00000001
  constant DT_RIGHT (line 2254) | DT_RIGHT                = 0x00000002
  constant DT_VCENTER (line 2255) | DT_VCENTER              = 0x00000004
  constant DT_BOTTOM (line 2256) | DT_BOTTOM               = 0x00000008
  constant DT_WORDBREAK (line 2257) | DT_WORDBREAK            = 0x00000010
  constant DT_SINGLELINE (line 2258) | DT_SINGLELINE           = 0x00000020
  constant DT_EXPANDTABS (line 2259) | DT_EXPANDTABS           = 0x00000040
  constant DT_TABSTOP (line 2260) | DT_TABSTOP              = 0x00000080
  constant DT_NOCLIP (line 2261) | DT_NOCLIP               = 0x00000100
  constant DT_EXTERNALLEADING (line 2262) | DT_EXTERNALLEADING      = 0x00000200
  constant DT_CALCRECT (line 2263) | DT_CALCRECT             = 0x00000400
  constant DT_NOPREFIX (line 2264) | DT_NOPREFIX             = 0x00000800
  constant DT_INTERNAL (line 2265) | DT_INTERNAL             = 0x00001000
  constant DT_EDITCONTROL (line 2266) | DT_EDITCONTROL          = 0x00002000
  constant DT_PATH_ELLIPSIS (line 2267) | DT_PATH_ELLIPSIS        = 0x00004000
  constant DT_END_ELLIPSIS (line 2268) | DT_END_ELLIPSIS         = 0x00008000
  constant DT_MODIFYSTRING (line 2269) | DT_MODIFYSTRING         = 0x00010000
  constant DT_RTLREADING (line 2270) | DT_RTLREADING           = 0x00020000
  constant DT_WORD_ELLIPSIS (line 2271) | DT_WORD_ELLIPSIS        = 0x00040000
  constant DT_NOFULLWIDTHCHARBREAK (line 2272) | DT_NOFULLWIDTHCHARBREAK = 0x00080000
  constant DT_HIDEPREFIX (line 2273) | DT_HIDEPREFIX           = 0x00100000
  constant DT_PREFIXONLY (line 2274) | DT_PREFIXONLY           = 0x00200000
  constant CLR_INVALID (line 2277) | CLR_INVALID = 0xFFFFFFFF
  constant TRANSPARENT (line 2281) | TRANSPARENT = 1
  constant OPAQUE (line 2282) | OPAQUE      = 2
  constant BKMODE_LAST (line 2283) | BKMODE_LAST = 2
  constant GMEM_FIXED (line 2288) | GMEM_FIXED          = 0x0000
  constant GMEM_MOVEABLE (line 2289) | GMEM_MOVEABLE       = 0x0002
  constant GMEM_NOCOMPACT (line 2290) | GMEM_NOCOMPACT      = 0x0010
  constant GMEM_NODISCARD (line 2291) | GMEM_NODISCARD      = 0x0020
  constant GMEM_ZEROINIT (line 2292) | GMEM_ZEROINIT       = 0x0040
  constant GMEM_MODIFY (line 2293) | GMEM_MODIFY         = 0x0080
  constant GMEM_DISCARDABLE (line 2294) | GMEM_DISCARDABLE    = 0x0100
  constant GMEM_NOT_BANKED (line 2295) | GMEM_NOT_BANKED     = 0x1000
  constant GMEM_SHARE (line 2296) | GMEM_SHARE          = 0x2000
  constant GMEM_DDESHARE (line 2297) | GMEM_DDESHARE       = 0x2000
  constant GMEM_NOTIFY (line 2298) | GMEM_NOTIFY         = 0x4000
  constant GMEM_LOWER (line 2299) | GMEM_LOWER          = GMEM_NOT_BANKED
  constant GMEM_VALID_FLAGS (line 2300) | GMEM_VALID_FLAGS    = 0x7F72
  constant GMEM_INVALID_HANDLE (line 2301) | GMEM_INVALID_HANDLE = 0x8000
  constant GHND (line 2302) | GHND                = (GMEM_MOVEABLE | GMEM_ZEROINIT)
  constant GPTR (line 2303) | GPTR                = (GMEM_FIXED | GMEM_ZEROINIT)
  constant SRCCOPY (line 2308) | SRCCOPY        = 0x00CC0020
  constant SRCPAINT (line 2309) | SRCPAINT       = 0x00EE0086
  constant SRCAND (line 2310) | SRCAND         = 0x008800C6
  constant SRCINVERT (line 2311) | SRCINVERT      = 0x00660046
  constant SRCERASE (line 2312) | SRCERASE       = 0x00440328
  constant NOTSRCCOPY (line 2313) | NOTSRCCOPY     = 0x00330008
  constant NOTSRCERASE (line 2314) | NOTSRCERASE    = 0x001100A6
  constant MERGECOPY (line 2315) | MERGECOPY      = 0x00C000CA
  constant MERGEPAINT (line 2316) | MERGEPAINT     = 0x00BB0226
  constant PATCOPY (line 2317) | PATCOPY        = 0x00F00021
  constant PATPAINT (line 2318) | PATPAINT       = 0x00FB0A09
  constant PATINVERT (line 2319) | PATINVERT      = 0x005A0049
  constant DSTINVERT (line 2320) | DSTINVERT      = 0x00550009
  constant BLACKNESS (line 2321) | BLACKNESS      = 0x00000042
  constant WHITENESS (line 2322) | WHITENESS      = 0x00FF0062
  constant NOMIRRORBITMAP (line 2323) | NOMIRRORBITMAP = 0x80000000
  constant CAPTUREBLT (line 2324) | CAPTUREBLT     = 0x40000000
  constant CF_TEXT (line 2329) | CF_TEXT            = 1
  constant CF_BITMAP (line 2330) | CF_BITMAP          = 2
  constant CF_METAFILEPICT (line 2331) | CF_METAFILEPICT    = 3
  constant CF_SYLK (line 2332) | CF_SYLK            = 4
  constant CF_DIF (line 2333) | CF_DIF             = 5
  constant CF_TIFF (line 2334) | CF_TIFF            = 6
  constant CF_OEMTEXT (line 2335) | CF_OEMTEXT         = 7
  constant CF_DIB (line 2336) | CF_DIB             = 8
  constant CF_PALETTE (line 2337) | CF_PALETTE         = 9
  constant CF_PENDATA (line 2338) | CF_PENDATA         = 10
  constant CF_RIFF (line 2339) | CF_RIFF            = 11
  constant CF_WAVE (line 2340) | CF_WAVE            = 12
  constant CF_UNICODETEXT (line 2341) | CF_UNICODETEXT     = 13
  constant CF_ENHMETAFILE (line 2342) | CF_ENHMETAFILE     = 14
  constant CF_HDROP (line 2343) | CF_HDROP           = 15
  constant CF_LOCALE (line 2344) | CF_LOCALE          = 16
  constant CF_DIBV5 (line 2345) | CF_DIBV5           = 17
  constant CF_MAX (line 2346) | CF_MAX             = 18
  constant CF_OWNERDISPLAY (line 2347) | CF_OWNERDISPLAY    = 0x0080
  constant CF_DSPTEXT (line 2348) | CF_DSPTEXT         = 0x0081
  constant CF_DSPBITMAP (line 2349) | CF_DSPBITMAP       = 0x0082
  constant CF_DSPMETAFILEPICT (line 2350) | CF_DSPMETAFILEPICT = 0x0083
  constant CF_DSPENHMETAFILE (line 2351) | CF_DSPENHMETAFILE  = 0x008E
  constant CF_PRIVATEFIRST (line 2352) | CF_PRIVATEFIRST    = 0x0200
  constant CF_PRIVATELAST (line 2353) | CF_PRIVATELAST     = 0x02FF
  constant CF_GDIOBJFIRST (line 2354) | CF_GDIOBJFIRST     = 0x0300
  constant CF_GDIOBJLAST (line 2355) | CF_GDIOBJLAST      = 0x03FF
  constant BI_RGB (line 2360) | BI_RGB       = 0
  constant BI_RLE8 (line 2361) | BI_RLE8      = 1
  constant BI_RLE4 (line 2362) | BI_RLE4      = 2
  constant BI_BITFIELDS (line 2363) | BI_BITFIELDS = 3
  constant BI_JPEG (line 2364) | BI_JPEG      = 4
  constant BI_PNG (line 2365) | BI_PNG       = 5
  constant DIB_PAL_COLORS (line 2370) | DIB_PAL_COLORS = 1
  constant DIB_RGB_COLORS (line 2371) | DIB_RGB_COLORS = 0
  constant STANDARD_RIGHTS_REQUIRED (line 2375) | STANDARD_RIGHTS_REQUIRED = 0x000F
  constant SC_MANAGER_CONNECT (line 2380) | SC_MANAGER_CONNECT            = 0x0001
  constant SC_MANAGER_CREATE_SERVICE (line 2381) | SC_MANAGER_CREATE_SERVICE     = 0x0002
  constant SC_MANAGER_ENUMERATE_SERVICE (line 2382) | SC_MANAGER_ENUMERATE_SERVICE  = 0x0004
  constant SC_MANAGER_LOCK (line 2383) | SC_MANAGER_LOCK               = 0x0008
  constant SC_MANAGER_QUERY_LOCK_STATUS (line 2384) | SC_MANAGER_QUERY_LOCK_STATUS  = 0x0010
  constant SC_MANAGER_MODIFY_BOOT_CONFIG (line 2385) | SC_MANAGER_MODIFY_BOOT_CONFIG = 0x0020
  constant SC_MANAGER_ALL_ACCESS (line 2386) | SC_MANAGER_ALL_ACCESS         = STANDARD_RIGHTS_REQUIRED | SC_MANAGER_CO...
  constant SERVICE_KERNEL_DRIVER (line 2391) | SERVICE_KERNEL_DRIVER       = 0x00000001
  constant SERVICE_FILE_SYSTEM_DRIVER (line 2392) | SERVICE_FILE_SYSTEM_DRIVER  = 0x00000002
  constant SERVICE_ADAPTER (line 2393) | SERVICE_ADAPTER             = 0x00000004
  constant SERVICE_RECOGNIZER_DRIVER (line 2394) | SERVICE_RECOGNIZER_DRIVER   = 0x00000008
  constant SERVICE_DRIVER (line 2395) | SERVICE_DRIVER              = SERVICE_KERNEL_DRIVER | SERVICE_FILE_SYSTE...
  constant SERVICE_WIN32_OWN_PROCESS (line 2396) | SERVICE_WIN32_OWN_PROCESS   = 0x00000010
  constant SERVICE_WIN32_SHARE_PROCESS (line 2397) | SERVICE_WIN32_SHARE_PROCESS = 0x00000020
  constant SERVICE_WIN32 (line 2398) | SERVICE_WIN32               = SERVICE_WIN32_OWN_PROCESS | SERVICE_WIN32_...
  constant SERVICE_INTERACTIVE_PROCESS (line 2399) | SERVICE_INTERACTIVE_PROCESS = 0x00000100
  constant SERVICE_TYPE_ALL (line 2400) | SERVICE_TYPE_ALL            = SERVICE_WIN32 | SERVICE_ADAPTER | SERVICE_...
  constant SERVICE_STOPPED (line 2405) | SERVICE_STOPPED          = 0x00000001
  constant SERVICE_START_PENDING (line 2406) | SERVICE_START_PENDING    = 0x00000002
  constant SERVICE_STOP_PENDING (line 2407) | SERVICE_STOP_PENDING     = 0x00000003
  constant SERVICE_RUNNING (line 2408) | SERVICE_RUNNING          = 0x00000004
  constant SERVICE_CONTINUE_PENDING (line 2409) | SERVICE_CONTINUE_PENDING = 0x00000005
  constant SERVICE_PAUSE_PENDING (line 2410) | SERVICE_PAUSE_PENDING    = 0x00000006
  constant SERVICE_PAUSED (line 2411) | SERVICE_PAUSED           = 0x00000007
  constant SERVICE_ACCEPT_STOP (line 2416) | SERVICE_ACCEPT_STOP                  = 0x00000001
  constant SERVICE_ACCEPT_PAUSE_CONTINUE (line 2417) | SERVICE_ACCEPT_PAUSE_CONTINUE        = 0x00000002
  constant SERVICE_ACCEPT_SHUTDOWN (line 2418) | SERVICE_ACCEPT_SHUTDOWN              = 0x00000004
  constant SERVICE_ACCEPT_PARAMCHANGE (line 2419) | SERVICE_ACCEPT_PARAMCHANGE           = 0x00000008
  constant SERVICE_ACCEPT_NETBINDCHANGE (line 2420) | SERVICE_ACCEPT_NETBINDCHANGE         = 0x00000010
  constant SERVICE_ACCEPT_HARDWAREPROFILECHANGE (line 2421) | SERVICE_ACCEPT_HARDWAREPROFILECHANGE = 0x00000020
  constant SERVICE_ACCEPT_POWEREVENT (line 2422) | SERVICE_ACCEPT_POWEREVENT            = 0x00000040
  constant SERVICE_ACCEPT_SESSIONCHANGE (line 2423) | SERVICE_ACCEPT_SESSIONCHANGE         = 0x00000080
  constant SERVICE_ACCEPT_PRESHUTDOWN (line 2424) | SERVICE_ACCEPT_PRESHUTDOWN           = 0x00000100
  constant SERVICE_ACCEPT_TIMECHANGE (line 2425) | SERVICE_ACCEPT_TIMECHANGE            = 0x00000200
  constant SERVICE_ACCEPT_TRIGGEREVENT (line 2426) | SERVICE_ACCEPT_TRIGGEREVENT          = 0x00000400
  constant SERVICE_QUERY_CONFIG (line 2431) | SERVICE_QUERY_CONFIG         = 0x0001
  constant SERVICE_CHANGE_CONFIG (line 2432) | SERVICE_CHANGE_CONFIG        = 0x0002
  constant SERVICE_QUERY_STATUS (line 2433) | SERVICE_QUERY_STATUS         = 0x0004
  constant SERVICE_ENUMERATE_DEPENDENTS (line 2434) | SERVICE_ENUMERATE_DEPENDENTS = 0x0008
  constant SERVICE_START (line 2435) | SERVICE_START                = 0x0010
  constant SERVICE_STOP (line 2436) | SERVICE_STOP                 = 0x0020
  constant SERVICE_PAUSE_CONTINUE (line 2437) | SERVICE_PAUSE_CONTINUE       = 0x0040
  constant SERVICE_INTERROGATE (line 2438) | SERVICE_INTERROGATE          = 0x0080
  constant SERVICE_USER_DEFINED_CONTROL (line 2439) | SERVICE_USER_DEFINED_CONTROL = 0x0100
  constant SERVICE_ALL_ACCESS (line 2441) | SERVICE_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED |
  constant MAPVK_VK_TO_CHAR (line 2455) | MAPVK_VK_TO_CHAR   = 2
  constant MAPVK_VK_TO_VSC (line 2456) | MAPVK_VK_TO_VSC    = 0
  constant MAPVK_VSC_TO_VK (line 2457) | MAPVK_VSC_TO_VK    = 1
  constant MAPVK_VSC_TO_VK_EX (line 2458) | MAPVK_VSC_TO_VK_EX = 3
  constant EVENTLOG_SEEK_READ (line 2463) | EVENTLOG_SEEK_READ       = 0x0002
  constant EVENTLOG_SEQUENTIAL_READ (line 2464) | EVENTLOG_SEQUENTIAL_READ = 0x0001
  constant EVENTLOG_FORWARDS_READ (line 2465) | EVENTLOG_FORWARDS_READ   = 0x0004
  constant EVENTLOG_BACKWARDS_READ (line 2466) | EVENTLOG_BACKWARDS_READ  = 0x0008
  constant TH32CS_SNAPHEAPLIST (line 2471) | TH32CS_SNAPHEAPLIST = 0x00000001
  constant TH32CS_SNAPPROCESS (line 2472) | TH32CS_SNAPPROCESS  = 0x00000002
  constant TH32CS_SNAPTHREAD (line 2473) | TH32CS_SNAPTHREAD   = 0x00000004
  constant TH32CS_SNAPMODULE (line 2474) | TH32CS_SNAPMODULE   = 0x00000008
  constant TH32CS_SNAPMODULE32 (line 2475) | TH32CS_SNAPMODULE32 = 0x00000010
  constant TH32CS_INHERIT (line 2476) | TH32CS_INHERIT      = 0x80000000
  constant TH32CS_SNAPALL (line 2477) | TH32CS_SNAPALL      = TH32CS_SNAPHEAPLIST | TH32CS_SNAPMODULE | TH32CS_S...
  constant MAX_MODULE_NAME32 (line 2481) | MAX_MODULE_NAME32 = 255
  constant MAX_PATH (line 2482) | MAX_PATH          = 260
  constant FOREGROUND_BLUE (line 2486) | FOREGROUND_BLUE            = 0x0001
  constant FOREGROUND_GREEN (line 2487) | FOREGROUND_GREEN           = 0x0002
  constant FOREGROUND_RED (line 2488) | FOREGROUND_RED             = 0x0004
  constant FOREGROUND_INTENSITY (line 2489) | FOREGROUND_INTENSITY       = 0x0008
  constant BACKGROUND_BLUE (line 2490) | BACKGROUND_BLUE            = 0x0010
  constant BACKGROUND_GREEN (line 2491) | BACKGROUND_GREEN           = 0x0020
  constant BACKGROUND_RED (line 2492) | BACKGROUND_RED             = 0x0040
  constant BACKGROUND_INTENSITY (line 2493) | BACKGROUND_INTENSITY       = 0x0080
  constant COMMON_LVB_LEADING_BYTE (line 2494) | COMMON_LVB_LEADING_BYTE    = 0x0100
  constant COMMON_LVB_TRAILING_BYTE (line 2495) | COMMON_LVB_TRAILING_BYTE   = 0x0200
  constant COMMON_LVB_GRID_HORIZONTAL (line 2496) | COMMON_LVB_GRID_HORIZONTAL = 0x0400
  constant COMMON_LVB_GRID_LVERTICAL (line 2497) | COMMON_LVB_GRID_LVERTICAL  = 0x0800
  constant COMMON_LVB_GRID_RVERTICAL (line 2498) | COMMON_LVB_GRID_RVERTICAL  = 0x1000
  constant COMMON_LVB_REVERSE_VIDEO (line 2499) | COMMON_LVB_REVERSE_VIDEO   = 0x4000
  constant COMMON_LVB_UNDERSCORE (line 2500) | COMMON_LVB_UNDERSCORE      = 0x8000
  constant DWM_BB_ENABLE (line 2506) | DWM_BB_ENABLE                = 0x00000001
  constant DWM_BB_BLURREGION (line 2507) | DWM_BB_BLURREGION            = 0x00000002
  constant DWM_BB_TRANSITIONONMAXIMIZED (line 2508) | DWM_BB_TRANSITIONONMAXIMIZED = 0x00000004
  constant DWM_EC_DISABLECOMPOSITION (line 2514) | DWM_EC_DISABLECOMPOSITION = 0
  constant DWM_EC_ENABLECOMPOSITION (line 2515) | DWM_EC_ENABLECOMPOSITION  = 1
  type DWM_SHOWCONTACT (line 2519) | type DWM_SHOWCONTACT
  constant DWMSC_DOWN (line 2522) | DWMSC_DOWN      = 0x00000001
  constant DWMSC_UP (line 2523) | DWMSC_UP        = 0x00000002
  constant DWMSC_DRAG (line 2524) | DWMSC_DRAG      = 0x00000004
  constant DWMSC_HOLD (line 2525) | DWMSC_HOLD      = 0x00000008
  constant DWMSC_PENBARREL (line 2526) | DWMSC_PENBARREL = 0x00000010
  constant DWMSC_NONE (line 2527) | DWMSC_NONE      = 0x00000000
  constant DWMSC_ALL (line 2528) | DWMSC_ALL       = 0xFFFFFFFF
  type DWM_SOURCE_FRAME_SAMPLING (line 2532) | type DWM_SOURCE_FRAME_SAMPLING
  constant DWM_SOURCE_FRAME_SAMPLING_POINT (line 2538) | DWM_SOURCE_FRAME_SAMPLING_POINT = iota + 1
  constant DWM_SOURCE_FRAME_SAMPLING_COVERAGE (line 2539) | DWM_SOURCE_FRAME_SAMPLING_COVERAGE
  constant DWM_SOURCE_FRAME_SAMPLING_LAST (line 2540) | DWM_SOURCE_FRAME_SAMPLING_LAST
  constant DWM_TNP_RECTDESTINATION (line 2546) | DWM_TNP_RECTDESTINATION      = 0x00000001
  constant DWM_TNP_RECTSOURCE (line 2547) | DWM_TNP_RECTSOURCE           = 0x00000002
  constant DWM_TNP_OPACITY (line 2548) | DWM_TNP_OPACITY              = 0x00000004
  constant DWM_TNP_VISIBLE (line 2549) | DWM_TNP_VISIBLE              = 0x00000008
  constant DWM_TNP_SOURCECLIENTAREAONLY (line 2550) | DWM_TNP_SOURCECLIENTAREAONLY = 0x00000010
  type DWMFLIP3DWINDOWPOLICY (line 2554) | type DWMFLIP3DWINDOWPOLICY
  constant DWMFLIP3D_DEFAULT (line 2560) | DWMFLIP3D_DEFAULT = iota + 1
  constant DWMFLIP3D_EXCLUDEBELOW (line 2561) | DWMFLIP3D_EXCLUDEBELOW
  constant DWMFLIP3D_EXCLUDEABOVE (line 2562) | DWMFLIP3D_EXCLUDEABOVE
  constant DWMFLIP3D_LAST (line 2563) | DWMFLIP3D_LAST
  type DWMNCRENDERINGPOLICY (line 2567) | type DWMNCRENDERINGPOLICY
  constant DWMNCRP_USEWINDOWSTYLE (line 2573) | DWMNCRP_USEWINDOWSTYLE = iota + 1
  constant DWMNCRP_DISABLED (line 2574) | DWMNCRP_DISABLED
  constant DWMNCRP_ENABLED (line 2575) | DWMNCRP_ENABLED
  constant DWMNCRP_LAST (line 2576) | DWMNCRP_LAST
  type DWMTRANSITION_OWNEDWINDOW_TARGET (line 2580) | type DWMTRANSITION_OWNEDWINDOW_TARGET
  constant DWMTRANSITION_OWNEDWINDOW_NULL (line 2583) | DWMTRANSITION_OWNEDWINDOW_NULL       = -1
  constant DWMTRANSITION_OWNEDWINDOW_REPOSITION (line 2584) | DWMTRANSITION_OWNEDWINDOW_REPOSITION = 0
  type DWMWINDOWATTRIBUTE (line 2588) | type DWMWINDOWATTRIBUTE
  constant DWMWA_NCRENDERING_ENABLED (line 2594) | DWMWA_NCRENDERING_ENABLED = iota + 1
  constant DWMWA_NCRENDERING_POLICY (line 2595) | DWMWA_NCRENDERING_POLICY
  constant DWMWA_TRANSITIONS_FORCEDISABLED (line 2596) | DWMWA_TRANSITIONS_FORCEDISABLED
  constant DWMWA_ALLOW_NCPAINT (line 2597) | DWMWA_ALLOW_NCPAINT
  constant DWMWA_CAPTION_BUTTON_BOUNDS (line 2598) | DWMWA_CAPTION_BUTTON_BOUNDS
  constant DWMWA_NONCLIENT_RTL_LAYOUT (line 2599) | DWMWA_NONCLIENT_RTL_LAYOUT
  constant DWMWA_FORCE_ICONIC_REPRESENTATION (line 2600) | DWMWA_FORCE_ICONIC_REPRESENTATION
  constant DWMWA_FLIP3D_POLICY (line 2601) | DWMWA_FLIP3D_POLICY
  constant DWMWA_EXTENDED_FRAME_BOUNDS (line 2602) | DWMWA_EXTENDED_FRAME_BOUNDS
  constant DWMWA_HAS_ICONIC_BITMAP (line 2603) | DWMWA_HAS_ICONIC_BITMAP
  constant DWMWA_DISALLOW_PEEK (line 2604) | DWMWA_DISALLOW_PEEK
  constant DWMWA_EXCLUDED_FROM_PEEK (line 2605) | DWMWA_EXCLUDED_FROM_PEEK
  constant DWMWA_CLOAK (line 2606) | DWMWA_CLOAK
  constant DWMWA_CLOAKED (line 2607) | DWMWA_CLOAKED
  constant DWMWA_FREEZE_REPRESENTATION (line 2608) | DWMWA_FREEZE_REPRESENTATION
  constant DWMWA_LAST (line 2609) | DWMWA_LAST
  type GESTURE_TYPE (line 2613) | type GESTURE_TYPE
  constant GT_PEN_TAP (line 2618) | GT_PEN_TAP                 = 0
  constant GT_PEN_DOUBLETAP (line 2619) | GT_PEN_DOUBLETAP           = 1
  constant GT_PEN_RIGHTTAP (line 2620) | GT_PEN_RIGHTTAP            = 2
  constant GT_PEN_PRESSANDHOLD (line 2621) | GT_PEN_PRESSANDHOLD        = 3
  constant GT_PEN_PRESSANDHOLDABORT (line 2622) | GT_PEN_PRESSANDHOLDABORT   = 4
  constant GT_TOUCH_TAP (line 2623) | GT_TOUCH_TAP               = 5
  constant GT_TOUCH_DOUBLETAP (line 2624) | GT_TOUCH_DOUBLETAP         = 6
  constant GT_TOUCH_RIGHTTAP (line 2625) | GT_TOUCH_RIGHTTAP          = 7
  constant GT_TOUCH_PRESSANDHOLD (line 2626) | GT_TOUCH_PRESSANDHOLD      = 8
  constant GT_TOUCH_PRESSANDHOLDABORT (line 2627) | GT_TOUCH_PRESSANDHOLDABORT = 9
  constant GT_TOUCH_PRESSANDTAP (line 2628) | GT_TOUCH_PRESSANDTAP       = 10
  constant ICON_SMALL (line 2633) | ICON_SMALL  = 0
  constant ICON_BIG (line 2634) | ICON_BIG    = 1
  constant ICON_SMALL2 (line 2635) | ICON_SMALL2 = 2
  constant SIZE_RESTORED (line 2639) | SIZE_RESTORED  = 0
  constant SIZE_MINIMIZED (line 2640) | SIZE_MINIMIZED = 1
  constant SIZE_MAXIMIZED (line 2641) | SIZE_MAXIMIZED = 2
  constant SIZE_MAXSHOW (line 2642) | SIZE_MAXSHOW   = 3
  constant SIZE_MAXHIDE (line 2643) | SIZE_MAXHIDE   = 4
  constant XBUTTON1 (line 2648) | XBUTTON1 = 1
  constant XBUTTON2 (line 2649) | XBUTTON2 = 2
  constant DM_SPECVERSION (line 2654) | DM_SPECVERSION = 0x0401
  constant DM_ORIENTATION (line 2656) | DM_ORIENTATION        = 0x00000001
  constant DM_PAPERSIZE (line 2657) | DM_PAPERSIZE          = 0x00000002
  constant DM_PAPERLENGTH (line 2658) | DM_PAPERLENGTH        = 0x00000004
  constant DM_PAPERWIDTH (line 2659) | DM_PAPERWIDTH         = 0x00000008
  constant DM_SCALE (line 2660) | DM_SCALE              = 0x00000010
  constant DM_POSITION (line 2661) | DM_POSITION           = 0x00000020
  constant DM_NUP (line 2662) | DM_NUP                = 0x00000040
  constant DM_DISPLAYORIENTATION (line 2663) | DM_DISPLAYORIENTATION = 0x00000080
  constant DM_COPIES (line 2664) | DM_COPIES             = 0x00000100
  constant DM_DEFAULTSOURCE (line 2665) | DM_DEFAULTSOURCE      = 0x00000200
  constant DM_PRINTQUALITY (line 2666) | DM_PRINTQUALITY       = 0x00000400
  constant DM_COLOR (line 2667) | DM_COLOR              = 0x0000080
Condensed preview — 114 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (439K chars).
[
  {
    "path": ".gitignore",
    "chars": 192,
    "preview": "# Binaries for programs and plugins\n*.exe\n*.exe~\n*.dll\n*.so\n*.dylib\n\n# Test binary, build with `go test -c`\n*.test\n\n# Ou"
  },
  {
    "path": "AUTHORS",
    "chars": 302,
    "preview": "# This is the official list of 'Winc' authors for copyright purposes.\n\n# Names should be added to this file as\n#   Name "
  },
  {
    "path": "LICENSE",
    "chars": 1069,
    "preview": "MIT License\n\nCopyright (c) 2019 winc Authors\n\nPermission is hereby granted, free of charge, to any person obtaining a co"
  },
  {
    "path": "README.md",
    "chars": 5577,
    "preview": "# winc\n\nCommon library for Go GUI apps on Windows. It is for Windows OS only. This makes library smaller than some other"
  },
  {
    "path": "app.go",
    "chars": 2315,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "bitmap.go",
    "chars": 2674,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "brush.go",
    "chars": 1588,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "buttons.go",
    "chars": 3325,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "canvas.go",
    "chars": 4522,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "color.go",
    "chars": 422,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "combobox.go",
    "chars": 1682,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n */\n\npackage winc\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"gith"
  },
  {
    "path": "commondlgs.go",
    "chars": 3588,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "controlbase.go",
    "chars": 10056,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "controller.go",
    "chars": 1529,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "dialog.go",
    "chars": 3108,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "edit.go",
    "chars": 2566,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "event.go",
    "chars": 310,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "eventdata.go",
    "chars": 710,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "eventmanager.go",
    "chars": 404,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "examples/sample_contextmenu/app.manifest",
    "chars": 535,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n    <assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestV"
  },
  {
    "path": "examples/sample_contextmenu/main.go",
    "chars": 3061,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/tadvi/winc\"\n)\n\nfunc btnOnClick(arg *winc.Event) {\n\tfmt.Println(\"Button click"
  },
  {
    "path": "examples/sample_contextmenu/release.bat",
    "chars": 157,
    "preview": "rsrc -manifest app.manifest -ico=app.ico,application_lightning.ico,application_edit.ico,application_error.ico -o rsrc.sy"
  },
  {
    "path": "examples/sample_control/main.go",
    "chars": 759,
    "preview": "package main\n\nimport (\n\t\"github.com/tadvi/winc\"\n)\n\nfunc main() {\n\tmainWindow := NewTopForm(nil) // Our TopForm control g"
  },
  {
    "path": "examples/sample_control/topform.go",
    "chars": 1567,
    "preview": "package main\n\nimport (\n\t\"github.com/tadvi/winc\"\n\t\"github.com/tadvi/winc/w32\"\n)\n\n// TopForm displayed as topmost window u"
  },
  {
    "path": "examples/sample_docking/app.manifest",
    "chars": 503,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersi"
  },
  {
    "path": "examples/sample_docking/main.go",
    "chars": 2546,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/tadvi/winc\"\n)\n\nfunc btnOnClick(arg *winc.Event) {\n\tfmt.Println(\"Button click"
  },
  {
    "path": "examples/sample_docking/release.bat",
    "chars": 157,
    "preview": "rsrc -manifest app.manifest -ico=app.ico,application_lightning.ico,application_edit.ico,application_error.ico -o rsrc.sy"
  },
  {
    "path": "examples/sample_hello/main.go",
    "chars": 1364,
    "preview": "package main\n\nimport (\n\t\"github.com/tadvi/winc\"\n)\n\nfunc main() {\n\tmainWindow := winc.NewForm(nil)\n\tmainWindow.SetSize(40"
  },
  {
    "path": "examples/sample_image/app.manifest",
    "chars": 535,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n    <assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestV"
  },
  {
    "path": "examples/sample_image/main.go",
    "chars": 1820,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/tadvi/winc\"\n)\n\nfunc btnOnClick(arg *winc.Event) {\n\tfmt.Println(\"Button click"
  },
  {
    "path": "examples/sample_image/release.bat",
    "chars": 165,
    "preview": "rsrc -manifest app.manifest -ico=app.ico,add.ico,application_lightning.ico,application_edit.ico,application_error.ico -o"
  },
  {
    "path": "examples/sample_imagebox/app.manifest",
    "chars": 535,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n    <assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestV"
  },
  {
    "path": "examples/sample_imagebox/main.go",
    "chars": 1825,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/tadvi/winc\"\n)\n\nfunc btnOnClick(arg *winc.Event) {\n\tfmt.Println(\"Button click"
  },
  {
    "path": "examples/sample_imagebox/release.bat",
    "chars": 165,
    "preview": "rsrc -manifest app.manifest -ico=app.ico,add.ico,application_lightning.ico,application_edit.ico,application_error.ico -o"
  },
  {
    "path": "examples/sample_listview/app.manifest",
    "chars": 535,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n    <assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestV"
  },
  {
    "path": "examples/sample_listview/main.go",
    "chars": 2311,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/tadvi/winc\"\n)\n\nfunc btnOnClick(arg *winc.Event) {\n\tfmt.Println(\"Button click"
  },
  {
    "path": "examples/sample_listview/release.bat",
    "chars": 157,
    "preview": "rsrc -manifest app.manifest -ico=app.ico,application_lightning.ico,application_edit.ico,application_error.ico -o rsrc.sy"
  },
  {
    "path": "examples/sample_minimal/main.go",
    "chars": 719,
    "preview": "package main\n\nimport (\n\t\"github.com/tadvi/winc\"\n)\n\nfunc main() {\n\tmainWindow := winc.NewForm(nil)\n\tmainWindow.SetSize(40"
  },
  {
    "path": "examples/sample_scrollview/app.manifest",
    "chars": 535,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n    <assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestV"
  },
  {
    "path": "examples/sample_scrollview/main.go",
    "chars": 2517,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/tadvi/winc\"\n)\n\nfunc btnOnClick(arg *winc.Event) {\n\t//edt.SetCaption(\"Got you"
  },
  {
    "path": "examples/sample_scrollview/release.bat",
    "chars": 165,
    "preview": "rsrc -manifest app.manifest -ico=app.ico,add.ico,application_lightning.ico,application_edit.ico,application_error.ico -o"
  },
  {
    "path": "examples/sample_slider/app.manifest",
    "chars": 535,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n    <assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestV"
  },
  {
    "path": "examples/sample_slider/main.go",
    "chars": 1733,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/tadvi/winc\"\n)\n\nfunc btnOnClick(arg *winc.Event) {\n\tfmt.Println(\"Button click"
  },
  {
    "path": "examples/sample_slider/release.bat",
    "chars": 165,
    "preview": "rsrc -manifest app.manifest -ico=app.ico,add.ico,application_lightning.ico,application_edit.ico,application_error.ico -o"
  },
  {
    "path": "examples/sample_splitview/app.manifest",
    "chars": 535,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n    <assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestV"
  },
  {
    "path": "examples/sample_splitview/layout.json",
    "chars": 225,
    "preview": "{\"WindowState\":\"0 1 -1 -1 -1 -1 610 228 1310 828\",\"Controls\":[{\"X\":0,\"Y\":0,\"Width\":684,\"Height\":40},{\"X\":0,\"Y\":40,\"Width"
  },
  {
    "path": "examples/sample_splitview/main.go",
    "chars": 2208,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/tadvi/winc\"\n)\n\nfunc btnOnClick(arg *winc.Event) {\n\t//edt.SetCaption(\"Got you"
  },
  {
    "path": "examples/sample_splitview/release.bat",
    "chars": 123,
    "preview": "rsrc -manifest app.manifest -ico=app.ico,add.ico,run.ico,edit.ico,error.ico -o rsrc.syso\ngo build -ldflags=\"-H windowsgu"
  },
  {
    "path": "examples/sample_tab/app.manifest",
    "chars": 535,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n    <assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestV"
  },
  {
    "path": "examples/sample_tab/main.go",
    "chars": 3145,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/tadvi/winc\"\n)\n\nfunc btnOnClick(arg *winc.Event) {\n\tfmt.Println(\"Button click"
  },
  {
    "path": "examples/sample_tab/release.bat",
    "chars": 165,
    "preview": "rsrc -manifest app.manifest -ico=app.ico,add.ico,application_lightning.ico,application_edit.ico,application_error.ico -o"
  },
  {
    "path": "examples/sample_treeview/app.manifest",
    "chars": 535,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n    <assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestV"
  },
  {
    "path": "examples/sample_treeview/main.go",
    "chars": 2366,
    "preview": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/tadvi/winc\"\n)\n\nfunc btnOnClick(arg *winc.Event) {\n\tfmt.Println(\"Button click"
  },
  {
    "path": "examples/sample_treeview/release.bat",
    "chars": 165,
    "preview": "rsrc -manifest app.manifest -ico=app.ico,add.ico,application_lightning.ico,application_edit.ico,application_error.ico -o"
  },
  {
    "path": "font.go",
    "chars": 2234,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "form.go",
    "chars": 7383,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "globalvars.go",
    "chars": 470,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "go.mod",
    "chars": 38,
    "preview": "module github.com/tadvi/winc\n\ngo 1.12\n"
  },
  {
    "path": "icon.go",
    "chars": 1243,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "imagelist.go",
    "chars": 1381,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "imageview.go",
    "chars": 1113,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n */\n\npackage winc\n\nimport \"github.com/tadvi/winc/w32\"\n\nt"
  },
  {
    "path": "imageviewbox.go",
    "chars": 7415,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n */\n\npackage winc\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com"
  },
  {
    "path": "init.go",
    "chars": 379,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "keyboard.go",
    "chars": 13997,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "label.go",
    "chars": 539,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n */\n\npackage winc\n\nimport (\n\t\"github.com/tadvi/winc/w32\""
  },
  {
    "path": "layout.go",
    "chars": 5076,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n */\n\npackage winc\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io"
  },
  {
    "path": "listview.go",
    "chars": 14603,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n */\n\npackage winc\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"syscall\"\n"
  },
  {
    "path": "menu.go",
    "chars": 8331,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n */\n\npackage winc\n\nimport (\n\t\"fmt\"\n\t\"syscall\"\n\t\"unsafe\"\n"
  },
  {
    "path": "mousecontrol.go",
    "chars": 1153,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n */\n\npackage winc\n\nimport (\n\t\"github.com/tadvi/winc/w32\""
  },
  {
    "path": "msghandlerregistry.go",
    "chars": 513,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "panel.go",
    "chars": 4662,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n */\n\npackage winc\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/tadvi/w"
  },
  {
    "path": "path.go",
    "chars": 1696,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "pen.go",
    "chars": 1014,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "progressbar.go",
    "chars": 1090,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n */\n\npackage winc\n\nimport (\n\t\"github.com/tadvi/winc/w32\""
  },
  {
    "path": "rect.go",
    "chars": 1607,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "resizer.go",
    "chars": 4214,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n */\n\npackage winc\n\nimport (\n\t\"github.com/tadvi/winc/w32\""
  },
  {
    "path": "scrollview.go",
    "chars": 2511,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n */\n\npackage winc\n\nimport (\n\t\"unsafe\"\n\n\t\"github.com/tadv"
  },
  {
    "path": "slider.go",
    "chars": 1743,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n */\n\npackage winc\n\nimport \"github.com/tadvi/winc/w32\"\n\nt"
  },
  {
    "path": "tabview.go",
    "chars": 2332,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n */\n\npackage winc\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"gith"
  },
  {
    "path": "toolbar.go",
    "chars": 4601,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n */\n\npackage winc\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"gith"
  },
  {
    "path": "tooltip.go",
    "chars": 1125,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "treeview.go",
    "chars": 6986,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n */\n\npackage winc\n\nimport (\n\t\"errors\"\n\t\"syscall\"\n\t\"unsaf"
  },
  {
    "path": "utils.go",
    "chars": 3238,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  },
  {
    "path": "w32/comctl32.go",
    "chars": 2663,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights R"
  },
  {
    "path": "w32/comdlg32.go",
    "chars": 830,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights R"
  },
  {
    "path": "w32/constants.go",
    "chars": 94528,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights R"
  },
  {
    "path": "w32/gdi32.go",
    "chars": 13427,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights R"
  },
  {
    "path": "w32/gdiplus.go",
    "chars": 4878,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights R"
  },
  {
    "path": "w32/idispatch.go",
    "chars": 1015,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights R"
  },
  {
    "path": "w32/istream.go",
    "chars": 633,
    "preview": "/*\n * Copyright (C) 2019 Tad Vizbaras. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights Reser"
  },
  {
    "path": "w32/iunknown.go",
    "chars": 530,
    "preview": "/*\n * Copyright (C) 2019 Tad Vizbaras. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights Reser"
  },
  {
    "path": "w32/kernel32.go",
    "chars": 8741,
    "preview": "/*\n * Copyright (C) 2019 Tad Vizbaras. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights Reser"
  },
  {
    "path": "w32/ole32.go",
    "chars": 1487,
    "preview": "/*\n * Copyright (C) 2019 Tad Vizbaras. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights Reser"
  },
  {
    "path": "w32/oleaut32.go",
    "chars": 1235,
    "preview": "/*\n * Copyright (C) 2019 Tad Vizbaras. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights Reser"
  },
  {
    "path": "w32/shcore.go",
    "chars": 419,
    "preview": "package w32\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar (\n\tmodshcore = syscall.NewLazyDLL(\"shcore.dll\")\n\n\tprocGetDpiForMonitor"
  },
  {
    "path": "w32/shell32.go",
    "chars": 7038,
    "preview": "/*\n * Copyright (C) 2019 Tad Vizbaras. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights Reser"
  },
  {
    "path": "w32/shlwapi.go",
    "chars": 384,
    "preview": "package w32\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar (\n\tmodshlwapi = syscall.NewLazyDLL(\"shlwapi.dll\")\n\n\tprocSHCreateMemStr"
  },
  {
    "path": "w32/toolbar.go",
    "chars": 6087,
    "preview": "/*\n * Copyright (C) 2019 Tad Vizbaras. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights Reser"
  },
  {
    "path": "w32/typedef.go",
    "chars": 28686,
    "preview": "/*\n * Copyright (C) 2019 Tad Vizbaras. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights Reser"
  },
  {
    "path": "w32/user32.go",
    "chars": 32023,
    "preview": "/*\n * Copyright (C) 2019 Tad Vizbaras. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights Reser"
  },
  {
    "path": "w32/utils.go",
    "chars": 6442,
    "preview": "/*\n * Copyright (C) 2019 Tad Vizbaras. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights Reser"
  },
  {
    "path": "w32/uxtheme.go",
    "chars": 3595,
    "preview": "/*\n * Copyright (C) 2019 Tad Vizbaras. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights Reser"
  },
  {
    "path": "w32/vars.go",
    "chars": 771,
    "preview": "/*\n * Copyright (C) 2019 Tad Vizbaras. All Rights Reserved.\n * Copyright (C) 2010-2012 The W32 Authors. All Rights Reser"
  },
  {
    "path": "wndproc.go",
    "chars": 4380,
    "preview": "/*\n * Copyright (C) 2019 The Winc Authors. All Rights Reserved.\n * Copyright (C) 2010-2013 Allen Dang. All Rights Reserv"
  }
]

// ... and 10 more files (download for full content)

About this extraction

This page contains the full source code of the tadvi/winc GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 114 files (394.0 KB), approximately 128.7k tokens, and a symbol index with 4003 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!