Page 6 of 7 FirstFirst ... 34567 LastLast
Results 201 to 240 of 274

Thread: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

  1. #201

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,653

    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.

    -Download and install the free, no ads or anything weird, Resource Hacker tool.

    -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.

  2. #202
    PowerPoster VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    2,619

    Talking 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:

    Code:
    mt.exe -manifest vb6.exe.manifest -outputresource:vb6.exe;#1

  3. #203
    Hyperactive Member
    Join Date
    Jan 2015
    Posts
    343

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    Quote Originally Posted by fafalone View Post
    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.
    Attached Files Attached Files

  4. #204
    Fanatic Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    540

    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.

  5. #205
    Lively Member
    Join Date
    Oct 2008
    Posts
    126

    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

    Thanks to all for support

  6. #206
    Fanatic Member
    Join Date
    Mar 2023
    Posts
    976

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    Didn't work for me with the resource hacker. Couldn't save the file.
    and now ending up with this..'
    Attachment 188917

  7. #207

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,653

    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.

  8. #208
    PowerPoster VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    2,619

    Cool 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.

  9. #209
    Fanatic Member
    Join Date
    Mar 2023
    Posts
    976

    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.

  10. #210
    PowerPoster VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    2,619

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    Sounds like incorrect settings inside the manifest file.

  11. #211
    Fanatic Member
    Join Date
    Mar 2023
    Posts
    976

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    Can you post out a correct manifest?

  12. #212
    Fanatic Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    540

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    Here is the content of my VB6.exe manifest:

    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity
        version="1.0.0.0"
        processorArchitecture="X86"
        name="Microsoft.VisualBasic6.IDE"
        type="win32"
    />
    <description>Microsoft Visual Basic 6 IDE</description>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity
                type="win32"
                name="Microsoft.Windows.Common-Controls"
                version="6.0.0.0"
                processorArchitecture="X86"
                publicKeyToken="6595b64144ccf1df"
                language="*"
            />
        </dependentAssembly>
    </dependency>
    </assembly>
    file size: 680 bytes

  13. #213
    PowerPoster VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    2,619

    Wink Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    You want a manifest that adds the modern theme as well: VB6.EXE.manifest.zip

  14. #214
    Fanatic Member
    Join Date
    Mar 2023
    Posts
    976

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    Thanx!! Now its working. I had a faulty manifest.

  15. #215
    Fanatic Member
    Join Date
    Apr 2015
    Location
    Finland
    Posts
    692

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    Quote Originally Posted by Mith View Post
    Maybe this info helps:
    For the 32-bit builds, correct registry hive is Wow6432Node:

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\SideBySide
    PreferExternalManifest"=dword:00000001

  16. #216
    Lively Member
    Join Date
    Mar 2020
    Posts
    83

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    Hi,
    With the demo, I try to use an icon file for the buttons but I only get 32x32 icons. The 16x16 is stretch to 32x32. Any idea ?

    Here is what I've done :
    Code:
    Private Sub Command16_Click()
    Dim hIcon1 As LongPtr, hIcon2 As LongPtr
    hIcon1 = ResIconToHICON("ICO_CLOCK", 16, 16)
    'hIcon2 = ResIconToHICON("ICO_HEART", 32, 32)
    'hIcon2 = ResIconToHICON("ICO_HEART", 16, 16)
    
    ' My test :
    Dim b() As Byte
    b = LoadIcoFile("ICO_HEART.ico")
    hIcon2 = IconToHICON(b, 16, 16)
    
    
    With TaskDialog1
        .Init
        .MainInstruction = "Look at the pretty icons."
        .IconMain = TD_SHIELD_GRADIENT_ICON
        .Title = "cTaskDialog Project"
    '    .Flags = TDF_USE_COMMAND_LINKS_NO_ICON
        .CommonButtons = TDCBF_CLOSE_BUTTON Or TDCBF_NO_BUTTON
        .AddCustomButton 103, "Button 1", hIcon2
        .AddCustomButton 102, "Button 2"
        .SetCommonButtonIcon TDCBF_NO_BUTTON, hIcon1
        .ShowDialog
    Call DestroyIcon(hIcon1)
    
        Label1.Caption = "ID of button clicked: " & .ResultMain
    End With
    End Sub

  17. #217

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,653

    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
    Then

    hIcon1 = LoadImageW(0, StrPtr(App.Path & "\ICO_CLOCK.ico"), IMAGE_ICON, 32, 32, LR_LOADFROMFILE)
    hIcon2 = LoadImageW(0, StrPtr(App.Path & "\ICO_HEART.ico"), IMAGE_ICON, 32, 32, LR_LOADFROMFILE)
    Last edited by fafalone; Oct 23rd, 2023 at 08:13 AM.

  18. #218
    Lively Member
    Join Date
    Mar 2020
    Posts
    83

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    I use LoadIcoFile and IconToHICON which you provided in mTDSample.
    I am under Windows 11 and I encounter what I describe above (#216)

    Now with the changes you suggested, it works. Thank you.

    PS: ResIconToHICON worked from the start.

  19. #219

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,653

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    Ah forgot I even had that in there... I'll have to look at where it's differing from ResIconToHICON, must be a small typo somewhere.

    Glad it's working for you now.

  20. #220
    Lively Member
    Join Date
    Mar 2020
    Posts
    83

    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.

  21. #221

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,653

    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.

  22. #222
    Lively Member
    Join Date
    Mar 2020
    Posts
    83

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    Ooops, sorry, silly me. You're right I thought it was index.
    Thanks a lot.

  23. #223

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,653

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    No worries, can't know about these kinds of issues until you first encounter them. I still get confused sometimes with how to reference resources.

  24. #224
    New Member
    Join Date
    Nov 2023
    Posts
    8

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    Hi Fafalone

    First of all, congratulations for the great programming.
    I use Task Dialod taken from the site

    https://www.accessui.com/Products/VBATaskDialog

    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?).

    Thanks in advance

    Lorenzo

  25. #225

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,653

    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.

  26. #226
    New Member
    Join Date
    Nov 2023
    Posts
    8

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    I downloaded but the date still refers to 2020.
    what do you think?

  27. #227

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,653

    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.
    Attached Files Attached Files
    Last edited by fafalone; Nov 30th, 2023 at 01:31 PM.

  28. #228
    New Member
    Join Date
    Nov 2023
    Posts
    8

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    many many thx... i'll try
    Lorenzo

  29. #229
    New Member
    Join Date
    Nov 2023
    Posts
    8

    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.

    Let me know

    Lorenzo

  30. #230

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,653

    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.

  31. #231
    New Member
    Join Date
    Nov 2023
    Posts
    8

    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)

    i'll send you report with problems

    Many thx

    Lorenzo

  32. #232
    New Member
    Join Date
    Nov 2023
    Posts
    8

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    Attachment 189414

    tomorrow i'll test "really advanced"

  33. #233
    New Member
    Join Date
    Nov 2023
    Posts
    8

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    second report
    Attachment 189418

  34. #234

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,653

    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?

  35. #235
    New Member
    Join Date
    Nov 2023
    Posts
    8

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    Quote Originally Posted by fafalone View Post
    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?
    i just send you 2 mail

    tell me if you see that!
    thx

  36. #236

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,653

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    I got them. Will take a look later today.

  37. #237

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,653

    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:
    Code:
    Public Enum SHOWWINDOW
        SW_HIDE = 0
        SW_SHOWNORMAL = 1
        SW_NORMAL = 1
        SW_SHOWMINIMIZED = 2
        SW_SHOWMAXIMIZED = 3
        SW_MAXIMIZE = 3
        SW_SHOWNOACTIVATE = 4
        SW_SHOW = 5
        SW_MINIMIZE = 6
        SW_SHOWMINNOACTIVE = 7
        SW_SHOWNA = 8
        SW_RESTORE = 9
        SW_SHOWDEFAULT = 10
    End Enum
    -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.

  38. #238
    Junior Member
    Join Date
    Apr 2014
    Posts
    21

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    Hello,
    is it possible to display the DialogBox in the middle of the window and not the screen?

  39. #239
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,891

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    I haven't tested it, but try setting the .ParentHwnd property to the Hwnd of the window you want to center over.

  40. #240
    Fanatic Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    540

    Re: [VB6] TaskDialogIndirect - Complete class implementation of Vista+ Task Dialogs

    Quote Originally Posted by Little John View Post
    Hello,
    is it possible to display the DialogBox in the middle of the window and not the screen?
    ParenthWnd property = form hWnd

Page 6 of 7 FirstFirst ... 34567 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width