I'm programming on Excel-Visual Basic with a Mac, I need to charge a dll but I don't know how to specify the total path of the file, and I don't know how to find it.
For example: on Windows it works by using "C:/ ..." and separating the following documents by /.
Right click on the file in Finder
If you then hold the option button on your keyboard the Copy {filename} option in the context menu turns into Copy {filename} as Pathname
Click on that while still holding the option key and the path of the file is in your clipboard
Related
I am used on OSX to use CMD-Shift-g to open a Go to Folder window. What fundamentally does, is to open a file in a location without me using the mouse to navigate to a different directory. I paste the path of a file, like if I am loading a PSD in Photoshop, and I can load the file, independently from where my current directory is pointing at.
Is there an equivalent to this in Windows? Like if I have a file open prompt in Photoshop (or any other windows app, for what matters), that is pointing at my desktop, while my file is in some other location, and I can pass the full path of the file, like I do on OSX with the go to folder window?
I found a "workaround". Windows fundamentally accept in the file name textfield, the full path too; so if you are on desktop for example, and in the file name field you type the full path of the file, it will in fact change the current directory to the full path you pass.
Works in a similar way but without the need to call a window to just change the path.
Long story short - I bought a new computer and decided not to do a migration from my old Mac to the new one. Still - there are some things I would like to keep and the icon I found years ago to replace the "Macintosh HD" icon is something I very much would like to find.
So my question is - where are these icons actually stored? I've searched "everywhere". It's not in /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources where the system icons is stored.
Anyone out there with the same level of OCD as me who can help me out?
I'm running Catalina 10.15.1 if relevant.
First of all:
Custom icons that you use to override System default ones will never be stored inside /System/Library/.. as this is a System reserved folder.
On macOS when you paste a custom icon to a folder or file using the Finder Info panel these are stored in the resource fork of the extended attributes of a file/folder.
Now regarding your use case:
In order to see these you need to show the hidden files and you will see
.VolumeIcon.icns on your / local drive (Macintosh HD):
As this is a write protected path (SIP) you cannot store custom data there and instead this .VolumeIcon.icns alias is there and will point to the actual icon file.
If you are still not able to locate the icon file you can always use this next trick. Open the Finder "Info Panel" for your MacintoshHD that has the custom icon and click on the icon representation and copy it to the clipboard (cmd + C) and then open Preview and select "File > New from Clipboard" and then save the icon as icns. Done!
What I want
I want to add a custom entry to the menu that appears when right-clicking a .jpg/.jpeg for my program (editing images).
What I tried
I added to HKEY_CLASSES_ROOT\jpegfile\shell a key test, in there a second key command and set the (default) value of that to notepad.exe (just for testing). Because no test entry appeared in the menu, I did the same just unter HKEY_CLASSES_ROOT\Directory where it worked!
The file I click is an JPEG and the default value of HKEY_CLASSES_ROOT.jpg is jpegfile.
(Also tested with txtfile but with no success.)
What did I do wrong to add a custom command to specific filetypes only?
What you did was correct. Possible reasons why it didn't work include:
Windows Update has an annoying tendency in Windows 10 to reset file associations to Windows defaults all the time.
You added this facility to the jpegfile key, but the type .jpg may be associated with a different file-type key.
Go to HKEY_CLASSES_ROOT.jpg and see what the association is (alternatively, type ASSOC .jpg in Command Prompt). If it isn't jpegfile, check what it is, in case you actually want to keep that association.
To give you an example, I have a working right-click menu entry for .png files, which runs the pngout utility on them. I did that by editing the Registry. My current association for .png files is FastStone Image Viewer:
So I changed the shell menu for FastStone's file type key:
And now my right-click menu entry works.
I am creating a directory synch application in java programming application. Now i want to add share option when user right click with in a specific directory, and want to open an dynamic url on clicking that new option. Can anyone help me to find any good solution. Can anyone provide me Registry Script For this task.
An msdn resource on Extending Shortcut Menus will be good for you.
Anyway, I'd like to introduce my own "minimal" example. This opens a gnuplot's wgnuplot terminal at the right-clicked directory after choosing "Open gnuplot here" shortcut.
You can add keys into HKEY_CLASSES_ROOT\Directory\shell. I added HKEY_CLASSES_ROOT\Directory\shell\gnuplot with string (name: (Default)) Open gnuplot here, provided an icon string with the program's icon path, a LegacyEnable empty string and a command key that windows have to execute when clicking. You can reach the right clicked directory name with %V (You can find out more special variables on this Q&A thread at SU). Here's the code that creates the structure:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\gnuplot]
#="Open gnuplot here"
"Icon"="\"C:\\Windows\\icons\\wgnuplot.ico\""
"LegacyEnable"=""
[HKEY_CLASSES_ROOT\Directory\shell\gnuplot\command]
#="\"C:\\Users\\Cron\\Documents\\egyetem\\gnuplot\\bin\\pgnuplot.exe\" -e \"cd '%V'\" -persist"
I want to replace the standard system open file dialog with the one I wrote, that means no matter within which programs you are opening a file, my dialog will be shown instead of the standard one, is this possible?
It seems that that there is no such API provided to accomplish this, is it possible to use some hooking technique, but this has to be reliable and not to be treated as spyware by anti-virus tools?
any other options?
If this is not possible, is it possible to add to the spacebar or toolbar in the standard open file dialog a button which invokes my dialog, which allow users select a file and in turn returns the path of the selected file to the "File name" input box of the standard dialog?
Any hits, links and code examples will be appreciated.
Starting in Vista, the FileOpen/FileSave dialogs are now "Common Item Dialogs" of which IFileOpenDialog & IFileSaveDialog are the two published implementations.
Since they're just COM objects with known CLSIDs you might get away with just replacing them by re-registering using their CLSIDs. Never tried something like that, might trip all sorts of alarm bells.
Pre-Vista file dialogs can be hooked in process, but I've never come across anything about global hooks or equivalent.
If you copy a file/folder to a dialog's filename field it usually pastes the full path anyway.
For example, if you have open both a program calling the standard open/save dialog box and also have a window open at the file or path that you want to work with (open from/save to), you can simply copy the file/folder from the explorer window, and then paste into the filename field of the dialog box, and it will insert the full path of the file/folder. No custom script is required!
Alternatively, for those programs that use custom dialog boxes where this step fails, copy the same file/folder in the window into the address bar of the same window (assuming it is visible). This will paste the full path, which you can copy again, and then paste this full path into the custom dialog box. I often use this when creating Office hyperlinks (Ctrl+K), because the Insert Hyperlink dialog does not work for the first method.
You can also use similar methods but paste into address bar fields and it works.