Jump to content
Macro Express Forums

Is it possible to resize a control


acantor

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...