[Library] Dlg2 v1.0 - Common Dialogs

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
jballi
Posts: 724
Joined: 29 Sep 2013, 17:34

[Library] Dlg2 v1.0 - Common Dialogs

29 Oct 2013, 20:35

Introduction
This is a reboot of the Dlg library which was released by majkinetor in 2007. It has been been rewritten to include new features, new dialogs, and to support x64.

Dlg2 Library
Key features:
  • Common dialogs. Create and interact with many of the Microsoft Windows common dialogs. Use of the common dialogs gives the user a consistent experience across different programs.
  • Help Button. The Help button is supported for many of the common dialogs. Yes, you will have to write a custom handler function to respond to the help request but everything else is included.
What's New in Version 1.0?
There are few bug fixes, some new features and improvements, and a few new functions. In addition, the general library documentation has been moved to the _Dlg2.Doc.ahk file. Natural Docs v2.3 is used to generate HTML documentation from this file and from the function documentation. See the Release Notes for more information.

The Code
The pertinent files are as follows:
  • Project: Dlg2.zip
    This project archive includes the Dlg2 library, example scripts, and project documentation.
  • Documentation: Starting with v1.0, the project documentation is included in the project archive file (above).
Compatibility
Starting with v0.3, this project is designed to work on on recent versions of AutoHotkey v1.1+: ANSI, Unicode, and Unicode 64-bit. It is not compatible with AutoHotkey v2.0+ (yet).

Issues/Considerations
Like most, I only have one machine to test this software on (currently Windows 10 Pro). If you experience any problems with this library on your version of AutoHotkey v1.1+ and/or your version of Windows, please let me know. I will try to correct the problem.

Release Notes
Last edited by jballi on 12 Nov 2023, 16:15, edited 6 times in total.
User avatar
joedf
Posts: 8951
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: [Library] Dlg2 v0.1 (Preview) - Common Dialogs

29 Oct 2013, 20:50

nice! hahha! why not call it LibDlg ?? :) also, why not use GitHub? ;)
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
just me
Posts: 9442
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: [Library] Dlg2 v0.1 (Preview) - Common Dialogs

30 Oct 2013, 01:03

I think that AHK 1.0 support isn't needed for scripts posted in this forum. majkinators's original script will run on AHK 1.0 forever. On the other hand, support of AHK 1.0 is preventing you from using the advanced features of AHK 1.1 and makes things unnecessary complex.

Them be my thoughts.
User avatar
jballi
Posts: 724
Joined: 29 Sep 2013, 17:34

Re: [Library] Dlg2 v0.1 (Preview) - Common Dialogs

30 Oct 2013, 14:05

just me wrote:I think that AHK 1.0 support isn't needed for scripts posted in this forum. majkinators's original script will run on AHK 1.0 forever. On the other hand, support of AHK 1.0 is preventing you from using the advanced features of AHK 1.1 and makes things unnecessary complex.
Interesting observations but I couldn't disagree more.

This is an AutoHotkey forum, not a AutoHotkey v1.1+ forum. Yes, we want to encourage new users to use AutoHotkey v1.1+ but excluding AutoHotkey Basic users would be excluding a majority (yes, I said majority) of all AutoHotkey users.

Yes, there are a few AutoHotkey v1.1+ features that this library could have used to simplify a few areas but this library makes simple Windows API calls. Using advanced AHK v1.1+ features (classes, objects, etc.) would unnecessarily complicate this library, not the reverse. Some of the complexity of the library comes from supporting both 32-bit and 64-bit structure mapping. This complexity doesn't go away with AutoHotkey v1.1+.

I use AutoHotkey v1.1+ for a few projects but I, like many, still primarily use AutoHotkey Basic. Why? Because AutoHotkey Basic is wicked fast and it ain't broke. I will eventually become an AutoHotkey v1.1+ exclusive user (I've been saying this for a few years now) but for now, I use both. This library was written for all AutoHotkey users, not for the minority that use AutoHotkey v1.1+. As users convert to AutoHotkey v1.1+, as I hope they will, this library will still work (I hope).

If you read through the documentation, you'll see that the Dlg2 iteration of the library ends support for AutoHotkey Basic. Future iterations will require COM. Yes, COM is somewhat supported in AutoHotkey Basic via the COM library but the built-in support for COM in AutoHotkey v1.1+ makes this a no-brainer.

Thank you for your feedback.
User avatar
jballi
Posts: 724
Joined: 29 Sep 2013, 17:34

Re: [Library] Dlg2 v0.1 (Preview) - Common Dialogs

20 Nov 2013, 16:04

I don't have a 64-bit machine so I have not been able to do a full range of testing. Curiosity question: Has anyone running the x64 version of AutoHotkey had a chance to give this a try and if so, could you let me know what happened - good and bad. Thanks.
Guest
Posts: 57
Joined: 17 Oct 2013, 02:32

Re: [Library] Dlg2 v0.1 (Preview) - Common Dialogs

20 Nov 2013, 16:23

Win8.1/64bit - tried a quick test of both Example - Find and Replace.ahk and Example - General.ahk and it seems to work correctly, not extensively tested but clicked a few options for each test.
User avatar
jballi
Posts: 724
Joined: 29 Sep 2013, 17:34

Re: [Library] Dlg2 v0.1 (Preview) - Common Dialogs

21 Nov 2013, 11:47

Guest wrote:Win8.1/64bit - tried a quick test of both Example - Find and Replace.ahk and Example - General.ahk and it seems to work correctly, not extensively tested but clicked a few options for each test.
Good to know. Thank you for taking the time to give it a try/see.
dufferzafar
Posts: 2
Joined: 04 Oct 2013, 12:07
Location: Delhi, India
Contact:

Re: [Library] Dlg2 v0.1 (Preview) - Common Dialogs

27 Nov 2013, 05:22

Just tested on Windows 7 Home Basic x64. All seems to be fine :)

Also, as joedf suggested, Why not use Github?
User avatar
jballi
Posts: 724
Joined: 29 Sep 2013, 17:34

Re: [Library] Dlg2 v0.1 (Preview) - Common Dialogs

27 Nov 2013, 12:21

dufferzafar wrote:Just tested on Windows 7 Home Basic x64. All seems to be fine :)
Thanks for giving it a try. I know that many people will eventually migrate to x64.
dufferzafar wrote:Also, as joedf suggested, Why not use Github?
I use Gist on occasion but I'm not a GitHub user yet. I've heard good things about it so maybe I'll give it a try on a future project.
User avatar
joedf
Posts: 8951
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: [Library] Dlg2 v0.1 (Preview) - Common Dialogs

27 Nov 2013, 15:06

Me too... I used to only use Sourceforge but now since tried GitHub... It's going great! :F
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
jballi
Posts: 724
Joined: 29 Sep 2013, 17:34

Re: [Library] Dlg2 v0.2 (Preview) - Common Dialogs

28 Jun 2014, 17:16

v0.2
Bug fixes for the Open and Save functions. Minor enhancement added the ChooseFont function. See the bottom of the first post for the details.
User avatar
tank
Posts: 3122
Joined: 28 Sep 2013, 22:15
Location: CarrolltonTX
Contact:

Re: [Library] Dlg2 v0.1 (Preview) - Common Dialogs

29 Jun 2014, 08:47

jballi wrote: This is an AutoHotkey forum, not a AutoHotkey v1.1+ forum.
You are absolutly correct !!!!1!!
The domain was created to continue support for autohotkey users not autohotkey version x.xx. I am comletely against this domain forcing version choice. That is a mistake made elsewhere. This domain is about freedom of choice. We endorse the newest software. And while it has many programmerr centric niceties, enhancement that also benifet new script writers. The use of these enhancements is also a choice. A choice I strongly intend to defend.
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
guest3456
Posts: 3462
Joined: 09 Oct 2013, 10:31

Re: [Library] Dlg2 v0.1 (Preview) - Common Dialogs

29 Jun 2014, 12:35

tank wrote:
jballi wrote: This is an AutoHotkey forum, not a AutoHotkey v1.1+ forum.
You are absolutly correct !!!!1!!
The domain was created to continue support for autohotkey users not autohotkey version x.xx. I am comletely against this domain forcing version choice. That is a mistake made elsewhere. This domain is about freedom of choice. We endorse the newest software. And while it has many programmerr centric niceties, enhancement that also benifet new script writers. The use of these enhancements is also a choice. A choice I strongly intend to defend.
well said

User avatar
jballi
Posts: 724
Joined: 29 Sep 2013, 17:34

Re: Dlg2 v0.3 - Common Dialogs

04 Jan 2018, 00:38

v0.3
Minor release to fix a few minor bugs that have been on the books for a while. See the Release Notes section in the first post for the details.

This version of the library requires AutoHotkey v1.1+. The previous version of the library (v0.2) is still available. It will run on any version of AutoHotkey, including AutoHotkey Basic. Note that the bugs fixed in v0.3 have not been applied to the v0.2 version of the library but all of the bugs are minor and they do not affect ordinary use.
guest3456
Posts: 3462
Joined: 09 Oct 2013, 10:31

Re: Dlg2 v0.3 - Common Dialogs

04 Jan 2018, 01:39

jballi wrote:v0.3
Minor release to fix a few minor bugs that have been on the books for a while. See the Release Notes section in the first post for the details.

This version of the library requires AutoHotkey v1.1+. The previous version of the library (v0.2) is still available. It will run on any version of AutoHotkey, including AutoHotkey Basic. Note that the bugs fixed in v0.3 have not been applied to the v0.2 version of the library but all of the bugs are minor and they do not affect ordinary use.
may want to do an if (A_AhkVersion < 1.1) check

User avatar
jballi
Posts: 724
Joined: 29 Sep 2013, 17:34

Re: Dlg2 v0.3 - Common Dialogs

04 Jan 2018, 02:12

guest3456 wrote:may want to do an if (A_AhkVersion < 1.1) check
There is really no need for this type of release. v0.2 will run on all versions of AutoHotkey, including AutoHotkey Basic. v0.3 includes commands not supported by AutoHotkey Basic and so the script won't even run if using AutoHotkey Basic. If the script won't run, then it can't check the version of AutoHotkey. Thanks for your feedback.
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: [Library] Dlg2 v0.3 - Common Dialogs

04 May 2020, 11:32

Hello!

The library seems to be working just fine in Windows 10 , which is really good .

However , i have a slight annoyance: When I calll the Open/Save dialog with p_Type := "O" and r_Flags set to "AllowMultiSelect FileMustExist NoChangeDir HideReadOnly"... I get a non-resizable open file dialog and it is the old style. It is just «allowmultiselect» that causes this. I do not mind a lot it is the old kind of dialog, but can I have it resizable?

Thank you.

EDIT: I identified the problem: OFN_ENABLEHOOK causes it to «recede» to the old kind of open/save file dialog. Is it important ? Can I just comment it ?

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
User avatar
jballi
Posts: 724
Joined: 29 Sep 2013, 17:34

Re: [Library] Dlg2 v0.3 - Common Dialogs

04 May 2020, 12:58

The Dlg_OFNHookCallback function is called if the OFN_ENABLEHOOK flag is included. This function was written to work around a bug in Windows XP and it probably occurs in other OS versions. The bug: The wrong value for the "Open As Read-Only" checkbox is sometimes returned if multiple files are selected. The workaround used by this function to read directly from the "Open As Read-Only" checkbox object at the time the user presses the "Open" or "Save" button.

In your example you use the HideReadOnly option which will hide the "Open As Read-Only" checkbox. So yes, in this example you can comment out the code that adds the OFN_ENABLEHOOK flag because there is no "Open As Read-Only" check box to worry about. And no, I haven't tested it. If you always plan to use the HideReadOnly option then we're done. However, if you don't use the HideReadOnly option in the future for any reason, then we're back to why the OFN_ENABLEHOOK flag was added in the first place.

I hope this helps.
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: [Library] Dlg2 v0.3 - Common Dialogs

04 May 2020, 13:26

Yes, it helps. By reading the code, I was able to figure out myself that you read the «read-only» checkbox using the hook, but of course ... I was not aware why you did it this way. Your explanations cleared it. And yes, I will always use HIDEREADONLY flag.

Thank you . Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
User avatar
jballi
Posts: 724
Joined: 29 Sep 2013, 17:34

Re: [Library] Dlg2 v1.0 - Common Dialogs

12 Nov 2023, 16:22

v1.0
Although this release comes with a major release number, i.e. v1.0, and there are hundreds of changes, this is a minor release. Most of the changes are to improve usability. See the Release Notes section of the first post for the details.

This version of the project only runs on a recent version of AutoHotkey v1.1+. AutoHotkey v2.0+ is not supported. With the exception of bug fixes, this will be the last release that uses AutoHotkey v1.1+. Future versions of this project (if any) will require AutoHotkey v2.0+.

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: Epoch and 59 guests