acantor Posted March 1, 2011 Report Share Posted March 1, 2011 I am using the "Get Control" command to capture a control in %C1%, and later, "Set Focus" to %C1%. This works nicely. But now I would like to resize the control. The way this is "normally" done is to place the mouse over the bottom border of the control, and dragging down. Using Macro Express, I check each pixel from top to bottom until Mouse Pointer becomes "Size NS", and then dragging downwards. It works, but it's a bit of hack. Does anybody know of a way to do the same thing programmatically, rather than manipulating the User Interface? Quote Link to comment Share on other sites More sharing options...
kevin Posted March 1, 2011 Report Share Posted March 1, 2011 What is defined as a Windows Control is dependent on the application itself. In addition to an entire window or dialog an individual edit box or button may be a control. Applications do not generally allow certain types of controls to be resized. You can automatically resize a window using the Window Resize command. I would recommend that you try to find a way to get the title of the dialog or window that is pointed to by your control variable. Quote Link to comment Share on other sites More sharing options...
acantor Posted March 1, 2011 Author Report Share Posted March 1, 2011 I am not sure of the technical language, but this "control" appears to be a child window within the application, similar to the "History" sidebar in a browser, but without a title. The control can be manually resized with a mouse. I thought there may a way to resize it using ME, similar to the way that ME lets me resize the entire application window. Quote Link to comment Share on other sites More sharing options...
kevin Posted March 2, 2011 Report Share Posted March 2, 2011 A child window may have a title even if it is not displayed. If you can determine the title of the child you can use the Window Resize command to resize it. There are two ways to determine the child window's title. The first, and easiest, is to open a Window Resize command, choose 'Specific Window' and click the 'Select Window' button. I would do this when the child window is not displayed and again when it is displayed and note the differences in the list of windows. In some rare cases a child window does not appear in that list but can be discovered using the Repeat with Window command. Try something like this: Activate or Launch: "Notepad" OR "notepad.exe" Repeat with Windows: Place title in %T1% If Not Window Title "Notepad" on top Activate Window: "Notepad" End If Text Type: %T1%<ENTER> Delay 0.05 Seconds Repeat End Macro Express does not have a way to resize a child window without a window title. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.