home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Mother of All Windows Books
/
CD-MOM.iso
/
cd_mom
/
newsletr
/
vbz
/
vbz1-3
/
clrdlg.bas
< prev
next >
Wrap
BASIC Source File
|
1993-04-25
|
1KB
|
48 lines
DefInt A-Z
Type CHOOSECOLORSTRUC
lStructSize As Long
hWndOwner As Integer
hInstance As Integer
rgbResult As Long
lpCustColors As Long 'Long pointer to array of LONGs
Flags As Long
lCustData As Long 'Last three are to customize
lpfnHook As Long 'and can only be used with a
lpTemplateName As Long 'dialog box and callback
End Type
Declare Function SSegAdd Lib "QBFUNC.DLL" (MyVar As Any) As Long
Declare Function ChooseColor Lib "CommDlg.DLL" (CC As CHOOSECOLORSTRUC)
Dim ClrDlgArr As CHOOSECOLORSTRUC
'Flag Constants
Const CC_RGBINIT = 1&
Const CC_FULLOPEN = 2&
Const CC_PREVENTFULLOPEN = 4&
Const CC_SHOWHELP = &H8&
Dim CustClr&(1 To 16) 'This is to hold our custom colors
Function GetColors (Clr&, Custom)
ClrDlgArr.lStructSize = 32&
ClrDlgArr.hWndOwner = 0
ClrDlgArr.hInstance = 0
ClrDlgArr.rgbResult = Clr&
ClrDlgArr.lpCustColors = SSegAdd&(CustClr&(1))
ClrDlgArr.Flags = CC_RGBINIT
If Custom Then
If CustClr&(16) = 0 Then
For X = 1 To 15
CustClr&(X + 1) = QBColor(X)
Next
End If
Else
ClrDlgArr.Flags = ClrDlgArr.Flags Or CC_PREVENTFULLOPEN
End If
GetColors = ChooseColor(ClrDlgArr)
Clr& = ClrDlgArr.rgbResult
End Function