Camera button long press event in windows tablet - c#

I am trying to make a torch application in windows tablet. The ultimate aim is that "User should have immediate access to the torch". I managed to put the application in the settings tab of charms bar. But it requires 2 clicks, first on the setings bar then torch application.
Is it possible to put the application in the charms bar itself?, so the user can launch the application with a single click.
Or is there any way to get a trigger from external keys?. Something
like, "long press on the volume key will launch the application", or "long press on camera button etc..".
Any Help will be highly appreciated :).

First, no way to launch the app in the Charms bar.
You can register a event handler to HardwareButtons.CameraPressed
HardwareButtons.CameraPressed += HardwareButtons_CameraPressed;.
NOTE
By using HardwareButtons you shold first add reference of Mobile Extensions if you are developing UWP apps.

Related

C# Disable mouse takeover

I am currently using the windows on screen keyboard to control the program for the cnc machine. In C# I tried to make a simple on screen keyboard with only the keys I need. I use this command to send key
SendKeys.SendWait("{ENTER}");
or
SendKeys.Send("{ENTER}");
The first click works, but then the background program "takes away" the mouse after the click and then I can no longer control it. While such a problem does not occur on the windows on screen keyboard
Is there a way to avoid this, to make it work like microsoft osk?
Thanks

how to disable Keyboard inputs on windows like (temporary)

i have problem i'm trying to do new shortcut but if i put the shortcut i made F11 then will happen is full screen , i want to disable Keyboard inputs form windows or just disable the actions form windows i mean (if i press any key i want to put the action not windows put the action)
i create application that raises the volume , i put the volume up "F11" but in google chrome F11 is full screen, there anther application if i press F11 or F10 or F9 it do something and i dont want this happen.
i'm using Visual Studio Windows forms C#
note: my application work in background (i dont want use From1_KeyUp or Down i know this code)
Thank You for help
enter image description here
2 pictures
enter image description here
To prevent keys from reaching the target application you must use a low-level keyboard hook and return a non-zero value when you performed your own custom action.

WPF Application not opening when clicking on the Desktop Icon

I am developing a Wpf application. On installing my application, shortcut icons are created in the desktop and the program menu.
When i click the desktop icon for the time, my application opens. Now i minimize my application in the tray/task bar. On clicking my desktop icon, my application is not maximized. It still minimized in the tray/task bar. For ex, you can take a look at Skype, adobe reader etc..
Requirement - where ever the application icon is present in the PC such as desktop or program menu or etc., my application should be maximized when the user clicks the shortcut icon.
A desktop link will open a new application every time you click on it. If you want your application to open only once and change position/size of the original one once you start a new one, you will have to do this yourself:
Once you application starts, check if another version is already running.
Send your running application a message.
End itself.
If there was no other application started, run normally and liste for the message.
On arrival of the message, check if minized and if so, maximize (or change size/position to whatever you need).
Try to implement it and if you have a very specific problem with any of the steps, come to SO and ask a very specific question about it :)

Detect lock button press

I have been asked to make a morse code app using Windows Phone 7.
I need to be able to press the lock button multiple times to trigger my app to detect what sequence and timings have been pressed.
For example if I press the lock button on my phone (HTC Radar) five times I want my app (which would be running in the background) to detect that it has been pressed five times and at what timings so that I could figure out .- or "short / long" patterns then open itself up.
How would I go about this?
I have used XNA and C# for XBOX but not for mobile devices.
Thank you.
There is no API to solve your problem.
Your application can subscribe to the Obscured event. But this event does not mean that exactly lock button was pressed. It could be the SMS or phone call.
You can't do the background application wich will run all the time, and handle lockscreen button.

how to use console/windows app without focus on it?

im going to create a KEylog application that enables me to write all data typed(keys pressed) on a text file/database how can i do this without focus on the windows app/console app?
for a reason , for all you to know, this is for my PC and im not trying to hack an account.
just for me to know what they are doing on my computer.
Find an example written in .NET here:
Processing Global Mouse and Keyboard Hooks in C#
This class allows you to tap keyboard and mouse and/or to detect their
activity even when an application runs in the background or does not
have any user interface at all.

Categories