Jump to content
Macro Express Forums

Controls not working as expected


Rick1

Recommended Posts

I'm trying to use a C1 control becoming visible to go to the next step in the program. Instead it seems to not be seeing the control, or something else, not sure. I'm trying to get it to wait until a report is generated by a program. The control disappears while the report is being generated. Then when the report is displayed on the screen, so is the control, C1. It is not waiting for the C1 control to become visible, but instead steps into the next step of the program before it becomes visible. My code is below. I have ME3.7d

 

<MSD:5000><WAITWIN2:000010:000000:Market Statistics - TREND><GETCONTROL:01:IEXPLORE.EXE:004:IEFrameMarket Statistics - TRENDShell DocObject ViewInternet Explorer_ServerInternet Explorer_TridentLstBox><SETFOCUS:01><MSD:1000><TEXTTYPE:<CTRL>a><MSD:11><TEXTTYPE:<CTRL>c><ACTIVATE2:Microsoft Excel><MSD:1000>

Link to comment
Share on other sites

  • 2 weeks later...

Rick,

 

I feel your pain. The control portion of macro express is the worst I have ever seen. I don't think it works the way they claim it does.

 

For example, When I use Get control. I drag the bullseye/crosshair to the control and it works! The only problem is that it works only for a while.

 

Now I got an explanation that soemtimes the control changes it's control name. Really? I tried to use it to capture Internet Explorer's web address bar. It worked! Then after I reboot the computer a few days later or don't use Macro Express for a while, it cannot find it again.

 

I guess now they'll say that Microsoft changes that too. It's so confusing and their help file leaves a lot to be desired on most things that I have turned to Autohotkey and AutoIt because it works there.

 

If anyone can correct me if I am wrong, please do so, but this is not right and downright misleading.

 

Pat

Link to comment
Share on other sites

Please do not paste macros directly into the body of your posts. Use the Code tags instead. There is an icon above that shows the hint "Wrap in code tags" that will allow you to create a code box.

 

Macros cannot be reliably copied from a post and pasted into a macro unless they are placed inside a code box.

Link to comment
Share on other sites

Microsoft defines a control this way:

 

"A control is a child window an application uses in conjunction with another window to perform simple input and output (I/O) tasks. Controls are most often used within dialog boxes, but they can also be used in other windows. Controls within dialog boxes provide the user with the means to type text, choose options, and direct a dialog box to complete its action. Controls in other windows provide a variety of services, such as letting the user choose commands, view status, and view and edit text."

 

Not every button, menu item or component on a program is actually a Control. Sometimes the only control in a given program is the window or dialog that pops up when the program starts. We have also noticed that many of Microsoft's programs seem to have fewer controls than programs from other manufacturers. How the controls work depends on the way the program you are trying to control works.

 

In other words, a control is a piece of information embedded within an application. Macro Express communicates with controls via Windows. When the control changes, or if it is not there at all, Macro Express cannot communicate with it. This is entirely under the control of the application.

Link to comment
Share on other sites

Kevin,

 

I appreciate your answer, but there should be a way that when the bullseye gets the control that it also captures the coordinates relative to the window. You should have it programmed into the language of capture control that the coordinates are grabbed too so that, for example, if Windows Internet Explorer's address bar is not in the same place(for example, because the window is smaller than when it was originally captured), it could still pick up the text OR THE NEW NAME OF THE CONTROL because it knows where to look for it from the X,Y perspective relative to the window.

 

The center of that bullseye should be what's used to nail down a spot relative to the window.

 

There should be a way to use the "control details" tree for something. None of that is usable to possibly edit a variation of the changing control class. We should be able to edit and manipulate those trees to see how far we can go to get a close to perfect match? I am no programmer, but there has got to be a way to get us a control class/name that is close to the one we orignally chose with the "bullseye".

 

Subsequently,once the command is executed, ME could secretly send a mouse click to "Capture the text under the control" just like Capture control "Beneath the Mouse" and it could work every time because it knows where the X,Y coordinate is relative to the window.

 

Maybe I am rambling and don't know what I am talking about.

 

I love your program, but this really gets under my skin. I wish you could fix this.

 

Pat Gennare

Link to comment
Share on other sites

  • 2 months later...
Kevin,

 

I appreciate your answer, but there should be a way that when the bullseye gets the control that it also captures the coordinates relative to the window. You should have it programmed into the language of capture control that the coordinates are grabbed too so that, for example, if Windows Internet Explorer's address bar is not in the same place(for example, because the window is smaller than when it was originally captured), it could still pick up the text OR THE NEW NAME OF THE CONTROL because it knows where to look for it from the X,Y perspective relative to the window....

 

Here is an example of different ways of capturing multiple controls and programming a macro to take them in to account: http://pgmacros.invisionzone.com/index.php...amp;#entry10965

 

The problem is that many programs (Microsoft products are a good example) use cache in one form or another, have rolling controls, etc., and they don't write their programs with macros in mind (I recommend turning off Macro Express caching and if your program does a lot of caching but you don't really need it to, turn those options off). You can get around this by using the "If Not Control Enabled / End If" and just capture each control when it changes on you... Eventually you should have all of them and the macro will work consistantly. For example, many HP programs have two controls for every field in their forms; whereas Outlook e-mails can have dozens of controls based on the configuration of the client (HTML, Rich Text, Word as the Editor) so you have to take all of those in to account.

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...