I have a C# application running on windows xp/7 where I'm using onscreen keyboard.
When the sound is enabled there is a delay which causes problems.
I would like to disable the sound.
How can I disable the sound through my C# application code.
Any ideas ?
You can disable it from registry
[HKEY_CURRENT_USER\Software\Microsoft\Osk]
"ClickSound"=dword:00000001 // Related Registry Key
You can use this code to change it
RegistryKey key = Registry.CurrentUser; //key gets the value = "HKEY_CURRENT_USER"
RegistryKey oskKey = key.CreateSubKey(#"Software\Microsoft\Osk");// This line opens the "HKEY_CURRENT_USER\Software\Microsoft\Osk"
oskKey.SetValue("ClickSound", 0); // Set the value of ClickSound to 0(disable) which is 1(enabled) by default.
I haven't tested it yet but you may have to restart osk.exe after this.
All you have to do is click the volume icon in the task bar, click mixer and adjust the slider for "On-Screen Keyboard" or click the speaker to mute it. It has to be running in order to show in the mixer window.
All you have to do is click the volume icon in the task bar, click mixer and adjust the slider for "On-Screen Keyboard" or click the speaker to mute it. It has to be running in order to show in the mixer window.
Brother it will effect other media sound also which we don't want,
You can disable it from registry
[HKEY_CURRENT_USER\Software\Microsoft\Osk]
"ClickSound"=dword:00000001 // Related Registry Key
You can use this code to change it
RegistryKey key = Registry.CurrentUser; //key gets the value = "HKEY_CURRENT_USER"
RegistryKey oskKey = key.CreateSubKey(#"Software\Microsoft\Osk");// This line opens the "HKEY_CURRENT_USER\Software\Microsoft\Osk"
oskKey.SetValue("ClickSound", 0); // Set the value of ClickSound to 0(disable) which is 1(enabled) by default.
I haven't tested it yet but you may have to restart osk.exe after this.
this worked for me like charm thanks a lot brother
Related
Is it possible in UWP to force it to open the On Screen Keyboard (osk.exe)?
For example, in C# it is possible using System.Diagnostics.Process.Start("osk.exe");
Doing the above in UWP results in compile error saying there is no Process namespace.
I know that in Tablet mode, if I programmatically focus on a TextBox, it will show up the OnScreen keyboard.
But is it possible when in Desktop mode?
Is there a way for touchkeyboard to appear in desktop mode?
Ref the document in Keyboard interactions
Depending on the device, the touch keyboard appears when a text field or other editable text control gets focus, or when the user manually enables it through the Notification Center:
(source: s-msft.com)
Note The user might have to go to the Tablet mode screen in Settings > System and turn on "Make Windows more touch-friendly when using your device as a tablet" to enable the automatic appearance of the touch keyboard.
So the touch keyboard can appear automatically in tablet mode when users sets the input focus to a text control by using touch input. However, this won't happen in desktop mode and in UWP, there is no API to open it programmatically by now.
To show touch keyboard in desktop mode, we need the user manually enables it by clicking touch keyboard button and users can see this button by checking "Show touch keyboard button" in taskbar.
You are welcome to submit a request for this feature through UserVoice and Windows Feedback Hub app.
I was able to Show/Hide the On Screen Keyboard in Desktop Mode using:
CoreInputView.GetForCurrentView().TryShow(CoreInputViewKind.Keyboard)
Code Sample:
.xaml:
<TextBox GotFocus="TextBox_OnGotFocus" LostFocus="TextBox_OnLostFocus" InputScope="Number"/>
.xaml.cs:
private void TextBox_OnGotFocus(object _, RoutedEventArgs __)
{
CoreInputView.GetForCurrentView().TryShow(CoreInputViewKind.Keyboard);
}
private void TextBox_OnLostFocus(object _, RoutedEventArgs __)
{
CoreInputView.GetForCurrentView().TryHide();
}
Additionally, you can control the keyboard type by setting the InputScope with values like: Number, NumericPin, Text, or others:
https://learn.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Input.InputScopeNameValue
I am writing an onscreen keyboard and would like to redraw my layout as soon as keyboard layout is changed.
Currently I call:
GetKeyboardLayout(GetWindowThreadProcessId(GetForegroundWindow(), NULL));
on every key press to find out if the layout has changed. It does not work if user changes the layout by mouse, until key is pressed.
I would like to know if there is any way to get notified
when the keyboard layout of the current foreground window is changed,
so I can redraw my layout as soon as the change happens.
There is a way ...
First you need to register your application to capture foreground window changes:
Use SetWinEventHook with EVENT_SYSTEM_FOREGROUND (and WINEVENT_OUTOFCONTEXT as it's .NET) for that.
If that happens: Use your GetKeyboardLayout solution for getting the current layout of that window.
Then use a local Windows Hook (you're probably using it low-level-globally for key captures) with WH_CALLWNDPROC and the thread of the new foreground window.
Listen to WM_INPUTLANGCHANGE messages to that window to receive changes to the layout.
(You may want to unhook/rehook after another foreground change)
It looks like the keyboard layout is stored here:
HKEY_CURRENT_USER\Keyboard Layout\Preload
When I changed keyboard languages, the order of settings there changed.
So you could possibly monitor the registry entry. Here's one way:
http://www.codeproject.com/KB/system/registrymonitor.aspx
I am trying to set my own hotkey combination for the action Edit.FindNext in visualstudio 2008 under:
Tools.Customize -> Keyboard
but these simply dont take effect, so as soon as i close the dialog my VS keeps working with the default combination: Ctrl + F3, and the one i set is just ignored, although its still set in the configuration.
restart didnt help.
Any ideas?
Thank you.
I found the problem,
i tried to set the Ctrl + Left Arrow for the find next action but the Left-Arrow can not be used in global as microsoft states:
The following keys cannot be assigned
to a command in Global: PRINT SCRN/SYS
RQ, SCROLL LOCK, PAUSE/BREAK, TAB,
CAPS LOCK, INSERT, HOME, END, PAGE UP,
PAGE DOWN, Windows logo keys,
Application key, any of the ARROW
keys, or ENTER; NUM LOCK, DEL, or
CLEAR on the numeric keypad; or
CTRL+ALT+DELETE.
so i had to set this to the texteditor context, and it worked.
Setting a hotkey in VS can be tricky. Be aware of the following: The same hotkey can be used for different things, depending on the context.
For example, it is possible, that you defined the hotkey for "Global", but for "Text Editor" your default hotkey is still registered and the new one might even be registered for something else in the context of "Text Editor". So when you enter your new hotkey, check out the Combobox "Shortcut currently used by", maybe it will show you what the problem is.
im writing a C# program for a Windowsce 5.0 Device (PSION Teklogix Workabout Pro G2).
The taskbar is set to autohide.
I can't disable it completely, because the user sometimes needs to access the start menu or may like to manually show or hide the SIP. And it should not be displayed all the time, because i'd like to use as much of the small display as possible.
My problem is: When the taskbar is minimized at the bottom of the screen and a user clicks somewhere on it (not the startmenu button), it will slide in and is shown correctly.
But if the user does not activate the startmenu (by clicking on the windows-Logo), the taskbar won't slide out again, unless the startmenu was opened once.
Is there something like an event or so, that i could send to the taskbar, so it hides again, without the user beginning to access the startmenu ?
The way I have done this in the past assuming you mean vanilla ce (standard shell) is to grab the handle of HHTaskBar and simply hide it ;)
I also disable the SipWndClass (just in case the keyboard is left open).
Where iEnabled = true (enter fullscreen), or false to show HHTaskBar: -
HWND hWndToHide = FindWindow(_T("HHTaskBar"), NULL);
if(hWndToHide) {
if(iEnabled) {
// Disable VanillaCE TaskBar
if(IsWindowVisible(hWndToHide))
ShowWindow(hWndToHide, SW_HIDE);
// Disable SIPWnd (On Screen Keyboard).
hWndToHide = FindWindow(_T("SipWndClass"), NULL);
if(hWndToHide && IsWindowVisible(hWndToHide))
ShowWindow(hWndToHide, SW_HIDE);
}
else {
// Enable VanillaCE TaskBar
if(!IsWindowVisible(hWndToHide))
ShowWindow(hWndToHide, SW_SHOW);
}
}
It shouldn't be too hard to translate this to .NET ;)
I am running Windows XP 64 bit. I want to hide the taskbar when I run my application.
I tried codes by searching the web. In all those, it hides the task bar. But the problem is, when i open a notepad and maximize it, it is not actually into full screen. Because the space where task bar was there is still blocked with empty space. I want it fit really into full screen mode.
If you like to replace the windows shell (taskbar) you'll have to change a registry key.
Changing the default shell (all users):
open regedit (start menu > run, and type in regedit)
go to: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon.
Change Shell from explorer.exe to your program path and name e.g. c:\myKioskApp\Kiosk.exe
Changing the default shell (only current user):
open regedit (start menu > run, and type in regedit).
go to: HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon.
add a new string value (Edit > New > String Value) called shell. and set the value to the path of the new shell e.g. c:\myKioskApp\Kiosk.exe
log out and log back in.
I've done this by making the application borderless, maximized, and setting it to be Topmost. Here's a perfect example from CodeProject.
As one of the commenters has said, replacing disabling Explorer and running your application might be the best way, security-wise.
You Can Hide your task bar by setting Following Properties of your C# Form.
WindowState : Maximized
FormBorderStyle : FixedDialog
on window 7 (or maybe higher) using FormWindowState.Maximized is wrong because the maximum size will be subtracted by Taskbar height but you can do this
this.WindowState = FormWindowState.Normal; // or default
this.FormBorderStyle = FormBorderStyle.None;
this.TopMost = true;
// do it here
this.Location = new Point(0,0);
var fullscreenSize = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
this.Size = fullscreenSize;