DonationCoder.com Forum

DonationCoder.com Software => Older DC Contests and Challenges => N.A.N.Y. 2019 => Topic started by: c.gingerich on November 30, 2018, 08:56 AM

Title: NANY 2019 - DblEscClose
Post by: c.gingerich on November 30, 2018, 08:56 AM
Application NameDblEscClose
Version1.11.30.2018
Short Description Press the Escape Key 2x to close current window or tab.
Supported OSes   Windows (XP/Vista/7,8,10,server 2008, server 2012, etc)
Download   https://filedn.com/lx9UK6VkCuXBk4O2YliWIkY/DblEscClose.zip
Author   Chris Gingerich

Description
Closes the current window or tab by pressing the Escape key on your keyboard 2x.

-= History =-
3.12.4.2018 - Added option to run at windows startup. Better message handling. Changed to show window title in message.
3.12.3.2018 - Fixed bug where action would not save
2.12.3.2018 - Made adjustment to hotkey code, updated Action icon on tray menu
2.12.1.2018 - Added action selection, exclusion list, updated tab list
2.11.30.2018 - Fixed error Run time error 14 at line  52. Decimal sep issue
1.11.30.2018 - Initial release
Title: Re: NANY 2019 - DblEscClose
Post by: highend01 on November 30, 2018, 10:31 AM
Windows Server 2012 R2 U3 x64

After starting it, on the first press of {ESC} the application fails (and exits) with:
---------------------------
DblEscClose
---------------------------
Run time error  14
at line  52
---------------------------
OK   
---------------------------

Title: Re: NANY 2019 - DblEscClose
Post by: KodeZwerg on November 30, 2018, 10:35 AM
Windows Server 2012 R2 U3 x64

After starting it, on the first press of {ESC} the application fails (and exits) with:
---------------------------
DblEscClose
---------------------------
Run time error  14
at line  52
---------------------------
OK   
---------------------------

Same for Windows 10 x64 latest build.
Title: Re: NANY 2019 - DblEscClose
Post by: c.gingerich on November 30, 2018, 10:59 AM
Sorry about that. Updated, please download and try again.
Title: Re: NANY 2019 - DblEscClose
Post by: KodeZwerg on November 30, 2018, 11:10 AM
Windows 10 x64 latest build = now it works.

If interested to develop, I would have a small idea to your utility.
Add possibility to minimize and a proper quick switch option for that inside icon menu.
Title: Re: NANY 2019 - DblEscClose
Post by: anandcoral on November 30, 2018, 11:53 AM
Good to see another app similar to https://www.donationcoder.com/forum/index.php?topic=36643.msg343045#msg343045
As I am not getting enough time to update it.

Regards,

Anand
Title: Re: NANY 2019 - DblEscClose
Post by: c.gingerich on November 30, 2018, 12:00 PM
@Anand - I guess I didn't search very well. I made mine because I couldn't fine something like it.

@KodeZwerg - I can add minimize to it easily. Not sure I understand what you mean by quick switch. Do you mean like Alt+Tab?
Title: Re: NANY 2019 - DblEscClose
Post by: KynloStephen66515 on November 30, 2018, 12:12 PM
Can you stop it from registering the "quit" on certain software?  I'd rather not have this open then kill game engines when swapping from one mode to another (which sometimes requires hitting ESC more than once in quick succession) or quitting Chrome cause I hit ESC twice trying to stop it loading a page.  Same for Discord (which you can hit ESC to jump to the latest messages if you were scrolled up, but it sometimes ignores you so you hit it twice, quickly).
Title: Re: NANY 2019 - DblEscClose
Post by: c.gingerich on November 30, 2018, 12:15 PM
@Stephen66515 - sure. I'll add an exclusion option
Title: Re: NANY 2019 - DblEscClose
Post by: KodeZwerg on November 30, 2018, 12:17 PM
@KodeZwerg - I can add minimize to it easily. Not sure I understand what you mean by quick switch. Do you mean like Alt+Tab?
I mean, if press right mouse on icon, inside that menu two options to quick select between terminate/minimize.
I show you what i mean by this screenshot:
[ You are not allowed to view attachments ]
Whatever mode is active get bold font and radiobutton visible.
That i mean with quickswitch ability, less clicks to have most important option fast selected. Or checkbox, or just bold text, however you like.
Title: Re: NANY 2019 - DblEscClose
Post by: c.gingerich on November 30, 2018, 12:20 PM
@KodeZwerg - ah, i see. I should be able to add something like that.
Title: Re: NANY 2019 - DblEscClose
Post by: KynloStephen66515 on November 30, 2018, 12:23 PM
@Stephen66515 - sure. I'll add an exclusion option

Thanks - without it, I can see it becoming extremely annoying to use (especially in stuff like Photoshop/Lumberyard/Unity where they take a fking lifetime to load, and closing them could cause loss of work)....which begs another question...does this force-quit the software or will it still prompt things like Notepad/MSWord/Etc, to store unsaved work before exiting?
Title: Re: NANY 2019 - DblEscClose
Post by: c.gingerich on November 30, 2018, 12:25 PM
@Stephen66515 - It sends the standard window close message allowing for saves, though i can add a force quit option as well, just in case it's needed.
Title: Re: NANY 2019 - DblEscClose
Post by: KynloStephen66515 on November 30, 2018, 12:26 PM
@Stephen66515 - It sends the standard window close message allowing for saves, though i can add a force quit option as well, just in case it's needed.

Force-quit seemed a bit "too much" and I was hoping it would send the standard close message for saving :D
Title: Re: NANY 2019 - DblEscClose
Post by: KodeZwerg on November 30, 2018, 12:36 PM
And I please fullfill others wishes as option to set, not as fixed stuff, i really do like how it is currently doing its job.
Later you might add some processspy ability to get classnames of focused handle, i might could help you if needed.

Ps: How about process exclusion list? That would be great solution for the game thing.
Title: Re: NANY 2019 - DblEscClose
Post by: c.gingerich on November 30, 2018, 12:40 PM
And I please fullfill others wishes as option to set, not as fixed stuff, i really do like how it is currently doing its job.
Later you might add some processspy ability to get classnames of focused handle, i might could help you if needed.


Thanks and the spy is on my list of things to add.  ;)
Title: Re: NANY 2019 - DblEscClose
Post by: c.gingerich on December 01, 2018, 11:40 AM
UPDATE: I have added new features and the update will be released on Monday (12/3).

Here are some screen shots.

[ You are not allowed to view attachments ]
[ You are not allowed to view attachments ]
[ You are not allowed to view attachments ]
Title: Re: NANY 2019 - DblEscClose
Post by: c.gingerich on December 02, 2018, 11:53 AM
2.12.1.2018 - Added action selection, exclusion list, updated tab list

Download updated on first post.
Title: Re: NANY 2019 - DblEscClose
Post by: KodeZwerg on December 02, 2018, 02:24 PM
Hello again, i've downloaded your latest Build and have to say, that what i've asked for - you done brilliant (add minimize option)


I do like this tiny tool, thank you for sharing it!
Title: Re: NANY 2019 - DblEscClose
Post by: c.gingerich on December 03, 2018, 06:40 AM
Thank you  :Thmbsup:
Title: Re: NANY 2019 - DblEscClose
Post by: c.gingerich on December 03, 2018, 07:22 AM
Update: 2.12.3.2018 - Made adjustment to hotkey code, updated Action icon on tray menu
Title: Re: NANY 2019 - DblEscClose
Post by: c.gingerich on December 03, 2018, 08:13 AM
Update: 3.12.3.2018 - Fixed bug where action would not save
Title: Re: NANY 2019 - DblEscClose
Post by: KodeZwerg on December 03, 2018, 08:31 AM
Another idea, add "Auto-Start-At-Boot" option, to have it automatic loaded when windows starts.

Exclusion-List, there i would suggest a major-change what better fit to that function:
instead of classname/window-title, please switch to a process-selector, that would help for games (and others) much more!
(ie: Enter exe-Name and Select Process as option replacement for the [Add] popup-menu.)



Regards,

KodeZwerg.


/edit
and thank you for continue updating/fixing it, i like your way of how-to-get classname.
Title: Re: NANY 2019 - DblEscClose
Post by: c.gingerich on December 03, 2018, 08:57 AM
@KodeZwerg - I can add the auto-start to the next update. Not sure I'll be able to add the add process option (exe) as that is difficult to get the EXE name from the window in the programming language I am using .
Title: Re: NANY 2019 - DblEscClose
Post by: KodeZwerg on December 03, 2018, 12:46 PM
I guess you and me thought in different directions, what I meant is pretty easy to implement (at least in my delphi language, whats yours?), a simple listbox where all current running processes are listed, like TaskMgr.exe does but simplified to .exe name. I hope this was more understandable.
And the current editbox where i can enter "ClassName" would just get a new label like ".exe Name"

There no need to do "where is mouse / under what control / wich handle etc etc etc" action.

I guess we do differ programm such things at all.
My way would be that: (just as a suggestion)
collect all running processes
enumerate all handles and compare them with processes (this way a few hundret handles are sieved and only the good ones remain)
at that point i would have valid handle for mainthread, classname for mainthread and pid collected.
with all three informations together, there is everything possible you need, like window-title, child windows, process-memory and and and =)
with the pid i would realize minimize/send close message command

If you need, I could show you as Delphi code by just using WinApi (what should be valid to all languages)
Since that said, it awoke my interest and i start code a small demo :-)
Code would contain function like "HandleToPID" and "PIDToHandle" stuff, that way all can be easy converted for proper usage like MSDN suggest.

You already done a cool job, I just can repeat myself  :Thmbsup:

And if I sound rough pardon me, take this just as a suggestion not as a "do like i say" :-*
Title: Re: NANY 2019 - DblEscClose
Post by: c.gingerich on December 03, 2018, 02:39 PM
I can get a list of running processes (EXE name and PID) but the issue is when pressing Esc 2x, getting the EXE from the current active window. I can get the class, ID, and name of the window but not what executable owns the current window. I am using Visual Dialogscript, a dead and not widely used programming language.
Title: Re: NANY 2019 - DblEscClose
Post by: KodeZwerg on December 03, 2018, 02:53 PM
We can private talk to avoid code become public else i should need to know how you "minimize/close" a external.
Just the last step where the actual "minimize/close" happen, not all things that you do before/after.
That way i can hopefully reproduce what you do and what info you do use so i could show you how to get proper process.exe name for it.

That i can offer you.
Title: Re: NANY 2019 - DblEscClose
Post by: c.gingerich on December 04, 2018, 12:13 PM
UPDATE 3.12.4.2018 - Added option to run at windows startup. Better message handling. Changed to show window title in message.
Title: Re: NANY 2019 - DblEscClose
Post by: nkormanik on May 14, 2019, 07:10 PM
Chris, message following window close always seems to come up, regardless of settings.

I'd rather message NOT come up, if possible.  Just do it.

Thanks!
Title: Re: NANY 2019 - DblEscClose
Post by: Rockets on January 02, 2021, 11:25 PM
3.12.4.2018 - Added option to run at windows startup. Better message handling. Changed to show window title in message.

is there older version without message upon action? Disable not working in the latest release.
Title: Re: NANY 2019 - DblEscClose
Post by: nkormanik on January 05, 2021, 08:35 AM
Yes, the message -- program exited from, window closed -- has been an annoyance for me as well.  Not sure if Chris has interest to further work on this program, however.

Nevertheless, I use DblEscClose every day.  An easy rapid way to close a window.

Nicholas Kormanik