QB64.org Forum

QB64 Team Software => InForm-based programs => Topic started by: FellippeHeitor on February 26, 2018, 10:34:19 am

Title: [InForm] Windows 7's run dialog clone
Post by: FellippeHeitor on February 26, 2018, 10:34:19 am
Of course there's no purpose recreating a system dialog other than it being a proof of concept. In this case I recreate Windows's "Run" dialog, with limited function (the Browse... button is disabled).


Unpack all files and compile Executar.bas

This was created using InForm beta 6. The hotsite for the project (http://www.qb64.org/inform) is still offering beta 5, but you can get the development preview from GitHub: https://github.com/FellippeHeitor/InForm/archive/development.zip

Notice that the InForm folder in the zip attached doesn't contain the full project (which includes the visual editor). These are the only files you need to include when you distribute a project created using InForm.

PS: "Run" in Portuguese is "Executar".
Title: Re: [InForm] Windows 7's run dialog clone
Post by: phred on February 26, 2018, 11:10:44 am
I'm going to try this in Windows 10 since Microsoft thoughtfully removed the "Run" dialog.
Title: Re: [InForm] Windows 7's run dialog clone
Post by: FellippeHeitor on February 26, 2018, 11:18:08 am
Let me know how that goes!
Title: Re: [InForm] Windows 7's run dialog clone
Post by: bplus on February 26, 2018, 12:15:15 pm
Hi Fellippe,

I bet it is possible to put Files / Folders tree in a list box and just click the desired File or Folder.

You guys with all your typing, sheez! ;D
Title: Re: [InForm] Windows 7's run dialog clone
Post by: FellippeHeitor on February 26, 2018, 12:20:47 pm
A call to the default browse dialog should be easy enough to add, I just haven't: http://www.qb64.org/wiki/Windows_Libraries#File_Open_and_Save_Dialog
Title: Re: [InForm] Windows 7's run dialog clone
Post by: phred on February 26, 2018, 02:09:59 pm
Can't get it to compile under Windows 10, I keep getting  Library not found in line 15 of ***\inform.ui included on current line, although in the file manager I can see that it's there where it claims it can't find it.  If I open the inform.ui file it says it can't find Library "falcon. "  Does this by chance require the latest version of QB64, I'm still using 1.1 because I'm lazy.
Title: Re: [InForm] Windows 7's run dialog clone
Post by: FellippeHeitor on February 26, 2018, 02:17:18 pm
Stupid me, forgot to add falcon.h to the zip. Here it is, place it in QB64's folder. Zip updated too.
Title: Re: [InForm] Windows 7's run dialog clone
Post by: phred on February 26, 2018, 03:39:50 pm
That did the trick, works like a champ now!
Title: Re: [InForm] Windows 7's run dialog clone
Post by: FellippeHeitor on February 26, 2018, 03:42:25 pm
Great to hear!
Title: Re: [InForm] Windows 7's run dialog clone
Post by: FellippeHeitor on February 27, 2018, 11:11:02 am
I have added the Browse... functionality by calling the default system Open dialog, using the code provided in the wiki by Jobert14 (http://qb64.org/wiki/Windows_Libraries#File_Open_and_Save_Dialog).

I updated the zip in the first post and you can see a screenshot attached below.
Title: Re: [InForm] Windows 7's run dialog clone
Post by: bplus on February 27, 2018, 01:05:30 pm
Hi Fellippe,

Now we're talking! (if that is what I think it is) Great idea! 

*<|:-)  I'm taking you off my naughty list.



Title: Re: [InForm] Windows 7's run dialog clone
Post by: Pete on February 27, 2018, 03:32:36 pm
Is the run dialog screenshot something you created in QB64 graphics, or is it a call to an existing box, through a Windows API call?

Also, what is the purpose?

Pete :)
Title: Re: [InForm] Windows 7's run dialog clone
Post by: FellippeHeitor on February 27, 2018, 03:38:35 pm
The Run dialog has been recreated using InForm, that's all QB64. The Open dialog in the second screenshot is Windows native, via API call.

The purpose, as stated in the first post, is a proof of concept. Look how cool my form looks using InForm. That's the only goal with this.

But as soon as the dialog with the original goal was posted, I found out via phred that Windows 10 has extinguished the Run dialog, so my faux dialog was repurposed. Now you can have a basic OS functionality back with a program created using BASIC.
Title: Re: [InForm] Windows 7's run dialog clone
Post by: bplus on February 27, 2018, 03:59:25 pm
Yes Fellippe after this idiot figured out where to put Falcon.h the code Ran.
(I know, all I had to do was read the instruction to put it in the QB64 folder, yikes read!)

Guess who I ran into testing this dialog out?

Seriously, this is really nice demo with a use! a keeper!
Title: Re: [InForm] Windows 7's run dialog clone
Post by: bplus on March 02, 2018, 10:52:10 pm
I just tested the Browse part of the Run Dialog and YES you can do all kinds of File and Folder management while in the Browse screen.

I wish this feature were in the QB64  IDE Editor with Open, Save and Save as dialogs.
Title: Re: [InForm] Windows 7's run dialog clone
Post by: Ashish on March 03, 2018, 08:46:01 am
This is very impressive work! :D
Title: Re: [InForm] Windows 7's run dialog clone
Post by: FellippeHeitor on September 16, 2018, 08:35:37 am
That'll require a merge of TextBox controls and DropdownLists, but once the new type of control exists, it should be easy enough to add. Thanks for trying it!
Title: Re: [InForm] Windows 7's run dialog clone
Post by: Pete on September 16, 2018, 02:14:52 pm
You're filling up Fell with a lot of work, but strangely enough, it's probably less work than convincing those idiots at Microsoft that Win7 is a far better system then 10, although arguably not as tough as 10. Well, Maybe that's not a fair comparison. My 7 just has to put up with keyboard tapping while my 10 spends it day adding up frequent flyer miles and bouncing off walls.

Pete
Title: Re: [InForm] Windows 7's run dialog clone
Post by: cr0sh on September 16, 2018, 07:48:35 pm
Whatever happens in regards to Inform - my plea would be to remember to not exclude the other two major operating systems; it seems that so often, a project will start out as being "cross-platform", garnering a lot of support, only later to find itself shutting out everything except Windows (as an original kickstarter supporter for Oculus, their dropping support for Linux really ticked me off, as it was one of the main things that caused me to invest).

Now - I know this dialog is just a clone, and is likely (?) cross compatible and isn't specific to Windows - I'm just putting out a plea and reminder, that there are others out there who use other operating systems besides Windows (and QB64 always being cross-platform in this regard has been a breath of fresh air for so long).
Title: Re: [InForm] Windows 7's run dialog clone
Post by: bplus on March 11, 2020, 03:39:23 pm
Hi Fellippe,

Does the browse button still work for you with this?

I've tried with 3 versions of QB64 and nothing happens when I click browse. I am wondering if a Windows update changed something.
Title: Re: [InForm] Windows 7's run dialog clone
Post by: FellippeHeitor on March 11, 2020, 04:25:47 pm
I haven’t checked in a while. I’ll let you know. Are you on Windows 10?

Update: I wrote this sample in a 32bit version of QB64, and it calls a 32bit library, which I assume won't work when we compile with QB64 64bit:

Code: QB64: [Select]
  1. DECLARE DYNAMIC LIBRARY "comdlg32" ' Library declarations using _OFFSET types
  2.     FUNCTION GetOpenFileNameA& (DIALOGPARAMS AS FILEDIALOGTYPE) ' The Open file dialog
  3.     FUNCTION GetSaveFileNameA& (DIALOGPARAMS AS FILEDIALOGTYPE) ' The Save file dialog
Title: Re: [InForm] Windows 7's run dialog clone
Post by: bplus on March 11, 2020, 07:19:26 pm
I haven’t checked in a while. I’ll let you know. Are you on Windows 10?

Update: I wrote this sample in a 32bit version of QB64, and it calls a 32bit library, which I assume won't work when we compile with QB64 64bit:

Code: QB64: [Select]
  1. DECLARE DYNAMIC LIBRARY "comdlg32" ' Library declarations using _OFFSET types
  2.     FUNCTION GetOpenFileNameA& (DIALOGPARAMS AS FILEDIALOGTYPE) ' The Open file dialog
  3.     FUNCTION GetSaveFileNameA& (DIALOGPARAMS AS FILEDIALOGTYPE) ' The Save file dialog

OK that was in there already. Oh this is Windows only, dang, what a great Browse it was.
Title: Re: [InForm] Windows 7's run dialog clone
Post by: bplus on March 13, 2020, 01:31:19 pm
@FellippeHeitor So is the Browse button still working for you?
Title: Re: [InForm] Windows 7's run dialog clone
Post by: FellippeHeitor on March 13, 2020, 02:03:29 pm
I don't have QB64 32bit on this machine and download has been forbidden (corporate network), I'll try it at home tonight and let you know.
Title: Re: [InForm] Windows 7's run dialog clone
Post by: bplus on March 13, 2020, 03:27:53 pm
Oh! If this requires 32 bit version never mind, but would be interested in this for v1.4, if possible.
Title: Re: [InForm] Windows 7's run dialog clone
Post by: FellippeHeitor on March 13, 2020, 05:56:34 pm
Does anyone know about comdlg for 64bit systems?
Title: Re: [InForm] Windows 7's run dialog clone
Post by: visionmercer on March 13, 2020, 07:05:20 pm
I have a program that stays 32 bit because of this problem.I have seen how to do it with VBA here: https://social.msdn.microsoft.com/Forums/en-US/1db77ef4-f363-4e60-b680-6cf1c44e22bd/office-32bit-vs-64bit-comdlg32dll?forum=accessdev (https://social.msdn.microsoft.com/Forums/en-US/1db77ef4-f363-4e60-b680-6cf1c44e22bd/office-32bit-vs-64bit-comdlg32dll?forum=accessdev)
But how to Declare PtrSafe Function in qb64 I do not know.