04-29-2024 04:20 AM
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.
04-29-2024 04:39 AM
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…
04-29-2024 04:42 AM
Why does my enabled code work but my disabled code doesn't? In my opinion they are the same.
04-29-2024 04:55 AM
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?
04-29-2024 05:01 AM
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.
04-29-2024 05:56 AM
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…