devxlogo

Windows Standard Color Dialog

Windows Standard Color Dialog

Question:
How can I call the Windows color dialog box in Powerbuilder 6.0?

Answer:
To use the Windows standard color chooser dialog, you will need to declare and use some API calls. Create a new nonvisual object and define a structure in your object with the following attributes:

long lstructsizeulong hwndownerulong hinstancelong rgbresultblob lpcustcolorslong flagslong lcustdatalong lpfnhooklong lptemplatename

Then define the following instance variables:

YOUR_STRUCTURENAME istr_ChooseColourLong il_CustomCols[16]Blob{64} ibl_CustomColours

In the constructor event add the following code:

BlobEdit( ibl_CustomColours, 1, il_CustomCol )istr_ChooseColour.lpcustcolors = ibl_CustomColours istr_ChooseColour.lStructSize = 36SetNull( istr_ChooseColor.hwndOwner )istr_ChooseColour.flags = 1

Then define the following API call:

function boolean ChooseColorA( REF YOURSTRUCTURE_NAME lpcc ) library "commdlg"

Then define a function and add the following code:

ChooseColorA ( istr_ChooseColour )RETURN istr_ChooseColor.rgbresult
See also  Why ChatGPT Is So Important Today
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist