if (lpfnHook == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
public RGB open () {		/* Get the owner HWND for the dialog */	int hwndOwner = parent.handle;	/* Create the CCHookProc */	Callback callback = new Callback (this, "CCHookProc", 4);	int lpfnHook = callback.getAddress ();		/* Allocate the Custom Colors */	Display display = parent.display;	if (display.lpCustColors == 0) {		int hHeap = OS.GetProcessHeap ();		display.lpCustColors = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, 16 * 4);	}		/* Open the dialog */		CHOOSECOLOR lpcc = new CHOOSECOLOR ();	lpcc.lStructSize = CHOOSECOLOR.sizeof;	lpcc.Flags = OS.CC_ANYCOLOR | OS.CC_ENABLEHOOK;	lpcc.lpfnHook = lpfnHook;	lpcc.hwndOwner = hwndOwner;	lpcc.lpCustColors = display.lpCustColors;	if (rgb != null) {		lpcc.Flags |= OS.CC_RGBINIT;		int red = rgb.red & 0xFF;		int green = (rgb.green << 8) & 0xFF00;		int blue = (rgb.blue << 16) & 0xFF0000;		lpcc.rgbResult = red | green | blue;	}		/* Make the parent shell be temporary modal */	Shell oldModal = null;	if ((style & (SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL)) != 0) {		oldModal = display.getModalDialogShell ();		display.setModalDialogShell (parent);	}		/* Open the dialog */	boolean success = OS.ChooseColor (lpcc);		/* Clear the temporary dialog modal parent */	if ((style & (SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL)) != 0) {		display.setModalDialogShell (oldModal);	}		if (success) {		int red = lpcc.rgbResult & 0xFF;		int green = (lpcc.rgbResult >> 8) & 0xFF;		int blue = (lpcc.rgbResult >> 16) & 0xFF;		rgb = new RGB (red, green, blue);	}		/* Free the CCHookProc */	callback.dispose ();		/* Free the Custom Colors */	/*	* This code is intentionally commented.  Currently,	* there is exactly one set of custom colors per display.	* The memory associated with these colors is released	* when the display is disposed.	*///	if (lpCustColors != 0) OS.HeapFree (hHeap, 0, lpCustColors);		/*	* This code is intentionally commented.  On some	* platforms, the owner window is repainted right	* away when a dialog window exits.  This behavior	* is currently unspecified.	*///	if (hwndOwner != 0) OS.UpdateWindow (hwndOwner);		if (!success) return null;	return rgb;}