Jump to content

Getting the last folder Paint.NET has used.


Curtis

Recommended Posts

OK, So I was just wondering, and haven't found anything through searching, where can I get the path of the last folder that Paint.NET has used. The one that Paint.NET uses when it launches a new open file dialog. Thats if plugins are allowed to use it of course.

Link to comment
Share on other sites

So that, in the plugin I'm making, when I launch an open file dialog, the user won't have to navigate all the way back to the last directory they were in to open files, the same way you don't have to navigate around when you open two consecutive files in Paint.NET.

Link to comment
Share on other sites

Thats what I am after, I just thought Rick might have made a wrapper method for getting that whenever he needs it, But I guess I could use that if I have to.

Link to comment
Share on other sites

OK, so I got it working using the registry key, I would prefer to just use a method already provided by Paint.NET, but I suppose this will work for the time being.

What would really be good is if Paint.NET had code for quickly making an open file dialog with all the file type filters and everything pre-set, by working out what file type plugins it has available.

Link to comment
Share on other sites

Well, after digging through the source code I found what I was after, but parts of it are marked internal or something so I don't think Rick wants us using them. Doesn't matter though I got it working a different way.

Link to comment
Share on other sites

I got it working a different way.

Please don't tell me your plugin looks directly through the computer's ram and gets the path from there?

KaHuc.png
Link to comment
Share on other sites

Please don't tell me your plugin looks directly through the computer's ram and gets the path from there?

How is that even feasible, much less practical?

By the way, Curtis, you can use PaintDotNet.SystemLayer.Settings.CurrentUser.GetString("LastFileDialogDirectory");

I'm not sure if that's legal, though.

Of course, there's nothing wrong with getting it straight from the registry, either.

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

SystemLayer.Settings won't be available in v4.0. It is for Paint.NET internal use only.

Thats what I thought, so I just left that alone. Anyway, new plugin coming soon.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...