func NewDialog(idd uintptr, parent win.HWND, dialogConfig *DialogConfig) (dlg *Dialog, err error) {
	if dialogConfig == nil {
		dialogConfig = &DialogConfig{}
	}
	dlg = &Dialog{
		items:  make(map[win.HWND]Widget),
		iddMap: make(map[uintptr]Widget),
		config: dialogConfig,
	}
	dlg.idd = idd
	dlg.wndCallBack = syscall.NewCallback(dlg.dialogWndProc)
	h := win.CreateDialogParam(hInstance, win.MAKEINTRESOURCE(idd), parent, dlg.wndCallBack, 0)
	if h == 0 {
		err = errors.New("Create Dialog error:" + strconv.Itoa(int(idd)))
		return
	}
	dlgCount++
	return
}
func NewDialogIndirect(idd uintptr, parent win.HWND, dialogConfig *DialogConfig) (dlg *Dialog, err error) {
dlg, err = NewDialog(idd, parent, dialogConfig)
if err != nil {
return
}
var rect = dlg.GetWindowRect()
dlg.SetBounds(Rectangle{
X:      0,
Y:      0,
Width:  int(rect.Right - rect.Left),
Height: int(rect.Bottom - rect.Top),
})
return
}
NewDialog create a new Dialog.
package wingui
import (
	"errors"
	"log"
	"strconv"
	"syscall"
	"unsafe"
	"github.com/lxn/win"
)
type Widget interface {
	WndProc(msg uint32, wParam, lParam uintptr) uintptr
	AsWindowBase() *WindowBase
}
type DialogConfig struct {
	Style uint32
	Widgets []Widget
}
type ModalDialogCallBack func(dlg *Dialog)
var dlgCount = 0
type Dialog struct {
	WindowBase
	items  map[win.HWND]Widget
	iddMap map[uintptr]Widget
	config *DialogConfig
	cb          ModalDialogCallBack
	wndCallBack uintptr
	OnClose   func() bool
	OnDestroy func()
}