AlanR Posted October 2, 2006 Share Posted October 2, 2006 I have a simple script to run Windows MSPaint (renamed _mspaint.exe here) and set the print option to "Fit to 1 page x 1 page" when Paint opens. This works OK, but the "Page Setup" dialog window flashes up. I'm unsure if keystrokes should be passed to this dialog window, or the main "untitled - Paint" window. Also, this will only work for a new file, not an existing one - where the window title will be "filename - Paint". What is the correct method to send keystrokes to a dialog such as this please? Also, is this the right way to hide the app during Send operations? Dim $Program, $PID, $i, $params if $CmdLine[0] > 0 Then for $i = 1 to $CmdLine[0] $params = $params & " " & $CmdLine[$i] Next EndIf $Program = "C:\WINDOWS\system32\_mspaint.exe" & $params $PID = Run($Program, "", @SW_HIDE) WinActivate("untitled - Paint") Send("!fu!F{TAB}1{TAB}1{ENTER}");dialog flashes up here WinSetState("untitled - Paint", "", @SW_SHOW) AlanR Link to comment Share on other sites More sharing options...
Xenobiologist Posted October 2, 2006 Share Posted October 2, 2006 Hi, have a look at macros and Opt like WinTitleMatchMode and at the ControlCommands like ControlSend. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now