OPTIONS "C_CALL LABELCHECK WINFUNC NOSOURCE"
NUMERIC DIGITS 10
DO
choosecolor = "32u, void, void, 32u, 32u[16] *, 32u, 32u, void, void"
FUNCDEF("ChooseColor", "32u, struct CHOOSECOLOR dual", "comdlg32")
CATCH FAILURE
CONDITION("M")
RETURN
END
choosecolor. = 0
choosecolor.1 = 36
choosecolor.6 = 1
err = choosecolor(choosecolor)
IF err \== 0 THEN DO
SAY "RGB value:" choosecolor.4
SAY "Red value:" C2D(BITAND(D2C(choosecolor.4, 4), '000000FF'x, ' '))
SAY "Green value:" C2D(BITAND(D2C(choosecolor.4, 4), '0000FF00'x, ' ')) / 256
SAY "Blue value:" X2D(LEFT(D2X(choosecolor.4, 8), 4))
END
ELSE SAY "ERROR: Presenting Color dialog"
RETURN
colorstorgb:
RETURN ARG(1) + (ARG(2) * 256) + (ARG(3) * 65536) |