list Recent Items (My Recent Documents) (Start Menu)

Post your working scripts, libraries and tools
User avatar
jeeswg
Posts: 4991
Joined: 19 Dec 2016, 01:58
Location: UK

list Recent Items (My Recent Documents) (Start Menu)

04 May 2017, 03:56

List recent files from the Start Menu, tested on Windows 7.
Recent Items (Windows 7).
My Recent Documents (Windows XP).

Do notify of any issues.

[EDIT:] I fixed the VarSetCapacity issue, improved the script slightly, and made the script into a function.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Last edited by jeeswg on 04 May 2017, 22:11, edited 4 times in total.
sGuest

Re: list Recent Items (My Recent Documents) (Start Menu)

04 May 2017, 13:25

Hi Jeeswg,

Here's an issue on first hotkey press after which script closes because of instability:

:terms: Error: This DllCall requires a prior VarSetCapacity.
@W7 x64 - AHK 1.1.25.01

Cheers, and thanks for sharing again.
User avatar
TheDewd
Posts: 1035
Joined: 19 Dec 2013, 11:16
Location: USA

Re: list Recent Items (My Recent Documents) (Start Menu)

04 May 2017, 13:56

Code: [Select all] [Download] (Untitled.txt)GeSHi © Codebox Plus

An internal error has occurred in the debugger engine. Continue running the script without the debugger?
Yes/No
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.
User avatar
jeeswg
Posts: 4991
Joined: 19 Dec 2016, 01:58
Location: UK

Re: list Recent Items (My Recent Documents) (Start Menu)

04 May 2017, 19:11

OK, I added in one line, VarSetCapacity(vDirRecent, 260*2, 0), it should work now.

Apologies for that, I've asked a question about it here:

basic DllCall + VarSetCapacity question - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=31419
AHKStudent
Posts: 303
Joined: 05 May 2018, 12:23

Re: list Recent Items (My Recent Documents) (Start Menu)

06 Aug 2018, 05:59

works on windows 10 as well

Is there a way to sort it by date / most recent?

In windows 10 there is a recent folder, access it quick via run > shell:Recent

Is there a negative to getting recent files from there other than it probably taking longer than your method and it not working on windows 7 possibly?
User avatar
jeeswg
Posts: 4991
Joined: 19 Dec 2016, 01:58
Location: UK

Re: list Recent Items (My Recent Documents) (Start Menu)

06 Aug 2018, 15:50

- Here are 2 different ways to get the files in recent order. One via the registry, one via a file loop. (Tested on Windows 7.)
- The one disadvantage of the file loop is that sometimes some random old links persist in the folder.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


- Re. speed, here are the results of some benchmark tests. So, effectively speed is the same, the registry approach fractionally faster.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

User avatar
jeeswg
Posts: 4991
Joined: 19 Dec 2016, 01:58
Location: UK

Re: list Recent Items (My Recent Documents) (Start Menu)

30 Aug 2018, 13:50

This is the latest version of the script I'm using:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Return to “Scripts and Functions”

Who is online

Users browsing this forum: emmanuel d and 23 guests