I have a fullscreen application running on Windows CE 6.0 which will only be manipulated using the finger or a stylus.
So I don't need the mouse cursor, which I'm hiding using Cursor.Hide().
However, when I use the stylus to manipulate something on the screen, the mouse cursor is printed while the stylus touch the screen.
Is there a way to make the cursor not show when touching the screen?
BTW: the application will be the only thing running, so system-wide solution are possible, but I'd rather keep it inside the application.
For a system-wide solution, in case you can create the OS, you can remove the mouse cursor component from the catalog (SYSGEN_CURSOR).
For a local solution here is a suggestion (never tried it):
You can replace the icon with a blank icon so you won't see any cursor while inside your form. Once you leave the borders of your form you can restore the usual icon.
Read How to use custom cursors. I checked that the Cursor class is available with the CF. There are two other functions needed to be P/Invoked that are available under CE:
GetIconInfo
CreateIconIndirect
Related
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?
Is it possible to hide the mouse cursor in a Windows 8.1 Store App and move the mouse back to the screen center while moving?
something like this (SDL code):
SDL_ShowCursor(false);
...
SDL_WarpMouse(screen.width/2,screen.height/2);
Moving mouse pointer automatically to center is not possible in Windows app. It is avoid fooling/cheating (not the right word, but still close enough) users in app. For example, if a developer is allowed to do so then just before the click of the mouse button developer can always hide the mouse pointer from that place and move it to desired position and get ads clicked, even though user didn't wanted to do so!
This also goes well with Windows 8/8.1 app design principles, that apps can use limited resources of the system.
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
I need to create a application which is similar to those we will get when we buy a laptop. It will be visible only when the mouse pointer reaches the top of the window. So how can I able to do this using C# 4.0 ?
http://www.notebookcheck.net/uploads/pics/win2_12.jpg
this link u can see the application. I need to create such type
Any idea pls share. Thanks
I suppose there are several different ways to achieve this effect:
You can place part of the window of your application above the visible screen, so only a part of it is visible (let's say you can see only it's bottom). Then you need to handle events when mouse enters (MouseEnter) and leaves (MouseLeave) the form to move the form up and down.
You can use a background thread to call GetCursorPos method at a set interval (i.e. each 500ms) second to check where currently the mouse is. See this link for more information about it and a sample code: http://www.pinvoke.net/default.aspx/user32.getcursorpos.
(If you need only to check the mouse position, you can use a timer to simplify you application.)
When you hit what's possible with C#, you can always start invoking native code - such as the windows API. Since you don't ask a specific question, I'll leave you with:
Position your app where you want it to appear and hide it.
Capture mouse position with windows api (see this SO answer)
When mouse is at screen corner / top, etc; make your app visible.
Now make sure all this works with dual screen setup, and you are done.
I have a form with a Transparency-key color, where I'm doing a global mouse hook for the right click.
Until there everything is okay, but since the form is transparent, the mouse cursor is changing according to what is behind the form.
Is there any way to change the global mouse cursor?
Yup, that's how transparency works. Not just to the eye of the user, also to what the mouse sees from its left eye. Has to work that way, major user confusion if it didn't, no option to change it.
The workaround is to show a fake version of the desktop. A screen shot. Just what the ever popular Windows Snipping Tool does. Sample code is in this thread.