It works. but only on Vista+SFSxOI wrote:This doesn't seem to be working though:
Were you trying to put a clickable link there?Code: Select all
<a href="+#DQUOTE$+"http://purebasic.com/"+#DQUOTE$+">PureBasic</a>"

It works. but only on Vista+SFSxOI wrote:This doesn't seem to be working though:
Were you trying to put a clickable link there?Code: Select all
<a href="+#DQUOTE$+"http://purebasic.com/"+#DQUOTE$+">PureBasic</a>"
Code: Select all
Structure TASKDIALOG_BUTTON
nButtonID.l
*pszButtonText
EndStructure
Structure TASKDIALOGCONFIG
cbSize.l
hwndParent.i
hInstance.i
dwFlags.l
dwCommonButtons.l
*pszWindowTitle
StructureUnion
hMainIcon.i
*pszMainIcon
EndStructureUnion
*pszMainInstruction
*pszContent
cButtons.l
*pButtons.TASKDIALOG_BUTTON
nDefaultButton.l
cRadioButtons.l
*pRadioButtons.TASKDIALOG_BUTTON
nDefaultRadioButton.l
*pszVerificationText
*pszExpandedInformation
*pszExpandedControlText
*pszCollapsedControlText
StructureUnion
hFooterIcon.i
*pszFooterIcon
EndStructureUnion
*pszFooter
*pfCallback
*lpCallbackData
cxWidth.l
EndStructure
I just pick SFSxOI piece of code up. I've changed the 2 structures.Tomi wrote:can u make an example for your code?
Code: Select all
CompilerIf #PB_Compiler_Unicode
CompilerElse
MessageRequester("Error", "You have To compile it in unicode mode", 16)
End
CompilerEndIf
Define .i
#IDOK = 1
#IDCANCEL = 2
#IDABORT = 3
#IDRETRY = 4
#IDIGNORE = 5
#IDYES = 6
#IDNO = 7
#IDCLOSE = 8
#TD_WARNING_ICON = -1
#TD_ERROR_ICON = -2
#TD_INFORMATION_ICON = -3
#TD_SHIELD_ICON = -4
#TD_ICON_BLANK = 100
#TD_ICON_WARNING = 101
#TD_ICON_QUESTION = 102
#TD_ICON_ERROR = 103
#TD_ICON_INFORMATION = 104
#TD_ICON_BLANK_AGAIN = 105
#TD_ICON_SHIELD = 106
Structure TASKDIALOGCONFIG
cbSize.l
hwndParent.i
hInstance.i
dwFlags.l
dwCommonButtons.l
*pszWindowTitle
StructureUnion
hMainIcon.i
*pszMainIcon
EndStructureUnion
*pszMainInstruction
*pszContent
cButtons.l
*pButtons.TASKDIALOG_BUTTON
nDefaultButton.l
cRadioButtons.l
*pRadioButtons.TASKDIALOG_BUTTON
nDefaultRadioButton.l
*pszVerificationText
*pszExpandedInformation
*pszExpandedControlText
*pszCollapsedControlText
StructureUnion
hFooterIcon.i
*pszFooterIcon
EndStructureUnion
*pszFooter
*pfCallback
*lpCallbackData
cxWidth.l
EndStructure
Structure TASKDIALOG_BUTTON
nButtonID.l
*pszButtonText
EndStructure
; Structure TASKDIALOG_BUTTON
; nButtonID.l
; pszButtonText.l
; EndStructure
;
; Structure TASKDIALOGCONFIG
; cbSize.l
; hwndParent.l
; hInstance.l
; dwFlags.l
; dwCommonButtons.l
; pszWindowTitle.l
; StructureUnion
; hMainIcon.l
; pszMainIcon.l
; EndStructureUnion
; pszMainInstruction.l
; pszContent.l
; cButtons.l
; pButtons.l
; nDefaultButton.l
; cRadioButtons.l
; pRadioButtons.l
; nDefaultRadioButton.l
; pszVerificationText.l
; pszExpandedInformation.l
; pszExpandedControlText.l
; pszCollapsedControlText.l
; StructureUnion
; hFooterIcon.l
; pszFooterIcon.l
; EndStructureUnion
; pszFooter.l
; pfCallback.l
; lpCallbackData.l
; cxWidth.l ;width of the Task Dialog's client area in DLU's. If 0, Task Dialog will calculate the ideal width.
; EndStructure
Dim tbButtons.TASKDIALOG_BUTTON(2)
sBtn1 = @"Heck Yeah!"
sBtn2 = @"Nope!"
sBtn3 = @"Repeat The Question?"
tbButtons(0)\nButtonID = #IDYES
tbButtons(0)\pszButtonText = sBtn1
tbButtons(1)\nButtonID = #IDNO
tbButtons(1)\pszButtonText = sBtn2
tbButtons(2)\nButtonID = #IDCANCEL
tbButtons(2)\pszButtonText = sBtn3
#ID_RADIO_BUTTON_PURE = 1002
#ID_RADIO_BUTTON_BASIC = 1003
#ID_RADIO_BUTTON_IS_NEAT = 1004
#ID_RADIO_BUTTON_FORUM = 1005
Dim ID_RADIOButtons.TASKDIALOG_BUTTON(3)
IDsBtn1 = @"Pure"
IDsBtn2 = @"Basic"
IDsBtn3 = @"Is Neat!"
IDsBtn4 = @"Go to the Purebasic Tips and Tricks Forum - select here and click the 'Heck Yeah!' button "
ID_RADIOButtons(0)\nButtonID = #ID_RADIO_BUTTON_PURE
ID_RADIOButtons(0)\pszButtonText = IDsBtn1
ID_RADIOButtons(1)\nButtonID = #ID_RADIO_BUTTON_BASIC
ID_RADIOButtons(1)\pszButtonText = IDsBtn2
ID_RADIOButtons(2)\nButtonID = #ID_RADIO_BUTTON_IS_NEAT
ID_RADIOButtons(2)\pszButtonText = IDsBtn3
ID_RADIOButtons(3)\nButtonID = #ID_RADIO_BUTTON_FORUM
ID_RADIOButtons(3)\pszButtonText = IDsBtn4
sWindowTitle = @"A Larger Task Dialog"
sMainInstruction = @"Do you want to view the larger TaskDialog?"
sContent = @"Here it is now with custom buttons."
sVerify = @"Don't show this message again"
sExpanded = @"An example provided by SFSxOI for PureBasic Tips and Tricks."
sCollapsedControlText = @"Where the heck did this come from?"
sExpandedControlText = @"Ah, got it!"
tdlg.TASKDIALOGCONFIG
tdlg\cbSize = SizeOf(tdlg)
tdlg\hwndParent = #Null
tdlg\hInstance = #Null
tdlg\dwFlags = #Null
tdlg\dwCommonButtons = #Null
tdlg\pszWindowTitle = sWindowTitle
tdlg\hMainIcon = #TD_ICON_SHIELD
tdlg\pszMainInstruction = sMainInstruction
tdlg\pszContent = sContent
tdlg\cButtons = 3
tdlg\pButtons = @tbButtons(0)\nButtonID
tdlg\cRadioButtons = 4
tdlg\pRadioButtons = @ID_RADIOButtons(0)\nButtonID
tdlg\nDefaultButton = #IDNO
tdlg\pszVerificationText = sVerify
tdlg\pszExpandedInformation = sExpanded
tdlg\pszExpandedControlText = sExpandedControlText
tdlg\pszCollapsedControlText = sCollapsedControlText
tdlg\hFooterIcon = #Null
tdlg\pszFooter = #Null
tdlg\pfCallback = #Null
;// prototype used to call TaskDialog function
Prototype TaskDialogIndirect(*tdlgx, *ClickedButtonx, *SelRadiox, *fVerifyx)
Procedure Task_DialogIndirect(tdlgx)
Global fVerifyx, SelRadiox
Protected *Task_Dialog_Func
Protected *Proto_TaskDialog.TaskDialogIndirect
Libef = OpenLibrary(#PB_Any, "comctl32.dll")
If Libef
*Task_Dialog_Func = GetFunction(Libef, "TaskDialogIndirect")
If *Task_Dialog_Func
;// assign proto pointer, but you can use *Task_Dialog_Func directly if it is declared as .TaskDialogIndirect
*Proto_TaskDialog = *Task_Dialog_Func
;CallFunctionFast(*Task_Dialog_Func, tdlgx, @ClickedButtonx, @SelRadiox, @fVerifyx)
*Proto_TaskDialog(tdlgx, @ClickedButtonx, @SelRadiox, @fVerifyx)
EndIf
EndIf
CloseLibrary(Libef)
ProcedureReturn ClickedButtonx
EndProcedure
ClickedButton = Task_DialogIndirect(tdlg)
If fVerifyx = #True
Debug "You checked the 'Do not prompt me again' box"
;set some registry To indicate so, so Next time the prompt is Not shown
Else
;clear the registry, so Next time the prompt is shown
EndIf
If SelRadiox = #ID_RADIO_BUTTON_PURE
SelRadio$ = "PURE radio button"
Else
If SelRadiox = #ID_RADIO_BUTTON_BASIC
SelRadio$ = "BASIC radio button"
Else
If SelRadiox = #ID_RADIO_BUTTON_IS_NEAT
SelRadio$ = "IS NEAT! radio button"
Else
If SelRadiox = #ID_RADIO_BUTTON_FORUM And ClickedButton = #IDYES
SelRadio$ = "Go to the Purebasic Tips and Tricks Forum"
ShellExecute_(#Null,"open","http://www.purebasic.fr/english/viewtopic.php?t=30801",#NULL$,#NULL$,#SW_SHOWMAXIMIZED)
EndIf
EndIf
EndIf
EndIf
Select ClickedButton
Case #IDOK
Debug "You clicked the OK button"
Debug "and you also clicked the " +SelRadio$
Case #IDCANCEL
Debug "You clicked the Repeat Question? button"
Debug "and you also clicked the " +SelRadio$
Case #IDABORT
Debug "You clicked the Abort button"
Debug "and you also clicked the " +SelRadio$
Case #IDRETRY
Debug "You clicked the Retry button"
Debug "and you also clicked the " +SelRadio$
Case #IDIGNORE
Debug "You clicked the Ignore button"
Debug "and you also clicked the " +SelRadio$
Case #IDNO
Debug "You clicked the Nope button"
Debug "and you also clicked the " +SelRadio$
Case #IDYES
Debug "You clicked the Heck Yeah! button"
Debug "and you also clicked the " +SelRadio$
EndSelect
No Tomi, Vista minimum.Tomi wrote:many Thanks Denis
this code work on Win XP?
Don't really know, may be a path environnement variable problem ?Edit: Found out that the DLL is not loaded. But how do I fix this?
Normally, you don't have to do thisEdit2: Found it: I had to replace both "x86" in the manifest with "amd64". Jesus...
Yes, compiling it with PB in x64 mode will set the manifest correctly, nothing more to do.jacdelad wrote: Tue May 11, 2021 9:27 pm Do you mean I can use the whole code without changes to the manifest at all?