I have developed an application in C++ that runs on Windows 7, 8.x and 10. I would like to use a Bluetooth remote shutter to control the application.
The remote shutter seems to be a HID device that sends keypresses to Windows. The default behavior of those keypresses is Volume Up, Volume Down, Play/Pause, Next and Previous.
While I can detect those keypresses from my application and act on them, I have not managed to disable Windows acting on them. E. g. currently, when someone presses the Volume Up key on the remote shutter, two things happen:
Whatever I tell my application to do on that keypress
Also, volume goes up on Windows
How can I tell Windows not to act on those keypresses for this particular device?
Thank you
I have not tried it but i think it may be possible by disabling the Human Interface Device Access Service on Windows.
There may be some side effects along with that like for example:
If the service is stopped or disable, the buttons on USB keyboards will not function (i.e., back, forward, volume up, down, previous track, next track), nor will the volume buttons on USB speakers.
but you can still try :)
here is how to disable it
Related
I have an SDL2 application that I launch over SSH and I would like to have it process text input over the SSH connection. Is it possible to have the SSH connection show up as SDL_TEXTINPUT?
Additional Details / Requirements:
I'm open to alternate solutions. This just seemed like it could be an easier option than trying to create a multi-threaded application to monitor stdin (I'm kind of a beginner with c++...)
The idea is to use the text input to issue commands to cycle through states and interact with hardware (UART) connected to the remote system.
The remote system is essentially a headless raspberry pi (SDL renderer pixels are memory mapped to /dev/fb1 for display)
A keyboard can be directly connected to the remote system for input, but there is no console display which makes launching the application and printing debug messages problematic.
I'm writing this in c++
I am trying to develop a program so that I could use my android phone as mouse. For that i will have a service running on Windows pc which will wait for packets from android phone through socket connection. These packets will contain information about the mouse events like button pressed, position etc. I want to dispatch the event in the system. How would I do that using C/C++? Thanks in advance.
Use the SendInput function to generate simulated keyboard and mouse events.
If you are going to create an actual NT service then you might have a problem because the service will be running in the wrong session. If you still feel you need a service then you might have to spawn a new process that runs as the user in each session with CreateProcessAsUser but it is much simpler just to design it as a normal program that starts when a user logs in by adding a Run registry entry.
Once my embedded device is connected to USB port of my PC, it should trigger an exe as an event. How can I achieve this??
Should I create a service to keep monitoring the USB connector bus or is there any default API's available in Windows to achieve this??
thanks.
A simple exe which is started on connect is not possible. But you can write a service or user mode application which listens for device arrival events. WM_DEVICECHANGE is sent to all (registered) applications with a device interface guid which represents which device is plugged in. You can then use this id with the setupapi to see if its your device.
On receiving that event, you can then start your executable.
Depending on your version of Windows it might be possible with a workaround using a AutoRun.inf file in the root folder of a USB drive. For security reasons this is by default turned off, and in Windows 7 not allowed at all.
To achieve the same effect in a more robust way, you need to create a service that monitors whether your device is connected or not (e.g. iTunesHelper that monitors for connected Apple devices).
The easiest solution is probably a trivial UMDF driver. That's basically a small COM component called when your device is connected.
I'm trying to detect the event when a FireWire cable is plugged into the FireWire port of the PC withing MFC C++ app. I would also like to trigger this even myself as the FireWire connections drops and never is rediscovered withing unplugging the cable and plugging it back in.
Anyone have any experience trying to programmaticaly simulate a unplug-replug event?
You can register yourself to receive device arrival messages. See the help for RegisterDeviceNotification to find an example on how to register yourself.
You can trigger a bus reset notification on the firewire bus, but I don't know if you can do this from user mode, without the help of a kernel mode module.
I want to be notified when a microphone jack is plugged in. What is the event fired by the OS(particularly Vista)
The audio panel shows no recording device active if no mic plugged in(vista). This never happened in XP.
Also if my microphone had a "advance control" for eg Bass Boost, Mic Boost(AGC) etc, how can I get the mixer control for the same to control it.
I'm using MFC for development.
Thanks
I believe that you want to implement IMMNotificationClient and handle the OnDeviceAdded event.
If you want the various controls in Vista, you're better off using the Device Topology API to get the controls (IAudioLoudness, etc.) Otherwise, you need to enumerate the mixer device IDs & ask them for their endpoint IDs, then compare the endpoint ID to find the real device you're interested in.