subroutine color use dfwin use comctl32 implicit none integer ghInstance integer iCustomColors(16) integer(4) hWnd integer(4) iRet integer(2) i TYPE (T_CHOOSECOLOR) getcolor ! initialze the CHOOSECOLOR structure do i = 1, 8 iCustomColors(i) = RGB( i*30, i*15, 255) end do do i = 9, 16 iCustomColors(i) = RGB( i*15,i*10,255-(i*15)) end do getcolor%lstructSize = sizeof(getcolor) ! getcolor%hwndOwner= hWnd getcolor%hwndOwner= Null ! getcolor%hInstance = ghInstance getcolor%hInstance = Null getcolor%rgbResult = rgb(0,0,0) getcolor%lpCustColors = LOC(iCustomColors) getcolor%lCustData = 0 getcolor%Flags = CC_RGBINIT getcolor%lpfnHook = Null getcolor%lpTemplateName = Null iRet= ChooseColor(getcolor) return end subroutine color