Monday, July 12, 2010

Call ChooseColor function in PowerBuilder


First create a Custom user object and is defined as Structure (OS_ChooseColor):
long lstructsize
ulong hwndowner
ulong hinstance
long rgbresult
blob lpcustcolors
long flags
long lcustdata
long lpfnhook
long lptemplatename

Define instance variables:
Private:

os_ChooseColor istr_ChooseColor
long il_CustomInitColors [16]
blob (64) ibl_CustomColors

Defined external function::

function boolean ChooseColorA (REF os_ChooseColor lpcc) library "comdlg32.dll"

In the constructor event write the following code::

/ / Initialize choosecolor information
/ / Convert the default custom color array to a blob variable blobedit (ibl_customcolors, 1, il_custominitcolors)

/ / Let the structure element point to the blob array
istr_choosecolor.lpcustcolors = ibl_customcolors

/ / Set the size
istr_choosecolor.lStructSize = 36

/ / No owner
SetNull (istr_choosecolor.hwndOwner)

/ / Set flag
istr_choosecolor.flags = 1

Create object function: boolean of_choosecolor (ref long al_rgbresult), the code is as follows:

boolean lb_ok
istr_ChooseColor.rgbresult = al_rgbresult
lb_ok = ChooseColorA (istr_choosecolor)
al_rgbresult = istr_ChooseColor.rgbresult
return lb_ok






Recommand Link:



Youtube Video to Laptops Professional



WMA to MPC Burner



free mkv Converter



Youtube Movie To Xbox Suite



aac to mp3 CONVERTER



Picked E-Mail Tools



3gp to avi



Review Firewall And Proxy SERVERS



WorldCup DVD Ripper Platinum



Youtube FLV To VOB Deluxe



Pocket DVD Studio



Infomation PIMS And Calendars



Wondersoft DVD to iPhone Video Suite



Ipod Touch Video Format



Youtube FLV To Xbox 360 Platinum



Comparison Anti-Virus Tools



2 comments: