LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call Library Function Node - GetCursorPos

Key Focus leaves behind a black square around the String. Leave the question, I'm interested in knowing how I press a button with the mouse at a specific location on the screen using the Windows API. Regardless of boolean or string.

0 Kudos
Message 11 of 16
(236 Views)

Hi Max,

 


@maxnoder1995 wrote:

I am trying to execute this logic using mouse_event but I don't know where my mistake is.


Which mistake? Do you encounter any errors, and when yes which ones?

 

In the end you need to move the pointer to the correct (screen) coordinates and simulate the mouse click action. Screen coordinates should be window position + control position within window…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 16
(230 Views)

Why does my enabled code work but my disabled code doesn't? In my opinion they are the same.

0 Kudos
Message 13 of 16
(227 Views)

Hi Max,

 

please read the remarks about mouse position, they seem relevant for your use case.

 

What's wrong with placing your "working" code into a subVI and use it as is?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 14 of 16
(214 Views)

My "working" code works but does not meet extreme conditions if the mouse moves quickly while the program is running.
I've read the remarks about mouse position and yet, I didn't succeed properly.

0 Kudos
Message 15 of 16
(206 Views)

Hi Max,

 


@maxnoder1995 wrote:

My "working" code works but does not meet extreme conditions if the mouse moves quickly while the program is running.


Why does your use move the mouse when (s)he is supposed to input some text? (The KeyFocus frame even indicates the requested user input…)

 

I would rather stick with LabVIEW-internal options (KeyFocus, ValueSignalling) that would work instead of calling external resources…

 

When the user text input comes from a Barcode scanner you could even place the string control off-screen, so the user wouldn't notice the frame. You can show the same text (some milliseconds) later on an additional string indicator…

The same for your boolean button: you can handle/store the boolean value in a different place and just update the control/indicator later on to reflect the internal boolean value.

I often use this principle: separate internal data storage/handling from UI elements. DATAFLOW: the wire is the variable, not the UI element…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 16 of 16
(186 Views)