Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: PowerBuilder
Expertise: Beginner
May 9, 1999

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 lstructsize
ulong hwndowner
ulong hinstance
long rgbresult
blob lpcustcolors
long flags
long lcustdata
long lpfnhook
long lptemplatename
Then define the following instance variables:
YOUR_STRUCTURENAME istr_ChooseColour
Long 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 = 36
SetNull( 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
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date