Download (24K)

Syntax: WPostCmd [["]/cClassName["]] [["]/nWindowName["]] [["]/iCommand["]] [/tTimeOut]

Post a command to the window specified by ClassName and WindowName. Class name and window name can be enclosed in "" to embed spaces. To pass a " repeat it twice. Only toplevel windows will be searched and if no match is found the command will not be send.

/cClassName: Optional. Specifies the class name of the window to post the command to.

/nWindowName: Optional. Specifies the window name (title) of the window to post the command to.

/iCommand: Specifies the command to post as a number. If not specified 1 (IDOK) will be sent. Common commands are: IDOK = 1, IDCANCEL = 2, IDABORT = 3, IDRETRY = 4, IDIGNORE = 5, IDYES = 6, IDNO = 7, IDCLOSE = 8, IDHELP = 9.

/tTimeOut: Optional. Time in milliseconds to try and find the specified window. During this time WPostCmd will try to find the window once a second. Defaults to 10000.

Example: WPostCmd "/nConfirm upload" /i1 /t60000

will look for one minute for a top level window named "Confirm upload" and if found press its OK button. If the window is not found a message box will inform you and the command will not be send. If you specify no class name and no window name then no command will be sent.

Download (24K) Home