Hey all,

I was playing around with the MASM32.lib 'ColorDialog' function, and discovered it has one short coming. You can not chose the color Black because the function returns 0 if you hit cancle as well.

To me this was no good. So i made some simple changes and fixed a bug in it (EDI was not being preserved ~ I dunno how it didnt cause a Fault, but anyways).

With this version, It acts 100% the same, except that upon returning from the function, the ZERO FLAG will be set or cleared depending on if the CANCLE button was hit or not.

     invoke ColorDialog, hWnd, NULL, CC_FULLOPEN

jz @Cancle_Pressed
mov hColor, eax

This works quite nicely now, so i thought i would post it for anyone interested. You will need to overwrite your old ColorDlg.asm file in the M32LIB directory with this, and recompile your library with the MAKE.bat in the same directory. Then it will be updated into your MASM32.LIB.

Posted on 2002-04-28 20:46:30 by NaN