I browsed the web for a simplified keyboard for a project running on windows mobile, but I could not find anything good, so I tried to create one myself.
The basic problem encountered, related to which control use to realize the "keys", was: I need a control that:
- is clickable
- can contain text
- DOES NOT TAKE THE FOCUS
I made some attempt, and I found that the LinkLabel seems to be exactly what I need: it works.
Now, the question is: is that a good idea to use the LinkLabel to realize a touch screen keyboard, or this is the wrong approach?
I would like to avoid developing all the application with this keyboard, and then find some trouble when it will be "too late".
Honestly the "right" approach is to create an actual SIP (there's a sample in the WinMo SDK). Anything else and you have to deal with the focus issues you're already seeing.
Related
I love WPF but I'm in trouble.
Everything is very customizable but I didn't found anything valid for personalizing title Bar and Application borders.
I've understand that isn't possible to customize it directly because it's Windows that manage that, but otherwise I didn't found any valid solutions...
The only results that show up from google are using WindowChrome, but I think it's a VERY outdated solution.
Otherwise I only found THIS code snippet, but it is (for me, at least) a bit complicated to understand fully. Also, I've tried it but it doesn't allow to do some actions, like move window when maximized, but a lot of application (done in WPF) that I saw daily are able to do that.
In final word I can't find anything good.
I think WPF is very used even today, and I really don't understand how they do good looking solutions, that doesn't involve using a 2009 library.
You should get started with the docs. That sample you linked to will make more sense after that.
Basically, you are asking OS that you own the entire region and will take care of ensuring everything continues to behave as expected.
So far, the best language that I have known for this case is C# but I'd love to know if other languages can do it. I need to plug multiple mouses to the computer and handle their events separately.
for example:
Mouse1.MouseDragged() will move the cursor.
Mouse2.MouseDragged() will make a sound or print something and NOT do what Mouse1.MouseDragged() does.
I know there is a Microsoft Multipoint SDK but I cannot seem to make it work.
The rest of the applications out there for Multiple Mouses are for WinXP so I cant make them work.
Any suggestions? thanks.
After a very long research i found my solution thanks to Hans Passant comment.
What i did was creating a small Win32 App in Visual Studio to catch raw input from Mouse and Keyboard using Windows.h and i simply make it send keystrokes whenever i drag a specific mouse.
i still need to solve many problems, but so far it works.
Thanks a lot
I'm writing a small c# program, I don't want the final user to take screenshots while using my program, is it possible? Or even if he takes one, how can I know it?
Thanks in advance and sorry if this is a poor-content question due to my lack of experience in c# coding.
You can create a system-wide keyboard hook using the low-level keyboard filter and cancel any printscreen keyboard combination. But if someone has also installed a helper application (like Gadwin or something) it'll become a lot more difficult because you won't know beforehand what keyboard shortcut you should catch (most tools allow to specify your own hooks).
Here's an article on using hooks in C#
and here's a ready-made keyboard hook library for .net that uses global mouse and keyboard hooks (use Google to find more freeware and commercial libraries and tools).
On a side note: it's generally not preferred to change the system behavior. Screenshots are system behavior and serve a distinguished purpose for trouble shooting. If you prevent this, users will not be able to show you a screenshot of something wrong. But if you must do it, you can do it.
EDIT: on a deeper level, you can install an API hook. All screenshot applications use API calls to get the content of a (part of) the screen. But API hooks are hard to get right. A more trivial way is probably by writing a user-level driver. While you can prevent all this, it is really worth all the trouble?
You might want a keyboard hook. But it'll tell you if the user pressed the "print screen" key, not if someone programmatically take a screenshot using some GDI function.
I doubt it's possible to prevent all the ways of taking a screenshot.
General answer: No. It's not possible to detect this - especially from C#. There are dozens of ways to take screenshot and even applications written in C++/WinAPI can only detect some of them, but not all.
Also consider - what if user is running your app in virtual machine? He'll be able to take screenshots at host machine and you can do absolutely nothing to detect (not even prevent) this.
Overreaching amateur developer that is outsourcing some of my work and doing part of it as well. I've been working on a dictionary/ thesaurus / spell check & suggestion application that I am trying to get to work on all applications within the windows environment.
I've used hooking to get key stokes and show output as the person is typing for definitions and spelling suggestions. This isn't accomplishing everything I want. Works fine for spell checking and suggestions but to click on a word that already exists or for touch screen interfaces to touch a word it doesn't work.
I was reading the Raw Input API on MSDN and thought that would work but my developer that I've hired is advising me that the RAW input's scope is only on the window that has focus and so cannot do low level hooking. I'm considering giving the effort but wanted a 2nd third fourth perspective prior to making the effort.
MSDN Reference: http://msdn.microsoft.com/en-us/library/ff468896%28v=VS.85%29.aspx
Hope all the background info doesn't take away from the question. Appreciate your insight.
Regards,
John
Yes, he is right. RawInput messages (WM_INPUT) are only generated for the focused window. Maybe you can somehow work around that, but this is not the main problem.
RawInput really gives you, as it's name says, the raw mouse data. This data is only relative mouse-movement or mouse-delta data. The values are still fed into the message when the mouse reaches the edge of the screen, and most importantly for your case: it doesn't give you pointer ballistics (for some explanations on pointer ballistics see this article: http://msdn.microsoft.com/en-us/windows/hardware/gg463319 ). This makes it pretty impossible to determine the actual cursor position.
You could now try to simulate all this behavior, and simulate the cursor position, but pointer ballistics are not the same on different versions of windows. XP has different behavior than Vista, and I think they changed the formular again in Windows 7.
The API suggests, that there are devices, that give you positional instead of relative data, but I've never come across a device that exhibits this behavior, not even touch screens (although this is probably driver dependent), and it certainly doesn't work for a standard mouse.
I'm still learning C#, and I know don't know about WinForms yet but I will very soon. However I want to know how I would create an application which shows a customized notifier, like Growl on a Mac. Here's a mock up:
http://img25.imageshack.us/img25/3793/41151387.jpg http://img25.imageshack.us/img25/3793/41151387.jpg
Could anyone point me in the right direction? And I know I should learn more about C# before trying this, but I've always liked to peek on complicated stuff.
Take a look at this third-party WPF NotifyIcon control, I think it does what you want out of the box, hopefully something like this will be part of WPF in the future. I have used this one before for the exact same reason, and it is really good: you can use standard tooltips or "toast" popups, or create your own which could be just like the one in the example you posted if you wanted.
WPF would be a great place to start. you can make UIs in pure XAML without even touching C#
Here is an example of an "notification" implementation using WPF
Here are some reference links:
http://en.wikipedia.org/wiki/Windows_Presentation_Foundation
http://windowsclient.net/wpf/
You should probably look into WPF (Windows Presentation Foundation) to design some of the nonstandard UI stuff.
However, I would recommend becoming familiar with UI design in general before diving into nonstandard stuff.
Since you are starting from scratch, I would consider learning WPF rather than Winforms.
Here are two examples are a pop-up notifier in WPF:
WPF Taskbar Notifier - A WPF Taskbar Notification Window
PopUp window on a specific time in WPF?
WPF is Definitely what you are looking for if you want something like the image you provided. My project uses notification popups similar to that in the screenshot. Its really simple to get the wanted results after looking at a few samples of others who have done it. If you would like some help, you can send a message my way.