Control_RunDLL - Open sequential window? - windows

I don't know if this is even possible, but I thought I'd ask anyway.
I know that you can append ,,tabnumber to the end of a
rundll32.exe shell32.dll,Control_RunDLL
command to open a window on a specified tab, but is there a way to open a further window by programmatically selecting a button on that tab?
For example, I'm using
rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl,,4
to open Windows' Internet Properties window, but is there a way to programmatically to open the LAN Settings window from there, as LAN Settings doesn't seem to have its own process I can call directly.
(I plan to use this with things other than LAN Settings, if there is a solution, such as "Copy settings..." within the "Administrative" tab on the Region and Language window)

There is no general mechanism for this. You are better off doing whatever you need programmatically instead of trying to drive the UI (which changes from version to version). – Raymond Chen

Related

How to make my browser (such as Firefox) open a custom File Manager?

My system is Windows 11 build 22621. Now I use Tablacus Explorer to manage my files instead of Explorer.exe, however, many apps (such as Firefox or Control Panel) will still use Explorer.exe when I try to open directory or other something in those apps,even though I used some Tablacus's plugins such as Shell Execute Hook.
Are there better methods to let other apps to auto open Tablacus as more as possible?
Add "Open Instead" and "System Tray" plugin to solve the problem.

programmatically open 'system properties'

How can I open the various windows in system properties from command line or using VBS or JS?
By this I mean windows such as User Profiles, environment variables, performance options, DEP, hardware profiles, windows update settings, remote desktop settings, etc I am using windows XP but it wont let me create a shortcut to these dialogs. Sysdm.cpl cant do it either it seems.
System properties is the window that opnes when you right click my computer and hit properties.
One way to open the edit environment variables of the windows through the command line would be to call the run.exe:
"C:\Windows\system32\rundll32.exe" sysdm.cpl,EditEnvironmentVariables
So there must be something similar for other windows.
You can also open a specific tab of the system properties window by using the control command and the tab number:
control sysdm.cpl,,3

Windows 7 taskbar stacking in multiple places

I pinned Notepad2-mod to the taskbar. When I click the pinned shortcut, it opens a new instance but doesn't stack in place. It begins a new stack. Additional clicks will utilize the second stack. This can probably best be explained via screenshot:
The oddest part is it used to stack on the taskbar shortcut if I started it by clicking on it or using WIN+num, but if I started Notepad2-mod by right-clicking on a file and using "open with notepad2-mod" it would stack in a new stack. Now, they all stack in a new stack (not on the taskbar-pinned shortcut).
Both the "open with notepad2-mod" registry shortcut and the taskbar-pinned shortcut run the same executable.
Ultimately, I'd like them all to stack in the same place, on top of the taskbar-pinned icon.
1) What did I do to persuade it to behave like this?
2) How can I convince it to all stack on the pinned icon?
Edit:
I just noticed in the Task Manager that when I double click a .txt file I'm running a version of this binary named Notepad2.exe and when I click on the icon on the Taskbar I'm running a copy of this same binary named notepad.exe. I must have done that to fool Windows 7 into thinking it was using vanilla Notepad. I thought changing this might fix it, but it did not. They still stack on a different portion of the Taskbar. They even respond to keyboard shortcuts like Start Button+Number for the slot where they do actually stack.
Thanks to the this link, this issue is fixed. Go read his site for a better answer than mine, but, in case his site ever goes away, here are the relevant snippets:
Notepad2 windows are now assigned to a custom AppUserModelID, that's why multiple icons may appear if Notepad2.exe is directly pinned to the taskbar. To fix this, open a Notepad2 window first, and then pin it to the taskbar from the Notepad2 taskbar button context menu.
Note that if you have followed the rest of his instructions on the page and set it up to redirect notepad.exe to notepad2.exe, you actually have to start up Notepad2.exe directly, then right click on the taskbar instance and click "Pin to Taskbar".
Now that I did that, all my Notepad2 instances stack in the same place on the taskbar!
Note that the author of Notepad2 says that you have to add code in your application to handle this.
Some reference documentation.
Assuming that your OS is Windows 7
1. Check the settings of your task bar IE. right click the task bar and click properties # the properties menu there is a drop down list it should say "Stack & hide-labels" if not set it to that setting.
If that does not work then you can try dragging the file that will not stack to the regular notepad and pin-it to the list in the stack-able tab.
aside from all of that, when you pin a application to the task bar even if it was edited and saved before it was pinned, it will always open a new instance of the application.
also you can make a simple batch file to start the application
#echo off
rem you will want to set the directory using the DIR command
start "your program's name here"
rem you can use the pause>nul command to check if it worked.
Hope this helps.
I had this problem with Internet Explorer because I had created a short cut and pinned that to the Task Bar. Then all new instances would stack on a separate icon. I unpinned the shortcut, then navigated to the IE executable, right clicked and selected "Pin to Task Bar". After I did that, all new instances stacked on top of the original pinned IE icon.

"Open folder in Terminal" for Spotlight or Alfred

Is there any way in Spotlight to have a folder open in a Terminal window, either by providing an "Open in Terminal" option in search results, or (ideally) by holding down a key when selecting a result? Basically the same way holding down command will "Open containing folder" maybe make it so holding option (or whatever key) could "Open in Terminal".
Alternately, is there a way to setup the Alfred app so that it will always open folder search results in the Terminal? that might be even better, then I could use ctrl-space exclusively for opening folders in the Terminal and command-space (Spotlight) for everything else.
The closest thing I can find to anything like these is the "cdto" application, which adds an "Open in Terminal" button to the Finder. This is nice, but being able to do this directly from Spotlight or with a keypress would be much more convenient.
This question is old and you undoubtedly found the answer by now; for the sake of completeness: the latest version of Alfred allows one to search/navigate the filesystem from within Alfred, and take action on the folder or file found. One folder action is "Open Terminal Here", which seems to be what you are asking for.
I've found this to be the fastest method without any external tinkering.
Requirement: need to have iTerm or Terminal in the Dock:
Type the folder name into Alfred / Spotlight
Click and drag the folder that was found into the iTerm / Terminal icon in the Dock
Try this tool:
https://github.com/nmadhok/OpenInTerminal
This is a really handy tool for programmers on Mac as it lets you open the folder directly in Terminal. You can select multiple folders to open them in multiple terminal windows. You can also select files to open the parent directory in Terminal. This application works with Finder as well as without Finder which is a plus!
use this Alfred extension
https://github.com/LeEnno/alfred-terminalfinder
then just lob off the input and set it to a hotkey.. I have one to open the current finder in terminal and vice-versa
#Verboze - I'm still looking for an answer :)
Perhaps it should be migrated to stack exchange or the other one used non-programming topics, such as system administrivia. Though a case could be made that the command line is essential to programming.....
Windows has "Command Prompt Here". Linux has Nautilus' "Open In Terminal". The world's most advanced operating system has nothing (the best I can tell).
For completeness, I did look at the customizable toolbar ('drag your favorites here'; but my favorite is missing). I also found an old Action Script or Automator Script that did not work (the article was old, and it could not be followed).
I did find a program called "CD To...", but its broken. Upon opening the first terminal, the program opens two terminals. I'm not sure what other programming mistakes were made by the developer, and I really don't want to experiment.
Check this: https://github.com/miromannino/alfred-new-terminal-window
It opens a new Terminal/iTerm window in the current space.
Holding the alt key, the new window is also opened opened in the current frontmost Finder folder.
For me that is almost sufficient for my daily work!
Hope it helps!

Is it possible to replace the system open file dialog?

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.

Resources