Display Numeric OSK - winapi

I know that to show OSK, all I have to is simply execute osk.exe. What I want to implement further is to use it in its numeric form:
E.g. I want to save one mouse click for the user.
Target OS is windows 10.
P.S. is there any other way to display the OSK?

Related

Retrieve clicked widget name in Tcl\Tk

I have a very big Tcl/Tk application with a lot of widget. In order to allow easy access to modify widgets configurations without having to type it in the console per widget/configuration parameter I want to build a dialog for that.
To do so I need an option to easily select the widget to be configured.
I thought to write a function which lets the user to click any widget in the application (any dialog) and retrieves the widget path.
Any ides?
You can convert a global-coordinate (e.g., from a <Button-1> binding's %X and %Y) to a widget name using winfo containing:
bind . <Button-1> {
set w [winfo containing %X %Y]
puts "You clicked on $w"
}
Be aware that this can interact quite significantly with other bindings! You may need to investigate using a grab (carefully; global grabs can cause trouble!) and configuring the -cursor in order to tell users what is going on. It's quite do-able, but some thought may be necessary to make it work the way you want.
(Did you know that winfo containing is a scripted interface to the functionality at the core of most drag-and-drop handling? It uses exactly the system for mapping positions to windows…)

Positioning mouse cursor on another Application's List item entry based on its text value

I want to do an automation using Excel VBA. First of all I am not sure if its possible so I need to explain the problem first.
I would launch an application which has a list of reports , that one can run by right clicking on any of these and selecting an entry from the popup menu caled say "Run this report". The problem is the report names are displayed in a listbox.
There are so many entries I only need to run a few of them based on their names.
To achieve this I thought about placing the mouse cursor on the text displaying the appropriate report name and then trigger the right click event. These can be done using Windows APIs.
The challenge I am facing is how to hover my mouse on any particular list item based on its display text.
I can enumerate all the windows controls based on the handle of the application's window, but is it possible to get the location of any item on the screen based on the text displayed on list item.

How to limit the amount of character in a textbox in vb 6.0

I am doing a registration system by using vb 6.0. I want for user to enter the mobile number. So I want the mobile number to be limited to 8 digits only. If the number is over 8 digits, when the user click save button, a message box will pop out to ask user to recheck the data again and it will not be save until the data is inserted correctly. What is the coding for me to do that?
Don't let your user enter more characters than allowed, then tell them later they can't do that. The TextBox control has a property you can access from the designer named MaxLength. Set that property to 8 to limit the use to a maximum of 8 characters. Better still would be to use the MaskedEditBox and use the Mask property to enter a mask that limits and formats the user input. To add a MaskEditBox you need to open the Components window and add the Microsoft Masked Edit Control 6.0 to your toolbox. You can then add the control to your form.

Select an item out of a combo box with a vbscript

I am writing a few tests in vbscript for an application that I am working on, and I need to select one option out of several in a combo box. Does anyone know how to do this? The way I am currently "selecting" the option is
Browser("main_browser").Page("main_page").WebEdit("teams").Set "Thunder"
This will make this field equal to "Thunder", but the application does not recognize this as the "Thunder" choice in my combobox, merely a string with the value "Thunder" that has been injected, so to speak.
By the way, I am using quick test pro as an environment.
Are you sure the combo box is a real combo box (a SELECT HTML tag)?
When QTP sees a select tag it identifies it as a WebList and not as a WebEdit as you listed. Then you can perform WebList.Select which does a native selection (and not Set). It could be that you don't have a read HTML combo-box, instead you have an edit-box that simulates a combo-box and then .Set just sets the text.
If you are unable to recognise the control as a WebEdit you will have to examine the HTML to see what event causes the selection of the field to change and use WebEdit.FireEvent in order to simulate a human's interaction.

How can I make a console-like textbox?

I am making a program called "BasicSys". It is a BASIC System simulator that uses a textbox for the console. So far I have everything working great but I need to have the text box act like a command prompt window. It needs to be able to ask for input and retreive the value without allowing the user to modify anything outside of the prompt space (the space where the user should only be able to type is after a ":" or a ">"). Some feilds are password feilds that require either no echoing or having the chartacters replaced by *'s. Is it possible to make a console out of a textbox?
P.S. I also want to know if there are any small BASIC v2 compilers for Win32 so BasicSys can compile and run BASIC programs.
Depending on how realistic you want it to be you can use the API to open a real console window and interact with it. There are many examples available that you can find by searching such as this one. My suggestion though would be to fake it with a multi-line textbox. It would not be very tricky. Set an index every time you draw the prompt, then as long as the cursor is positioned after the index the textbox is read / write. If the user scrolls backwards make the textbox read only. It should be fairly simple using the KeyDown event and setting the ReadOnly property True / False to get a passable "command" window.

Resources