Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
On some versions of Windows for some configurations, manifests are ignored if they aren't embedded. I had to embed mine in vb6.exe to get comctl6 stuff in the IDE as well. First, to be sure you need to, you named it VB6.EXE.manifest correct? And it was just a plain text file, with the contents of the manifest, and not the .res file, and the file size (*not* size on disk, just the actual file size) is a multiple of 4 bytes (add spaces if not)?
If everything seems fine with the external manifest, you can follow these steps to embed it in the VB6 exe instead:
-FIRST, MAKE A BACKUP COPY OF VB6.EXE. You don't want to have to reinstall if there's an issue.
-Launch it (as administrator for VB6 since it's in \Program Files (x86)), go to File->Open and choose VB6.EXE from the file dialog.
-Under the Action menu, select 'Add using script template'
-In the dialog that pops up, choose MANIFEST from the dropdown, then click Add
-You'll see the manifest text appear in the editor on the right; replace the default text with the manifest you're using (the default one RH inserts has dpi awareness enabled, which you likely don't want, although cTaskDialog is dpi aware if you do).
-The 3rd icon from the right on the tool bar is a green arrow. Click that to compile the resource.
-File->Save
You'll now have access to the task dialog as well as Visual Styles in the IDE.
Last edited by fafalone; Oct 12th, 2023 at 01:39 AM.
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
I see that you've expanded a bit the instructions for including a manifest after your previous failure to get your point across in the other thread! Just having a laugh!
This is a one-liner method to include the manifest into vb6.exe that I've been using successfully:
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
Originally Posted by fafalone
I don't believe making a whole new class for interfaces is more efficient, no. I'll add notes to the other 2 about not calling them, only one has that now.
i have ever seen a EventInterface demo by VANJA ****AR.
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
Maybe this info helps:
When searching for a win32 side-by-side manifest Windows chooses embedded manifest over any external manifests (*.manifest files). This behaviour can be controlled by a registry setting. To change manifest priority edit the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide, add a DWORD value PreferExternalManifest and set it to 1.
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
Hi
Thanks for pointing me in the right direction.
I used Mith's information, modifying the registry, because I didn't want to modify the VB6 executable.
Now I can run "TaskDialogIndirect" in Vb6 ide without any problems
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
Once again, however you're posting attachments is broken and unfortunately it's a known issue but the site owners seem uninterested in fixing it. So I can't see whatever is in what you attached.
But you need to run Resource Hacker as administror like anything else that writes to Program Files... I'll add that. Should probably have included it the first time. My bad.
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
You just copy "vb6.exe" to another location, manifest it and then overwrite the one in "Program "Files". Explorer will ask permission to elevate so that it can overwrite it. You can also keep the manifested copy as a backup for the future.
Also attachments work fine if you click the "Manage Attachments" button and then "Insert Inline". That's how I've always done it.
Last edited by VanGoghGaming; Oct 13th, 2023 at 10:58 AM.
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
This is not working well for me. Whether I do as you explain or if I use a mainfest with name of VB6.Exe in its working directory VB6 throws "Side-by-side" errors and I have also done the change in the registry which was told to eliminate the "side-by-side" error.
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
Not sure I can help without seeing the alternative functions you're using. The demo with the included functions I can't reproduce:
Those 32x32s clearly aren't scaled. Are you experiencing the same issue with the included ResIconToHICON function, or just your own LoadIcoFile/IconToHICON?
Edit: You can use this... add to mTDSample.bas:
Code:
Public Enum ImageTypes
IMAGE_BITMAP = 0
IMAGE_ICON = 1
IMAGE_CURSOR = 2
IMAGE_ENHMETAFILE = 3
End Enum
Public Enum LoadResourceFlags
LR_DEFAULTCOLOR = &H0
LR_MONOCHROME = &H1
LR_COLOR = &H2
LR_COPYRETURNORG = &H4
LR_COPYDELETEORG = &H8
LR_LOADFROMFILE = &H10
LR_LOADTRANSPARENT = &H20
LR_DEFAULTSIZE = &H40
LR_VGACOLOR = &H80
LR_LOADMAP3DCOLORS = &H1000
LR_CREATEDIBSECTION = &H2000
LR_COPYFROMRESOURCE = &H4000
LR_SHARED = &H8000&
End Enum
Public Declare PtrSafe Function LoadImageW Lib "user32" (ByVal hInst As LongPtr, ByVal lpsz As LongPtr, ByVal dwImageType As ImageTypes, ByVal dwDesiredWidth As Long, ByVal dwDesiredHeight As Long, ByVal dwFlags As LoadResourceFlags) As LongPtr
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
Hi,
I can't use some shell32/imageres icons. For example number 228 in imageres which is "update" (double circled arrows) does not display. I tried all icons in a loop from 0 to 328 and lots of icons can't be used. Is it normal ?
Last edited by Crapahute; Oct 29th, 2023 at 01:39 PM.
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
What Windows version? Windows 10 imageres does not have a 228; it has 2-198 (with some missing), then a few from each of the 1000s-6000s.
I found one like you describe at 1401 but it displays fine:
There may be some confusion here... the code expects the icon *id*, not the index. Like the one that comes after 198 might be displayed by some programs at '199' as in the 199th icon, but it's ID is 1001 (for the imageres.dll on Win10 1809, anyway), and everything in between would be invalid.
Last edited by fafalone; Oct 29th, 2023 at 06:21 PM.
because I work with Access.
Is fantastic.
With your new version:
1) Can I use your code directly in Access?
2) When opening a message in access from a pop-up window the message does not remain active. Has the problem been resolved?
3) do you think the AccessUI programmers will provide an update (based on yours?).
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
Yes, it can be used. I dropped the new code into the existing AccessUI demos from the downloads (mTDHelper.bas contents replace basTaskDialogGlobal-- remember because of the bug it must remain in the .bas, you can't move that code to the class), it mostly works, but it will need some very minor updates to work with existing code like the Demos:
-There used to be a bug where the DialogCreated event had Long instead of LongPtr for an hWnd; that bug has been fixed so a number of samples (especially the ProgressBar ones) need updating (unless you don't need to retain x64 compatibility).
-The AccessUI version defines the following custom button IDs:
Code:
TDCBF_ABORT_BUTTON = 65536
TDCBF_IGNORE_BUTTON = 131072
TDCBF_TRYAGAIN_BUTTON = 262144
TDCBF_CONTINUE_BUTTON = 524288
'// Note: Clicking the "Help" button will not close the dialog, but will
'// raise the TaskDialogPage.Help event.
'Crashes Access
TDCBF_HELP_BUTTON = 16384 '104857
(in the same enum as the other TBCBF_ values)
The Help custom button still crashes Access; no idea what's going on there, it appears to be some undocumented feature I've never seen. Will investigate.
In good news. the two red ones Icons on Buttons and Icons on Command Buttons listed as crashing Access no longer appear to do so. Maybe it was the same init issue?
One final note:
-If you copy/paste from the tB IDE, the class has exposed hidden attributes since tB doesn't hide them; you'll need to either comment out 'Attribute VB_MemberFlags...' lines and optionally redo the properties, or delete the existing one and load the new .cls from disk.
For (2), this is the first I've heard of something like this, can you provide more details?
For (3), now that it's already x64 compatible and works in Access, I don't know that there's anything for AccessUI to do. I'm not involved with their version, didn't even know about it until last year when I revisited the project for twinBASIC. Which is fine, nobody needs to inform me of using my code, it just means I don't have any insight to what their plans are. If they want to do an update, it's up to them. They put a lot of original effort into making their port. I suppose a note that since their version doesn't work in other Office products, those who wish to use cTaskDialog in Excel etc should check out my update, would be appreciated, but in no way required.
Last edited by fafalone; Nov 30th, 2023 at 10:56 AM.
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
Downloaded from where? The one attached to the first post of this thread and the one on my GitHub are the correct, recent update. It mentions 2020 as that was the last feature update, but should mention 2023 on the next line for the x64 port and recent bug fix/VBA compat update:
Code:
'************************************************************
'cTaskDialog v1.3.8 Universal Compatibility Version
'by Jon Johnson (aka fafalone)
'[email protected]
'
'Originally Released 21 March 2020
'x64 Version released 21 October 2022; update 30 Sep 2023
'************************************************************
If that's what you have at the top of cTaskDialog.cls, you're good to go.
Edit:
For convenience, I'll attach the modified VBATaskDialog64 201015.accdb and associated files I was using to test it earlier, with an additional copy of the zip file in this thread I've checked to be correct.
Last edited by fafalone; Nov 30th, 2023 at 01:31 PM.
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
hi fafalone, I'm trying the downloaded file. I'm encountering some errors. even unexpected closures.
Would you like feedback on errors?
I'm trying with ACCESS/OFFICE365 64 bit.
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
Is it the same version of Office where the AccessUI one is working?
I was testing on regular Office Pro 2021 64bit. It's possible if yours is an earlier/later version it's having trouble with a file saved by 2021; have you tried it in a new project?
But yes, absolutely if you could detail the errors, and include exactly which version of Office/Access, and Windows, you're on, and I'll install it on a VM to try to replicate if neccesary. If it comes to that, can't guarantee I'll get to it today though, might need a day or two.
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
At home i use:
Microsoft® Access® per Microsoft 365 MSO (Versione 2310 Build 16.0.16924.20054) a 64 bit
OS: Windows 11 Home
Version:22H2
Build:22621.2715
tomorrow i'll start test at work. (Office 365 and W10)
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
Both attachments are invalid... VBForums has a long-standing bug where attachments don't work if posted certain ways. Can you describe in text, attach as a file, or send by email?
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
Originally Posted by fafalone
Both attachments are invalid... VBForums has a long-standing bug where attachments don't work if posted certain ways. Can you describe in text, attach as a file, or send by email?
Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs
So with the errors you reported... hope you don't mind me addressing them here so others can benefit:
-All AppTitle errors are due to a missing customization outside cTaskDialog; AccessUI had placed Public Const AppTitle As String = "TaskDialog Samples" in the helper module. You can add that to any .bas in the project.
-TD_TRYAGAIN and TD_CONTINUE are custom values added by AccessUI, they're not part of my original cTaskDialog or the TaskDialog API. You can add them back in:
TD_TRYAGAIN = 10
TD_CONTINUE = 11
You'll also need the custom button IDs from post #225.
-For SW_SHOWNORMAL, it appears AccessUI made a private enum public. I do not recommend this. Instead, add this to one of the .bas modules:
-For the errors with hIcon2, this relates to a bug fixed in a subsequent version. They should be LongPtr, not Long.
-For the MB_ERROR issue, AccessUI has the follow in a bas (add on stuff unrelated to cTD)
Code:
Public Declare PtrSafe Function MessageBeep Lib "user32" (ByVal wType As SysBeeps) As Long
Public Enum SysBeeps
MB_DEFAULTBEEP = -1 ' the default beep sound
MB_ERROR = 16 ' for critical errors/problems
MB_WARNING = 48 ' for conditions that might cause problems in the future
MB_INFORMATION = 64 ' for informative messages only
MB_QUESTION = 32 ' (no longer recommended to be used)
End Enum
-For the SHGFI_SMALLICON, add the following to a bas (do not use theirs, it has several errors that you can get away with strictly as used, but it's a bad idea, because people (or you, for another use) will copy the code and have problems):
Code:
Private Const MAX_PATH = 260
Public Type SHFILEINFO ' shfi
hIcon As LongPtr
iIcon As Long
dwAttributes As Long
szDisplayName(MAX_PATH - 1) As Integer
szTypeName(79) As Integer
End Type
Public Enum SHGFI_flags
SHGFI_LARGEICON = &H0 ' sfi.hIcon is large icon
SHGFI_SMALLICON = &H1 ' sfi.hIcon is small icon
SHGFI_OPENICON = &H2 ' sfi.hIcon is open icon
SHGFI_SHELLICONSIZE = &H4 ' sfi.hIcon is shell size (not system size), rtns BOOL
SHGFI_PIDL = &H8 ' pszPath is pidl, rtns BOOL
' Indicates that the function should not attempt to access the file specified by pszPath.
' Rather, it should act as if the file specified by pszPath exists with the file attributes
' passed in dwFileAttributes. This flag cannot be combined with the SHGFI_ATTRIBUTES,
' SHGFI_EXETYPE, or SHGFI_PIDL flags <---- !!!
SHGFI_USEFILEATTRIBUTES = &H10 ' pretend pszPath exists, rtns BOOL
SHGFI_ADDOVERLAYS = &H20
SHGFI_OVERLAYINDEX = &H40 'Return overlay index in upper 8 bits of iIcon.
SHGFI_ICON = &H100 ' fills sfi.hIcon, rtns BOOL, use DestroyIcon
SHGFI_DISPLAYNAME = &H200 ' isf.szDisplayName is filled (SHGDN_NORMAL), rtns BOOL
SHGFI_TYPENAME = &H400 ' isf.szTypeName is filled, rtns BOOL
SHGFI_ATTRIBUTES = &H800 ' rtns IShellFolder::GetAttributesOf SFGAO_* flags
SHGFI_ICONLOCATION = &H1000 ' fills sfi.szDisplayName with filename
' containing the icon, rtns BOOL
SHGFI_EXETYPE = &H2000 ' rtns two ASCII chars of exe type
SHGFI_SYSICONINDEX = &H4000 ' sfi.iIcon is sys il icon index, rtns hImagelist
SHGFI_LINKOVERLAY = &H8000& ' add shortcut overlay to sfi.hIcon
SHGFI_SELECTED = &H10000 ' sfi.hIcon is selected icon
SHGFI_ATTR_SPECIFIED = &H20000 ' get only attributes specified in sfi.dwAttributes
End Enum
Public Declare PtrSafe Function SHGetFileInfoW Lib "shell32" (ByVal pszPath As Any, ByVal dwFileAttributes As Long, psfi As SHFILEINFO, ByVal cbFileInfo As Long, ByVal uFlags As SHGFI_flags) As LongPtr
Public Function GetSystemImagelist(uSize As Long) As LongPtr
Dim sfi As SHFILEINFO
Dim wd As String
wd = Environ("WINDIR")
wd = Left(wd, 3)
' Any valid file system path can be used to retrieve system image list handles.
GetSystemImagelist = SHGetFileInfoW(ByVal StrPtr(wd), 0, sfi, Len(sfi), SHGFI_SYSICONINDEX Or uSize)
End Function
NOTE: System image list index values change from version to version. The values they chose are not valid on Windows 10. You'd need to find new icon indexes to use.
----
So all of these are related to customizations made by AccessUI. I won't be updating my copies with their custom buttons, the rest is outside cTaskDialog.
The only one I couldn't address right now is the issue with FindCode; I can't reproduce it. The code button works fine for me in all cases. Since that's exclusively VBA stuff, might need to consult the VBA experts.