Hi Pablo,
I finaly found the time to dig into your code. I modified it to include the used form so i can use it as a universal replacement of the current HYPERLINK control.
Here the modified parts:
Code: Select all
*---------------------------------------------------------------------------------------------------------------------------------------------------------------*
Function MySetAddressControlProcedure(cForm, cCtrl, cURL)
LOCAL bCode, nIndex:=GetControlIndex(cCtrl, cForm )
If ("@" $ cURL )
bCode := {||ShellExecute(0, "open", "rundll32.exe", "url.dll,FileProtocolHandler mailto:" + cURL, ,1),ChangeColor(cForm,cCtrl,.F.)}
Else
bCode := {||ShellExecute(0, "open", "rundll32.exe", "url.dll,FileProtocolHandler " + cURL, ,1),ChangeColor(cForm,cCtrl,.F.)}
Endif
_HMG_SYSDATA [ 6 ][nIndex] := bCode
_HMG_SYSDATA [ 8 ][nIndex] := cURL
Return Nil
*---------------------------------------------------------------------------------------------------------------------------------------------------------------*
STATIC Function ChangeColor(cForm,cCtrlName,lOn)
LOCAL nColor:=1
LOCAL aColorNow:={ {{000,000,255} , {102,000,153}} ,; // Conventional
{{000,000,102} , {153,153,204}} ,; // Blue
{{000,102,102} , {153,255,255}} ,; // Cyan
{{080,080,080} , {153,153,153}} ,; // Gray
{{000,153,000} , {000,051,000}} ,; // Green
{{204,000,204} , {102,051,102}} ,; // Margenta
{{204,000,000} , {153,051,051}} ,; // Red
{{255,255,000} , {153,153,000}} } // Yellow
SetProperty(cForm, cCtrlName, "FONTCOLOR", aColorNow[nColor,If(lOn,1,2)])
Return Nil
*---------------------------------------------------------------------------------------------------------------------------------------------------------------*
Offcause many thanks again for helping me out !
I learned a lot from your example, for example the use of the i_UsrInit.ch file:
http://harbourminigui.com/hmgguide/user-components.htm
But i have an additional question.
For now i have to use the syntax below:
Code: Select all
@ 365,105 MyHYPERLINK hplBrochure VALUE "open" WIDTH 30 ADDRESS ""
How can i also make the syntax below possible ?
Code: Select all
DEFINE MyHYPERLINK hplBrochure
ROW 365
COL 105
VALUE "open"
WIDTH 30
ADDRESS ""
END MyHYPERLINK
Theo