IonicWind Software

IWBasic => GUI Central => Topic started by: Bruce Peaslee on April 17, 2012, 02:15:38 PM

Title: ColorRequest() Issue
Post by: Bruce Peaslee on April 17, 2012, 02:15:38 PM
When one clicks cancel in the ColorRequest dialog, it returns zero, which is the same as picking black. How do you tell the difference?
Title: Re: ColorRequest() Issue
Post by: ZeroDog on April 17, 2012, 10:33:38 PM
Hmmm... thats a good question...

Well, if the return value is 0, you could use the CommDlgExtendedError API in "Comdlg32.dll".

If the most recent call to a common dialog box function succeeded, the return value is undefined.  (this would be the case if the user selects black)

If the common dialog box function returned FALSE because the user closed or canceled the dialog box, the return value is zero. 

Otherwise, the return value is a nonzero error code.
Title: Re: ColorRequest() Issue
Post by: Bruce Peaslee on April 18, 2012, 09:45:58 AM
It appears you get -1 when you click cancel, not zero. Oops.