WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Sending Keystrokes

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Sending Keystrokes to Tabbed Dialogs

Keywords:   tabbed dialogs

Question:

In NT, I would like to pass the selected item name, e.g. a file I've selected in Explorer, to a WBT routine that would:
  1. Access its Properties dialog
  2. Jump to the Security tab
  3. Press the Permissions button
I've tried many variants of SendKeysTo (something like !{ENTER}^{PGDN}^{PGDN}!p), but end up frustrated. What do you suggest?

I want the item to be a variable, inasmuch as I could have either a file or a folder selected and want to quickly view permissions.

I've got a file selected in Explorer. I run a WBT file as follows:

SendKeysTo("Explorer","!{ENTER}")
WinWaitExist("~Properties",5)
SendKeysTo("~Properties","^{PGDN}^{PGDN}!p")
...but the last line does not yield a result! In fact, NT 4.0 does not recognize the ^{PGDN} sequence when run from within a WBT script.

I just *know* your answer is going to be "check out the Control extensions", which I have, but I'm no closer to a solution to this seemingly simple little routine I trying to cobble together. Once I obtain the code number of the Permissions button, I'm apparently not bright enough to understand how to use that code number to gain direct access to the Permissions button. THIS IS WHERE I GET LOST!

Answer:

One kind of problem with tabbed dialogs is that the windows making up the tabbed dialog do not exist until the tab is selected. This introduces a delay which much be accounted for.

Maybe try (for debugging) and see where it goes wrong...

SendKeysTo("Explorer","!{ENTER}")
WinWaitExist("~Properties",5)
SendKeysTo("~Properties","^{PGDN}")
TimeDelay(2)
SendKeysTo("~Properties","^{PGDN}")
TimeDelay(2)
SendKeysTo("~Properties","!p")
TimeDelay(2)

Article ID:   W13833
Filename:   Sending Keystrokes to Tabbed Dialogs.txt
File Created: 1999:04:15:16:56:42
Last Updated: 1999:04:15:16:56:42