09-12-2010 12:39 AM
I am working on a 2010 LV program to mitigate operator errors--pretty simple; mainly manipulating a third party executable window (TPEW). However, my program (MP) works great but has a huge, basic flaw that I am sure there is a simple solution? Without a solution, unfortunately, correct operation of MP relies on the premise the user will not touch any peripherals; not very reliable when MP is supposed to add process control—LOL. After the user scans a few barcodes into MP, MP activates opens/activates the TPEW, sends virtual key presses (VKPs), using user32.dll commands—typical method I think, to “type” the name of a particular graphics file (and other info) into the TPEW data fields. MP works like a champ, unless the user clicks the mouse (deactivates the TPEW) or hits the actual keyboard (extraneous keys corrupt the laser marking graphics file name MP is “typing” in). MP needs to periodically disable the peripherals, but at the same time, be able to send VKPs. GIVEN THIS METHOD (user32.dll) OF SENDING VKPs OR ANY OTHER, CAN PERIPHERALS BE DISABLE BY AT THE SAME TIME VKPs ARE SENT USING LV? I searched the entire internet, but have not found a solution.
Solved! Go to Solution.
09-13-2010 11:47 AM
Check out AutoIT for controlling external apps
I've used it with great success to lockout the keyboard/mouse then run the external code , then enable the keyboard and mouse again
see snippet below. You create an Automation Refnum to use the AUTOIT library features
just google AUTOIT
Last I checked it was a free download
09-13-2010 04:00 PM
you dont need autoit...theres a windows api call called blockinput you can use...just google it in MSDN (microsoft develloper network)...
09-14-2010 12:13 AM
THANKS, I will give it a shot and let you know the outcome (hopefully in the next day or 2--stuck on higher priority paperwork--LOL. However, I must find the solution before I can finish up the software.
I have tried similar things but the same problem occurs, my virtual keypresses sent using user32.dll get block also.
Thanks again for taking the time!!!
09-14-2010 02:32 AM
Tried but does not work because I need to send virtual key presses when block is enabled; blocks my API virtual keypress also. See attached example please. Maybe I am doing something wrong?????
THANKS FOR YOUR TIME!!!!
09-14-2010 03:09 AM
I am researching autoit, but don't quite get it yet. Do you know if I add send key commands using API calls, where you specified to enter my code, will it be blocked by the autoit block? Please see example code in jpeg I posted below, using API disable input. My prob is if I disable input using API, it also disables my keypresses sent via API. I am kinda thinking disabling via autoit will have the same problem. Maybe I need to figure out another method to send virtual keypresses, though I don't have a clue what would work other than sending via API as I am.
I hope this works, or I may be SOL. I just need to do a bit more research to see how to configure it.
Regards,
Shannon
09-14-2010 08:31 AM
I use Auto IT for everything -
lock keyboard / start external app / send commands / close external app / unlock keyboard
see below
09-14-2010 05:21 PM
I am researching auto it and found the following statement.
Note that functions such as WinMove() or Send() will still work when BlockInput is enabled because BlockInput just affects user interaction with the keyboard or the mouse not what is done with AutoIt functions (aside from the exceptions in the table above).
That means there is hope! And from what you have posted too. Using Labview user32.dll to block input then send keypresses won't work as far as I see since it blocks the keypresses I need to send too (when input is blocked).
Now I just need to figure out how to use Auotit!
THANKS ALL FOR YOU BIIIIIIIIIG HELPPPPPPPPPPPP!
09-14-2010 05:31 PM
Thanks again!
09-14-2010 05:44 PM
When I invoke a node in LV, how do I link it to autoit?
One last question...dumb because I think I know the answer, just confirmation please.
I just found AutoIt v3.3.6.1 .exe installer. I am making a standalone LV executable. I assume the best way to manage AUTOIT is to add this installer to run as part of my labview installer (advanced options page)? I need to install another driver too...it seems the advanced installer page will only let me add one .exe only....should I make another thread for this question?
Thanks,
Shannon