LabWare V7 with SendInput DLL

« Back to Previous Page
0
0

Please to read the entire article.

Marked as spam
Posted by Tyler Norris (Discussions: 1, Comments: 3)
Replied on November 15, 2018 10:56 am
16 views
0
Private comment

John Newtown https://www.linkedin.com/in/john-newtown-5382249/ from Labware should be able to help you out.

Marked as spam
Posted by John Jones (Discussions: 368, Comments: 3052)
Replied on November 15, 2018 11:24 am

I can attempt to contact him; however, he has no direct contact information so my only hope would be him accepting a request on LinkedIn so that I can message him on there. However, I am reluctant that this would play out in my favor considering that consultation with a LabWare consultant is a service and quite expensive.

I have emailed the LabWare LiMS email service in hopes that someone subscribed to that will be able to help, but I would still appreciate any help on here as well.

Thank you very much though for the suggestion and quick response.

(Tyler Norris at November 15, 2018 11:58 am)
0
Private comment

Well, honestly Tyler, I have never seen anyone provide help from Labware outside of their paid support. Even users are skiddish about posting help. There are independent consultants such as Gloria Metric that provide support on Labware and I think she may be able to provide some help. I will contact her and send her a link to this discussion. She may be able and willing to help out in this discussion.

Marked as spam
Posted by John Jones (Discussions: 368, Comments: 3052)
Replied on November 15, 2018 12:16 pm

Thank you so much, John. I greatly appreciate everything.

(Tyler Norris at November 15, 2018 1:33 pm)
0
Private comment

If anyone finds this in the future looking for the answer, this is what I found.

I corresponded through the LW-LiMS email service and what I found is that SendInput may not be a possible DLL to call from LW because one of the parameters is an array of DLL Structures, or a DLL Structure with a nested DLL Structure, and the DLL LiMS Basic functions aren’t made for handling this (SendInput is a fairly new DLL) so it might not be possible.

My issue with the LiMS SendKeys() was that something like Shift+Home or Shift+End wasn’t working properly. The reason being that SendKeys() won’t properly call a Shift combination keystroke if Num Lock is on. So if you’re having trouble, try your code again with Num Lock off and it should work properly.

SendInput is the successor to the DLL function “keybd_event”, also in User32. If you need to press the Num Lock key in your code, use:

arg[1] = 144
arg[2] = 0
arg[3] = 0
arg[4] = 0
argType[1] = “short”
argType[2] = “short”
argType[3] = “long”
argType[4] = “long”
status = DLL(“User32”, “keybd_event”, arg, argType, “ulongReturn”) ‘Press NumLock
arg[3] = 2
status = DLL(“User32”, “keybd_event”, arg, argType, “ulongReturn”) ‘Release NumLock

However, this will press Num Lock regardless of if Num Lock is already on or not, so use caution. I attempted using the DLL GetKeyboardState, which should return 1 if the key is toggled on, and 0 if it is not, but it was always returning 0 for me.

I have since abandoned the specific feature I was working on implementing because there are more intricacies surrounding it than even this, and without it being simple, it would be too involved to explain to the team.

However, knowing this information gave me the knowledge as to “why”, and that is enough for me to be able to say, “no.”

Good luck to anyone who embarks on a similar journey to mine, and if you figure out toggling Num Lock instead of pressing it indiscriminately, I would be glad to hear how you accomplished it, so please reply.

Here is the link to the labtrack issue, which should hopefully fix the relationship between SendKeys() and Num Lock in the next version of LabWare:

http://www.labware.com/Labware_labtrack.nsf/MainForm2_1.xsp?action=openDocument&documentId=D0D622452A221D6185258349004F1449

Marked as spam
Posted by Tyler Norris (Discussions: 1, Comments: 3)
Replied on November 19, 2018 10:16 am

Tyler, I wish the forum could have been of more help to you but I really appreciate you posting your findings here. My objective is to have as useful a resource as possible for LIMS and lab professionals when it comes to everything related to lab informatics. Sharing knowledge is key to that. Thanks again.

(John Jones at November 19, 2018 11:45 am)
« Back to Previous Page