winapiexec icon indicating copy to clipboard operation
winapiexec copied to clipboard

[❔] Is it possible to use winapiexec to open a specific property sheet of a file ?

Open claudio-salvio opened this issue 1 year ago • 3 comments

Hello @m417z

Is it possible to use winapiexec to open a specific property sheet of a file?

There is a utility called GDProp GeekDrop-Props at GitHub that opens the standard "Properties Sheet" window for a given file.

GDProp opens the window always positioning on the property sheet General.

Property sheet General

I would like to do something similar but opening an specific property sheet, for example Security.

🙏Thanks for sharing winapiexec and its code with the community.

Best regards, Claudio Salvio

claudio-salvio avatar Oct 13 '23 20:10 claudio-salvio

Hi Claudio,

Here's a simple example:

winapiexec64.exe shell32.dll@SHObjectProperties 0 2 C:\Windows Sharing , u@MessageBoxW 0 "Showing properties..." $$:0 0

This example opens the properties of C:\Windows with the Sharing tab. Not that the message box is necessary to keep the process running. There might be better solutions, but it requires some extra thought.

Edit: Here's the proper way to do it, and it makes more sense to create a small command line tool for the task: https://devblogs.microsoft.com/oldnewthing/20080528-00/?p=22163

m417z avatar Oct 14 '23 15:10 m417z

Hi @m417z

Thank you for your prompt reply. The command line worked correctly for me in cmd.exe. In PowerShell it did not work, although I suppose I could launch from there a cmd.exe and get a similar result as previously mentioned.

Unfortunately the requirement to open an extra window (u@MessageBoxW 0 "Showing properties...") makes the procedure a bit "ugly".

Thanks for the link to the proper way: Reading a contract from the other side: SHSetInstanceExplorer and SHGetInstanceExplorer - The Old New Thing

Unfortunately my current knowledge of C programming does not justify me trying to approach the task from that side.

I put a feature request on the GDProp GitHub Repo GeekDrop-Props at GitHub to add a parameter to indicate the tab: [FR] Add support for additional parameter with the name of the property sheet to display - Issue #4.

At this point, it would seem that that is the most reasonable way to get this functionality, at least for me.

🙏 Thanks for all the helpful programs you share with the community.

Regards, Claudio Salvio

I 💙 Textify Textify at GitHub I 💙 7+ Taskbar Numberer 7+ Taskbar Numberer at GitHub

claudio-salvio avatar Oct 14 '23 23:10 claudio-salvio

There's a "show-properties.exe <path to file or directory>" here using the proper way:

https://github.com/JosephusPaye/show-properties/blob/master/src/show-properties.cpp

XP1 avatar Nov 17 '23 18:11 XP1