April 19, 2024, 01:34:49 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


ColorRequest() Issue

Started by Bruce Peaslee, April 17, 2012, 02:15:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bruce Peaslee

When one clicks cancel in the ColorRequest dialog, it returns zero, which is the same as picking black. How do you tell the difference?
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

ZeroDog

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.

Bruce Peaslee

It appears you get -1 when you click cancel, not zero. Oops.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles