Simulating Click On Human Interface Device And Retrieving Data
Apr 7, 2010
I have USB device that is detected as human interface device (HID). The device has one button on it. I want to have more of same devices attached to one PC. I would like to simulate a click on that device (it is not a mouse!). It should be simple using Windows API, but I just can't seem to find an example or at least function that does that (I successfully found code that takes position of a MOUSE, and sends click to a MOUSE, but I need that for my HID). What i really need is an example how to simulate click on HID (something like joystick).Second question is a bit more complicated and I can't find a solution. The HID when button is clicked returns data (5-6 bytes). But data returned is immediately printed to the screen (like i typed it on keyboard) and it is followed by CR, however no data is left on clipboard. I don't know how to get that data to my program. Detecting keystrokes using Windows API (something like keylogger), or to make a control (richtextbox) and retrieve data from that control? Thou important notice is that my program is complicated, involves multithreading (cross-thread operations are a mess) and is TIME CRITICAL (as much as it can be on Windows - you get what I mean), so cross-thread access of control will slow me down a lot or even just won't work. Something like this:[code]Even if this problem is solved it still makes it buggy because user should be able to use GUI all the time.
View 5 Replies
ADVERTISEMENT
Aug 13, 2010
I am writing a small app that is retrieving data from a device connected to a virtual com-port. I connect without problems to the device using the settings 9600-8-N-1.
I need to send the command <esc>MS , the device then sends back the data to a computer. I have tried this using Hyperterminal with success. I also did this with Excel and VBA. I used the MSComm32 Active X control:
MSComm1.Output = Chr$(27) + "M" + "S" + Chr$(13)
Msgbox(MSComm1.Input)
This made the data from the device pop up in a messagebox. I am writing a winforms app in vb.net, using VS2005. I have a form, on which I have a Placed a SerialPort control, named sp. My sample code is as follows:
Private Sub Form1_Load(ByVal
sender As System.Object,
ByVal e
[CODE]...
This returns the error message "Error: expecting a command". I have done som tests in HyperTerminal, and have concluded with:
-If I dont send <esc>, I get error "Expecting a command"
-If I send wrong command (ie MD instead of MS) i get error "Bad command"
Based on this, I suspect that I don't pass the escape character correctly to my device. So I wonder how to do this?
View 5 Replies
Sep 18, 2009
I am currently attempting to simulate a mouse click within a Webbrowser control. I am able to move the cursor to where I want but i have been looking for hours for a way to make it click. An explanation as well as exemplar code is preferable as i would like to understand how it works...
View 3 Replies
Feb 24, 2010
I'd like my application to be able to detect a where a particular USB device has been mounted, and adapt accordingly. Ideally, I'd associate paths with a USB serial number, rather than with a given path. However, I cannot figure out a simple way to access these unique IDs from VB.Net code.
View 1 Replies
Jun 19, 2012
ulating a auto mouse click in VB 2010 or C# Express 2010 Ive been trying for awhile now but cant find a code that works! I need a code to click a web browser on a timer say to click every 3
View 8 Replies
Oct 22, 2010
I need to come up with a way for a user to select multiple non-consecutive rows of a DataGridView from a touchscreen. Using a mouse & keyboard I would just Ctrl-Click on the rows I want to select, but I dont have that option with a touchscreen.
View 9 Replies
Sep 12, 2010
When I execute DoMouseClick then I get a PInvkokeStackImbalaced. I searched on google and tried some other things nothing really worked.
Public Class PerformClick
Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Const MOUSEEVENTF_LEFTDOWN As UInt32 = &H2
Const MOUSEEVENTF_LEFTUP As UInt32 = &H4
[Code] .....
View 3 Replies
Mar 18, 2011
I would like to know how to code for a right mouse button click. The idea is that after a checkbox is checked I want the program to stimulate a right click.
View 9 Replies
Dec 9, 2011
For my program, I have a webbrowser loaded with a website which contains flash elements. I'm trying to simulate a mouse click (using coordinates) and have the user not need to have the form highlighted (I believe this means the physical position of the cursor shouldn't need be changed either). I've been experimenting with the
[Code]...
This is what I'm looking for however, paired with the ability to simulate the click while not being on that form. I believe this would require the coordinates to be relative to the form itself also. I'm not sure if this is all possible in Visual Basic, however I've seen it utilized in Actionscript and Java.
View 3 Replies
Apr 2, 2010
I'm trying to build a VB application that will interface with a USB device that uses a LibUSB-32 driver. I haven't had much luck with google search or looking through MSDN yet as most of the content focues on HID devices. I know the Vendor ID & Product ID of the USB Device. I also know the 16-byte protocol used to communicate with the device.
Most of my experience has been with serial communication which is why I'm here posing this question to help build the "tunnel" from .Net to the LibUSB-32 driver. As soon as the application is sending/receiving data with the USB device, I can handle everything else. I'm not asking anyone to write the code, but more to let me know what I should be looking to do to complete the task.
View 1 Replies
Mar 8, 2012
I am developing a software that will monitor/poll serveral Modbus/TCP devices on a network.
I have managed to connect to one device using VB.Does anyone know of a driver or perhaps a 3rd party software I could use that will enable me to connect to more than one Modbus/TCP device?
View 2 Replies
Aug 21, 2011
I don't know where to start so i will explain my project. I want (someday) to make a macro scripting program kinda like SCAR. The difference will be that it will simulate all the function/procedures from scar. What i mean by simulate is that you can "Mouse Click" without actually moving or affecting the "real" mouse. This will allow you to macro and do what ever you do on the computer at the same time.
View 4 Replies
Oct 29, 2010
I'm currently working on an VB.net application using Win forms and SQL Server Express 2008. One of the major functions of our program is to generate work orders for field engineers. These engineers typically work in a factory and have to walk around the factory to complete these work orders doing things such as recording pressures and voltages of certain equipment. Right now they are printing out the work orders and writing down these values then entering them into the computer when they get back from doing the work.
We would like them to have some sort of handheld device we could push their work orders out to that would allow them to enter values/complete work orders and then come back and sync up with our app. Something like an ipod touch or maybe a bit larger seems like a good kind of device. Not really sure what kind of device would work for this and what OS it should run. I'm guessing it will be easiest if I can get something that can run SQL server on it. Also, how would I implement something like this?
View 2 Replies
Dec 30, 2010
'SimulateClick2 = SimulateClick2(hwnd, BM_CLICK) '(works)
the following doesn't work
SimulateClick2 = SimulateClick2(hwnd, MOUSEEVENTF_LEFTDOWN)
SimulateClick2 = SimulateClick2(hwnd, MOUSEEVENTF_LEFTUP)
View 5 Replies
Jun 16, 2011
1.When the user clicks the button the info from the controls on the left appears in the label on the right.
2.How to retrieve the selected dates from the calendar control when the user clicks the button?
View 15 Replies
Nov 10, 2009
I'm currently working on a project where I am transmitting data from a comm device via the serial port and resorting the raw data (in binary) to its respective ascii values. The problem I'm facing is determining the most efficient method to accomplish my goal. Essentially, I have 68 bytes coming in, the first and second bytes represent the page and packet number and the data itself ranges from 3 to 64, the remaining for my checksum.
What I am needing to do is, grab 50 consecutive bytes per variable in my array, and that is where I'm confused. I have easily pulled my 3-64 bytes and stored that data to a string. I just don't know the most efficient method to accomplish my goal. Should I write directly to file all my data, as there are like 8 pages, of 128 packet data. [Code] I can capture the the first 50 by using a for-loop easily, but what would be the preferred method to track what data chunk I've taken? The more I think about it, I think I may just want to write to file, all my data, and then just take them back to back in 50 byte chunks. Is that the most efficient method?
View 3 Replies
Mar 2, 2012
I have a modbus TCP device that I have managed to connected to through my VB source code.
I want to poll (continueously read) data from certain registers of the device, and store the polled data in a file (text,csv, excel).
View 1 Replies
Oct 16, 2011
I'm using a mysql as my backend database and i'm using the mysqldata adapter for binding the data, i have my data in the database, but the problem is i don't know how to retrieve it, for example when i want to add a record, before i add that record, i want to retrieve the data in my database to trap that the record i'm adding is an existing record
View 11 Replies
May 5, 2010
how can i make my program feel if any device or usb device plugged into the computer or unplugged.url...
View 3 Replies
Nov 13, 2009
A Problem in accessing a device from VB Windows cannot load the device driver for this hardware because there is a duplicate device already running in the system. (Code 42) This error is because i am using 2 devices of the same company which has the mass usb storage on it and when i install one of the device the other hides. So one is detected the Other is not. It also give a error called designed dragnonacally something...
View 2 Replies
Oct 2, 2009
i did some research on click and drag and i still dont get it, can any body plz help me with this.
P.S. when i write in the code i ALWAYS get a not defined error!
View 3 Replies
Oct 17, 2011
I have a usb instrument and a driver who's printed output dumps a data string to the computer I need to be able to read this string into vba The driver manual provides the content of the string but no info on how to access the data.
View 1 Replies
Aug 4, 2010
I've created a custom USB device using a PIC18F4550 and I'm having trouble with reading information from the device. The device sends reports without a request from the application as 64 bytes. I'm relatively new to VB and this is my first foray into USB as well... It's not going good. I've set the Vendor ID to Hex 1234 and the Hardware ID to Hex 0001. I've used different libraries and the timer to check for incoming reports, but I can't seem to figure it out. I've waded through pages of USB Complete and all kinds of code for mice and barcode scanners, but nothing so far that will do anything for my device.. how I can register the device and get the raw report from the device and display it in a text box
View 1 Replies
Mar 19, 2010
How can I read data from a HID device (USB RFID Reader)and which acts like a keyboard.
View 4 Replies
Oct 29, 2008
I'm trying to bring up a simple right-click menu on a listbox and I'm having little luck with it. I created a basic ContextMenuStrip named "ContextMenuStrip1" and I'm trying to call it in the ListBox's Mouse Click method:
Code:
Private Sub ListBox1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListBox1.MouseClick
If (e.Button = Windows.Forms.MouseButtons.Right) Then
ContextMenuStrip1.Show(MousePosition)
End If
End Sub
So here's what it's actually doing. The right mouse button doesn't seem to activate MouseClick at all for this object. It is caught in MouseDown, but when I try to call this from that method, the ListBox Index doesn't change. How can I get a right-click to be called from the MouseClick (Not imperative) and how do I get the ListBox to change the index with a right-click?Also, the menu looks like one of Office's right-click menu that can have an image to the left of the text. When I don't have an image the text is about 50 pxls or so away from the left edge. This looks weird. Can I change that?
View 3 Replies
Feb 6, 2011
I have a sim card reader, that is a usb-to serial device. It has a sim card inserted. what i need to do is access that sim card to get the data, phonebook and sms for example. I CAN connect to the reader but i cannot send any commands or recieve any data.
What are the commands i could use to access data held on the device. The chipset is pl-2303
View 2 Replies
Jan 22, 2011
What is the best way to go about retrieving data from a proprietary hardware device that interfaces via HID USB? The particular device I need the data from is a blood-pressure/heartbeat measurement & monitoring device.The hardware came with software that downloads the data from the device and places that data into a (passworded/encrypted) MS Access database that I cannot connect to using programmatic methods, at least not without having the (admin's) password. The software provided produces reports, but the formatting renders them virtually useless (well, completely useless) for the needs of our company.
The device manufacturer provides to it's customers no API or any other technical information for accessing the data produced by their product; so, this pretty much leaves me stuck trying to figure out how to obtain the data via custom application in order to reclaim the initial justification for the expense associated with the hardware, which by the way has already been purchased.I don't need code snippits specifically, though examples would be nice; what I really need is to know is how to best approach this project, from a general design and programming stand-point.
View 2 Replies
May 27, 2012
I know how to send data to com or virtual usb-com if it has physical com port number listed under "Ports (COM&LPT)" tab in the Windows device manager
' sending to device with physical COM port number"
Try
Dim searcher As New ManagementObjectSearcher( _
[Code]...
But how to send data to the device listed in "Universal Serial Bus Controllers" tab without any physical COM port number?
View 8 Replies
Jul 29, 2009
In a application i'm working on i need to be able to select a graphic (a line to be specific) and then i need to change or move it but i cant find how to add a click event to the line when a draw it. Basicly i want to click on the line to select it (make it fatter or an other color) and then be able to alter it in position and size (lenght). Is there any way or what is the correct way to do this?
View 6 Replies
Aug 13, 2008
I need to visually moves the cursor using keyboard keys.
1) I need to get the mouse to where the button is
2) Simulate the mouse movement to the button from whereever it is
3) and simulate a button click.
Only after I select a button I can start drawing on my form. I have a code here, when I hold the Ctrl key and press the arrow keys, the mouse will start drawing straight lines. But what happen when I need to use controls like buttons, comboboxes etc.?
View 1 Replies