'color dialog
'
uses corewin
'
Type tCHOOSECOLOR
lStructSize As Long
hwndOwner As sys
hInstance As sys
rgbResult As Long
lpCustColors As sys
flags As Long
lCustData As sys
lpfnHook As sys
lpTemplateName As sys
End Type
'
dim as int c 'returned color
dim as tCHOOSECOLOR cc 'color structure
cc.lStructSize=sizeof cc
cc.hwndOwner=0 'hwnd
cc.hInstance=GetModuleHandle 0
cc.flags=2 'fullopen
'some custom colors
dim as long cu(16)={
0x0000ff,0x8080,0x00ff00,0x808000,0xff0000
}
cc.lpCustColors=@cu
'
c=ChooseColor @cc
print hex(cc.rgbResult,6)