WSR Show Numbers - c#

In Windows Speech Recognition (WSR), there is a command called "Show Numbers" that pulls up transparent boxes over every clickable item on the active window.
I'm not looking for a full program but more of what identifies clickable items on an active screen, if something like that even exists. I hope this question makes sense. Thank You! If it's important, I'm using c#.

While I'm not familiar with WSR, UI items can be identified through the UI Automation framework. It's able to see controls on windows and able to interact with them. The primary intent is for accessibility purposes(Screen readers and the like) but it has also been coopted for UI Automation tasks and is the backbone behind portions of the Coded UI Framework. http://msdn.microsoft.com/en-us/library/ms747327.aspx

Related

How to get tab order of wpf application

I am working on some UI automation for verify tab order of our WPF application. I was wondering if there was a Windows API or UIA API for getting the current tab order of the application under test. My UI automation is written in C# but I am more then willing to do some pinvokes to make this work.
Here is some clarification based off of #CodyGray's comment. My company's has certain tab orders that we want to rarely change if ever because our users are so used to these tab orders as part of their workflow (they operate the user interface faster than it can update via these tab orders...). The current way I am doing this is through keeping a list of the tab orders then using SendKey to tab and check which control has focus. I then double check if the focused control is the control I expect it to be from a hard coded list. I would prefer to actually ask the application what it's tab order is going to be instead of using SendKey which could send tabs to the incorrect window based on what has focus.

Transistion from Winforms to WPF MVVM

I have a program that at its heart is just a fancy Keyboard hook and wedge. The keyboard hook portion is a separate library from the main program. In the main program I gather all the keys that i want to monitor from a config file and instantiate the keyboard hook. The keys that I am monitoring have tasks that they can perform when the key is pressed and/or when it is released. (Tasks such as open a program, turn on a scanner..etc) Since the project started in Winforms I felt that it would be a good idea to make a folder in this library called Controls. I made a dialog Form that a user could select what task they wanted to perform. There has been a need for me to switch from Winforms to WPF. So it is nothing to add Winform controls to a class library. From trial and error it appears that doing the same thing for WPF user controls is a different story. So I decided it would be easier to just created a new WPF Usercontrol project. (If it is possible can you please leave a comment about how to?)
So I am new to WPF, and decided that this particular library would be good to use the MVVM pattern to get my feet wet. It is small in that I only have 6 subclasses of Type AbstractTask. Part of me is itching to use Abstract Task my Model. I'm not sure how yet, but I think that it is my Model. I'll have to add a description string field to it for my View, but that shouldn't be a problem. Since atleast one of my Tasks needs extra information (such as RunProgramTask) I figure I should also put a ?Action? in to "verify" that all the correct information is given. again.. that should be easy.
So in the end I have 2 questions.
Does my theory comply with the MVVM pattern?
Should I move all my Hooks and Tasks and such over to the new WPF project and delete the old project? Or should I just delete the Winforms controls out of my library and just imagine that it is one project?

Read item being dragged by mouse

I'm wondering if their is any way to see what's currently being dragged by the mouse. I don't mean over a winforms as i can handle events and get it that way but has anyone been able to invoke some of the win api to read the object or information about it?
I'm trying 'monitor' (probably not the best choice of words) the cursor and see whats being dragged and then potentially read that object.
C# / C++ idea's all welcome !
Thanks in advance
One way to do this by design is to inject code into all applications, by means of a hook.
Using Hooks (Windows): http://msdn.microsoft.com/en-us/library/windows/desktop/ms644960(v=vs.85).aspx
This will allow you to detect when dragging is occurring, and you can use the standard windows APIs that the application itself can use to find out what is being dragged.
SetWindowsHookEx: http://msdn.microsoft.com/en-us/library/windows/desktop/ms644990(v=vs.85).aspx
A second way is to use Windows UI automation. This will not give you exactly what the application sees, or give you access to the exact data being dragged or dropped, but it may give you enough information for whatever your purposes are.
UI Automation support for drag and drop: http://msdn.microsoft.com/en-us/library/windows/desktop/hh707386(v=vs.85).aspx
Try using UISpy or Inspect.exe to see UI Automation events.
https://stackoverflow.com/questions/1848721/where-do-i-get-ui-spy

What is raw code of textbox

May be i can get some negative points on this question but, really this question is boggling in my mind from last many days that what is the basic/raw code behind textbox(or other such controls).
i mean i understands that, we can inherit the textbox class and make our changes, we creates its object and use it.
but wants to know how that class creates a textbox(the design which allow us to enter text) (same query for other components), is it a code of 'C' language which are generating it using CG (computer graphics) programming or any other thing.
Experts please resolve my curiosity.
Thanks
Windows provides several basic API's for drawing on the screen. You can draw pixels, lines, boxes and more complex geometric shapes. There are also API's to draw text. Other API's allow you to react to user input, e.g. mouse movement and clicks and keyboard input.
From these basic API's you can create your own text box by drawing the exact pixels of how the text box should look and react to user input. However, Windows has a built-in concept of a text box. This text box has a standard look and feel and is also integrated with UI concepts like focus, tab order, the clipboard and the caret. But behind the scenes Windows is using the low level API functions to draw on the screen and react to user input.
When you create a TextBox in Windows Forms it actually creates and wraps a standard Windows Edit control. This control is drawn using GDI. However, other programming models like WPF may create TextBox controls that looks like a normal text box but uses a custom implementation supplied by WPF and is drawn using DirectX.
Use http://www.red-gate.com/products/reflector/ and see for yourself...
Here is what I think it is doing:
The Raw code behind TextBox or any other Control uses Windows API that is responsible for drawing these controls and provide Handles of these controls for later reference.
Windows has been using different methods to draw it's UI like GDI, GDI+ and sometimes DirectX. I may be wrong and there may be some other techs I forgot to mention.
These controls use each window's WinProc to receive Input Notification and other callbacks that notify these controls when clicked, typed or for example resized.

What C# / Win32 Control Is the Wireless Network Dialog Using?

I'm working on an application, and I have a screen that in my mind, looks a lot like the Wireless Network List in Windows Vista. For those who are unaware, its basically a listview, but in each row, instead of a line of text, there's a large 'panel' that contains all sorts of useful information. Does anyone know if that's an actual UI control available on windows, or should I roll my own with some sort of autosizing table layout panel hosting a collection of custom controls?
I know this is pretty easy to make using WPF using the stackpanel layout along with a series of user controls containing grid controls for internal layout. Or are you using windows forms?
The wireless network dialog isn't using a standard Win32 control, it's using a custom control (effectively).
If you want to emulate that behavior, you're going to have to use WPF or roll your own.
Not an exact answer but you may want to look at the various Vista TaskDialog libraries and dialogs that have been based on that. You may be able to borrow some of the code since they share some UI functionality. I need to do the something similar with WPF.

Categories

Resources