/************************************
Author		: lujjjh
Date		: 2010.9
************************************/

namespace win.dlg;

var dll = ..raw.loadDll("comdlg32.dll");
var ChooseColor = dll.api("ChooseColor", "INT(struct &lpcc)");
var CHOOSECOLOR = class {
	INT lStructSize;
	int hwndOwner;
	int hInstance;
	INT rgbResult;
	string lpCustColors;
	INT Flags;
	int lCustData;
	pointer lpfnHook;
	string lpTemplateName;
}
/*intellisense(win.dlg)*/
chooseColor = function (hParent) {
	var cc = CHOOSECOLOR();
	var re;
	cc.lStructSize = ..raw.sizeof(cc);
	cc.hwndOwner = hParent;
	var rgb = 0;
	cc.rgbResult = rgb;
	cc.lpCustColors = ..string.repeat(36, " ");
	re, cc = ChooseColor(cc);
	return cc.rgbResult;
}
/*end intellisense*/