Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
claudio-salvio opened this issue Oct 13, 2023 · 3 comments

Comments

@claudio-salvio
Copy link

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

@m417z
Copy link
Owner

m417z commented Oct 14, 2023

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

@claudio-salvio
Copy link
Author

claudio-salvio commented Oct 14, 2023

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

@XP1
Copy link

XP1 commented Nov 17, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants