Jump to content
Macro Express Forums

Click/Double click on control


Rustywinger

Recommended Posts

So I capture control to C7.

 

Mouse Click on Control is then entered into the Macro script, with C7 as the control specified to reference.

 

Single click... works as advertised. A click is entered into the control.

 

Double click... does not. It will not even click on the control.

 

 

Sorry if this has been previously covered. Ideas? I have tried using different mouse speeds, etc.

Link to comment
Share on other sites

Double click... does not. It will not even click on the control. Sorry if this has been previously covered. Ideas? I have tried using different mouse speeds, etc.

Not sure what is happening. I set up a test with the calculator and got the same results as you.

 

I'll create a bug report and send it to Insight. In the mean time, two single-clicks in a row can be used as a work-around.

Link to comment
Share on other sites

The capabilities of a specific Window Control depend upon that component and how the application was written. Windows uses 'messages' to accomplish certain tasks such as sending keystrokes or mouse clicks to an application. A Window Control needs to be written to handle these messages. If it is to accept keystrokes, it needs to have a keystroke handler. If it is to accept mouse clicks or mouse double-clicks it needs to have handlers that accept clicks and double-clicks. An application may have a component (like an edit box) that accepts a double-click but does not accept a double-click via a Window Control.

 

Macro Express correctly sends the messages for keystrokes, clicks and double-clicks to controls. I reverified that these are working this morning.

 

Floyd said:

I set up a test with the calculator and got the same results as you.

I looked at Calculator and there are no functions that use the double click. Double mouse clicks are treated as two individual single clicks. In this case Windows and/or Calculator may be interpreting double-clicks as single clicks. But, it does not accept a Double Click message.

 

A better test is with WordPad. If you double-click on a word in WordPad the word gets highlighted. A simple macro verifies that double-click via a Window Control is working correctly:

// Launch WordPad
Activate or Launch: "wordpad" OR "wordpad.exe"
Wait For Window Title: "wordpad"

// Type some text into WordPad
Text Type: The quick brown fox jumps over the lazy dog.<ENTER>

// Get control and double click via control to highlight a word
Get Control %C1% (Document - WordPad: RICHEDIT50W)
Mouse Double Left Click on Control %C1%

 

<REM2:Launch WordPad><LAUNCHYES3:0:0112wordpad<LAUNCH:wordpad.exe><WAITWIN2:000000:000010:wordpad><REM2:><REM2:Type some text into WordPad><TEXTTYPE:The quick brown fox jumps over the lazy dog.<ENTER>><REM2:><REM2:Get control and double click via control to highlight a word><GETCONTROL2:01:WORDPAD.EXE:WordPadClassDocument - WordPad001:15RICHEDIT50W><CCLICK:F:01:0:F:000150,000000>

Link to comment
Share on other sites

A better test is with WordPad. If you double-click on a word in WordPad the word gets highlighted. A simple macro verifies that double-click via a Window Control is working correctly:

 

 

Thanks for the insight, both of you. Sorry I was so late in responding.

 

Ok, I am entering a double click into a text field that contains text.

 

 

If I just double-click on it manually, the text- if it exists- is highlighted (This is what I want to happen).

 

If I use ME to click on control, the text prompt is inserted into the text field at either the point of click or beginning of line (if it was blank)

 

If I use ME to double click on control... nothing. Not even the text prompt. If a "double click on control" is simply two clicks in sucession, why isn't the first one at least inserting the prompt?

 

BTW- this is all just "discussion" now... I had to use "move mouse" and "left button double click", which does the job- I was just wondering why double-click on control couldn't do this since now my script is no longer dynamic! How awful. ;-)

Link to comment
Share on other sites

If I use ME to double click on control... nothing. Not even the text prompt. If a "double click on control" is simply two clicks in sucession, why isn't the first one at least inserting the prompt?

A double-click is not just two single clicks. When you click twice, windows interprets that as a double-click and sends a double click message to the application. When you click once, windows sends a single click message to the application. These messages are different.

 

I was just wondering why double-click on control couldn't do this

It sounds like your application does not support double-clicks via the Window Control.

 

The capabilities of a specific Window Control depend upon that component and how the application was written. Windows uses 'messages' to accomplish certain tasks such as sending keystrokes or mouse clicks to an application. A Window Control needs to be written to handle these messages. If it is to accept keystrokes, it needs to have a keystroke handler. If it is to accept mouse clicks or mouse double-clicks it needs to have handlers that accept clicks and double-clicks. An application may have a component (like an edit box) that accepts a double-click but does not accept a double-click via a Window Control.
Edited by kevin
Link to comment
Share on other sites

A double-click is not just two single clicks. When you click twice, windows interprets that as a double-click and sends a double click message to the application. When you click once, windows sends a single click message to the application. These messages are different.

It sounds like your application does not support double-clicks via the Window Control.

 

Ugh. I am still confused, sorry! I just want to understand these things so I can consider them in the future.

 

 

How is an ME "Double click on control" different than an ME "Mouse left button Double Click"?

 

I would have just assumed that ME delivered on both action requests the same way since the "on control" part of that is just a means of focusing the click on X-Y, same as "move mouse". Obviously it doesn't work that way because one works and one doesn't.

 

Is it because the "Mouse Left Button Double Click" sends the command through a different process, ie- through the the mouse handling routines and "Double Click on Control" bypasses that and sends the command directly to the system?

Link to comment
Share on other sites

The Mouse Left Button Double Click command sends a message to Windows that says the user double-clicked. Windows sends the message to the application.

 

The Mouse Double Left Click on Control %C1% command sends a message directly to the component (edit box, button, etc.) in the application.

 

Just as an application may have a component without an associated Window Control, applications may have routines that process double-click messages sent to the application (not the component) without having a routine to process double-click messages send to the component (via a Window Control).

Link to comment
Share on other sites

Ugh. I am still confused, sorry! I just want to understand these things so I can consider them in the future.

How is an ME "Double click on control" different than an ME "Mouse left button Double Click"?

 

I would have just assumed that ME delivered on both action requests the same way since the "on control" part of that is just a means of focusing the click on X-Y, same as "move mouse". Obviously it doesn't work that way because one works and one doesn't.

 

Is it because the "Mouse Left Button Double Click" sends the command through a different process, ie- through the the mouse handling routines and "Double Click on Control" bypasses that and sends the command directly to the system?

 

I NEVER use double-click because it's not reliable.

Instead, for each click, try using:

Mouse Left Button Down

Mouse Left Button Up

 

So, in your case, for a double left mouse click do this:

 

Set Focus to %C7%

Mouse Left Button Down

Mouse Left Button Up

Mouse Left Button Down

Mouse Left Button Up

 

 

If this doesn't work (I haven't tested it), let me know and I'll figure it out for you.

 

-jim

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