Oct 4, 2010

Finished wrapping the HID API library with C# codes. A reading thread is responsible for reading something from the widget.

Following to do are:
  1. Study the pattern of the values returned. If I press a, b and c at the same time, the pattern becomes 00 00 04 05 06 00... If only a is pressed, it is 00 00 04 00 00 ... If only b is pressed, it is 00 00 05 00 00... We should write a "clever" function to analyze it.
  2. Integrate the getForegroundProcess program with this library.
  3. Figure out what should be sent to the widget to identify current running process.
The bugs that make the program unable to read and write data:
  1. I forgot to change the flags and control type respectively.
  2. To write something, nAccess = GENERIC_WRITE; nsharemode= nShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; controlType= 0x02... It is similar if we want to read something.
  3. The overlapped structure is vital for ReadFile to call. It is originally a blocking call. However, we can change its behavior by feeding an overlapped structure to it. Refers to MSDN, the passage about Readfile.
Acknowledgement (HID class only) and some follow-up explanation:
  1. createFile is called with many arguments. These arguments should also be called from other winAPIs. We have to provide GUID at some points... (refer to the openDev src code in the class HID and also documentation from MSDN)
  2. Make reference to genericHID.cs and its author. It gives definition of each winAPI function useful for our HID class.
  3. Also acknowledge to author of the UseHIDSample.cs

No comments:

Post a Comment