Returns or sets a value indicating whether an error is generated when the user chooses the Cancel button.
CommDlg.CancelError [ = Bool ]
To prevent errors from occurring in your application, such as specifying a nonexistent color in the Color dialog box, you can use the CancelError property. This property lets you know if the user clicked the Cancel button on the dialog box. Each of the six dialog boxes uses the CancelError property. The CancelError property lets you set a trap (Try/Catch) for the Cancel button. When this property is set to True, GFA-BASIC 32 generates an error (CDERR_CANCEL or 32755) that you can trap in your program. If CancelError is set to False, no error occurs-the dialog box simply closes and returns a NULL value.
Global Enum CC_RGBINIT =1, CC_FULLOPEN
OpenW Hidden 1
Ocx CommDlg cd
cd.CancelError = True
cd.Flags = CC_RGBINIT Or CC_FULLOPEN
Try
cd.ShowColor
Catch
Message "Cancel clicked"
EndCatch
CloseW 1
{Created by Sjouke Hamstra; Last updated: 24/09/2014 by James Gaite}