Author Topic: programmatically choose file details Windows Explorer displays for a given path?  (Read 1272 times)

0 Members and 1 Guest are viewing this topic.

Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
I'm looking for a way to automate selecting which file details (columns) Windows Explorer displays for a given path. (For example Frame Width, Frame Height, Frame Rate, Date Created, etc.)

The manual way to do this in Windows is to right-click the column header row in Explorer and click More, then scroll through the many options and check off each one you want to see, then click OK, and wait while Windows refreshes the Explorer window.

This method is quite unwieldy when working with files across many subdirectories and I'm wondering how this might be automated or scripted to accept a path as input, and the program either opens the path in an Explorer window showing the desired columns, or updates the system default for that path (in the registry or wherever it is that would need to be updated) so that when you do open it in Explorer, the desired columns are visible. (Bonus points for also programatically setting the column order!)

Any ideas on accomplishing this in QB64?
« Last Edit: March 29, 2022, 11:29:48 am by madscijr »

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
I haven't seen command switches capable of doing what you are asking. Switches like /select can be used in a SHELL statement to make Explorer highlight a file, for example. I suppose if those right-click to change also had a short-cut key, you could use QB64 _SENDKEY statements, with delays, to automate the process. My last resort would be to use _SCREENCLICK, because it would require the pane always open in the same desktop position and same size, so the mapping you made would always click on the appropriate pane header.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
I haven't seen command switches capable of doing what you are asking. Switches like /select can be used in a SHELL statement to make Explorer highlight a file, for example. I suppose if those right-click to change also had a short-cut key, you could use QB64 _SENDKEY statements, with delays, to automate the process. My last resort would be to use _SCREENCLICK, because it would require the pane always open in the same desktop position and same size, so the mapping you made would always click on the appropriate pane header.

Thanks for your reply. I think I'm looking more for a way to directly manipulate Windows registry values - however / wherever those are that control this sort of thing. Simulating screen clicks and using sendkey would be kludgey.

I did find out that in Explorer, after selecting the columns, you can go to the [View] ribbon group & click [Options] > [Change folder and search options], then click the [View] tab, and click [Apply to Folders], and the columns should show up by default for all folders containing files of the related type (what they mean by "type" is a little fuzzy - does that mean the same file extension? Or does it refer to some broader Windows category such as text, video, pictures, music, etc.? No idea.)

Anyway, I don't know where Windows stores such settings, but was looking for a programmatic way to control some of that...

Thanks again
« Last Edit: March 29, 2022, 01:26:34 pm by madscijr »

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
As another alternative, this might be achievable with a Windows API approach. Has @SpriggsySpriggs been around as of late?

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
As another alternative, this might be achievable with a Windows API approach. Has @SpriggsySpriggs been around as of late?

That sounds more like what I was thinking... I haven't seen @SpriggsySpriggs but then again I myself have been a little busy. I would agree Spriggs is a SME who might have some interesting suggestions.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • GitHub
Chances are, this would take a registry approach. I have a library for interfacing with the registry. I just wouldn't know which keys to mess with.
Shuwatch!

Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
Chances are, this would take a registry approach. I have a library for interfacing with the registry.

Thanks, that's what I expect.

I just wouldn't know which keys to mess with.

Yep, there's the rub! I can keep looking on Windows admin type sites.

Thanks for your reply!