How to move my form when on screen keyboard is shown - c#

Im trying some different alternatives for onscreen keyboard for our desktop application that is being run on a windows 8 tablet without keyboard.
So far Tabtip.exe have been working best but im open to other solutions.
The problem i have is when the user clicks on a textbox in the application and i show the onscreen keyboard, the keyboard hides the textbox.
How do fix this in a good way?
Is it something that windows can handle automatically? Some applications like outlook and word gets a "splitscreen" with a scroll bar in the upper part where the applications is and the keyboard in the lower part. I want a solution like that to. How do they do it?
One solution could be to always move my window up a set amount of pixels that is the same as the keyboard height. But i don't want to move the application if the keyboard doesn't cover the textbox.
But how do i determine how high the keyboard is? is it always the same height? How do i detect where the window is?
Any other solutions?

Related

Capture all Keyboard input, regardless of what control has focus in Windows Form applicaion

We are using the windows form application on a tough pad (touchscreen device).
want to show the on screen key board when user click the text box or any input control , rather then handling this event is there any way to handle this on the application level to show and hide the windows on screen keyboard
DevExpress editors, as well as regular .NET editors, do not affect OnScreenKeyboard's behavior. I suggest that you use one of the approaches described here to display it - Automatically pop up tablet touch keyboard on WinForms input focus.

Create a WPF Window that captures AND passes through Mouse Events

I'm working on a screen capture utility that captures active windows. I'm using transparent overlays to capture the full screen and then overlay the active windows based on mouse move events passed through to the underlying desktop/windows.
Both of the overlay windows currently use the WS_EX_TRANSPARENT style to allow mouse events to pass through to the underlying windows so I can detect where the mouse cursor is located. I grab the window handle and rect size to outline the window and then use Global Mouse and Keyboard Hooks to accept or reject a capture.
It's pretty ugly and spread out code (which is why I'm not posting here for now) but it all works very well and I can highlight the windows in mousemove and capture clicks with the global mouse and key handlers.
It all works except for this problem:
The Global Windows Hooks do not fire over an Admin Window so when I want to capture a Powershell, Command or Visual Studio (in Admin mode) Window no hook events are forwarded.
Apparently there's no way to work around this security issues using Windows hooks (or GetAsyncKeystate() for that matter).
I've tried a couple of different approaches to work around this issue:
Instead of using Hooks I tried using the highlight window to capture mouse/key events
This sort of works, but it's clumsy - fails if no window is selected at all (no way to get out) and doesn't allow for selecting contained windows once the parent is selected (ie. no drill down)
I also tried Win32 GetAsyncKeystate() which captures the last mouse or keyboard input and that would work, but it too fails to send mouse or key interactions from Admin windows.
So I have two choices imperfect solutions at the moment: using Hooks or GetAsyncKeyState to get the proper Window browsing selection behavior for all but admin windows, or I can capture all windows but lose the ability to drill into child windows after a parent window is selected.
I'm at the end of my rope and the real question is this:
Is there some way to create a semi-transparent or transparent window that can intercept mouseclicks and pass them on to the window area below?

Draw rectangular selection and get corresponding image in WPF c#

I need to write a text recognition (from image) application. The main idea is that while my application is running, I may have the need to transform some text of an image into manageble text. So, in this case with the mouse I need to draw a square around the area that i need to capture and the software must convert the content of the extracted picture into text.
I solved the problem of image recognition. I also find a very easy way to capture from screen.
What I need to do now is be able to select with the mouse the interesting area that is over an other running opplication (for example over a webpage or over an image opened in Paint). That must be like the screencapture on windows7, you create a selection of the screen and this is saved like a picture.
By looking around, I didn't find anything and I don't knwo where to start.
Many thanks
You can achieve that using either a 'tricky' easy way or a real but difficult approach.
The tricky way
Screen Recorder applications usually use this approach:
Whenever user wants to select an area, you display a full screen border less Window with 0% opacity, then user attempts to select the screen area, and he is actually selecting your Window area, so you can receive mouse events and display/draw a rectangular shape to show the selection area to the user.
In this approach, the program needs to know when to display the Window and when to hide it. This can be done by for example defining Hotkeys for capturing:
Program registers a hot key using RegisterHotKey to Windows.
User presses and holds that hot key
Program displays the tricky Window
User selects the interested area, program receives that area using mouse events of the tricky Window
User released the hot key and program hides the Tricky window.
The real way
Using this way, you need to set a message hook in order to receive mouse and keyboard events while user is interacting with desktop not your program. This is not an easy to accomplish approach and I recommend you the first one.

Disable onscreen keyboard using

I have a windows form in which I have a numeric keyboard. when user click on the text box my numeric keyboard appears.but the problem is I moved my application to a touch screen keyboard. when user clicks on my text box default touch screen keyboard appears.
Is there any possibility to close the touch screen keyboard on my application ?
You can't, it's a user preference as of now.
Similar question is found here
Is it possible in c# to show, hide, and manipulate the Windows 8 on-screen keyboard?
Please refer
http://social.msdn.microsoft.com/Forums/windowsapps/en-US/17d2486f-abbb-4352-9aaf-5a457128678a/touch-keyboard?forum=winappswithcsharp

Metro-style Appbar in fullscreen WPF program

I am currently working on a desktop C# WPF application where the goal is to make it look and feel like a "real" Windows Store App.
I want to add an appbar that should be shown when the user swipes up from the bottom. To do this in a normal app you just position your finger outside the screen area, and swipe up.
But if I do that in a fullscreen WPF program I don't receive any TouchDown or TouchMove events - probably because the finger is already down when entering the actual screen area.
I have tried with the Manipulation framework also, but same result here. Even when I hook directly into the message queue using WndProc or other hooks I get no events at all.
The funny thing is that I can see the "touch cursor" move around the screen, so at least something in the underlying framework is notified.
Does anyone have an idea how to do this?
p.s. It is not an option for me just to use a windows store app instead, because of hardware connectivity issues ;-)
You will need to keep track of the cursor location coordinates, and see when the cursor (swipe) starts at the edge of the screen and moves in. When that triggers (with whatever trigger you want, distance covered most likely) you can fire up your Appbar.
There was a similar question asked on MSDN:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/d85dcde7-839a-44d3-9f2a-8b47b947576c/swipe-gesture-and-page-change?forum=wpf

Categories

Resources