-
mini osk at windows login for Vista?
I just got finished writing a mini on screen keyboard for the xp login screen.
Does anyone know if this will be easily possible with Vista, or 7 ?
If not, what are the hitches?
I was beta testing 7 until recently, so I don't want to waste time re-installing it for no reason.
-
Re: mini osk at windows login for Vista?
Hey, great seeing you again! :wave:
If it was possible with XP, then it should be with Vista - not sure about the implications though. There may be some differences with the API calls used ( as we have established in some of your earlier projects ). Otherwise you can post it here ( if you want ), and we can help test and identify the issues we encounter. :)
-
Re: mini osk at windows login for Vista?
Hello Hannes,
Yeah, I'm back from a 3-4 month stint.
Working on the next generation of human to computer input devices and all.
Button-less mouse.
This project is really awesome, and helpful.
It includes my newest SendKeys module as well.
Basically it's a USB device that uses laser emitters, to detect hand or foot movement.
It was originally designed to help the handicapped, with shaking disorders, or amputees missing fingers, hands, or arms.
However, gamers and online Virtual realities(WoW, SL...) can also use it,
since you can set the laser triggers to just about any sequence of keyboard/mouse strokes or combos.
Oh, and then I added other available events like Delay, SnapToWindow(mouse), and WaitFor different things to happen first before moving on to the next event in the chain list.
Regular users can now automate almost anything.
Sure, wannabe hackers could use it too, but that does not justify keeping the handicapped, handless anymore.
The mini osk, is just icing on the cake, so that they don't have to switch between a normal mouse, and a virtual one during logoff-in.
Nifty auto-login feature too.
I guess my question is more specific to windows services.
Is it not hard to get a windows service with user interface, to show up in the login window?
While on the subject of keyboard input, here is a little tid bit that comes in handy for osks:
Code:
Const HWND_LASTACTIVEWINDOW As Int64 = 8975651603260375040
Private Declare Function apiSetActiveWindow Lib "user32" Alias "SetActiveWindow" (ByVal hWnd As Int64) As Int64
apiSetActiveWindow(HWND_LASTACTIVEWINDOW)
I guess there are some API's that really should be used with 64 bit in mind.
You could use Longs too, but then you'd get flamed for it. lol
This is somewhat a rare exception, and it doesn't even match it's own description.
Quote:
The SetActiveWindow function activates a window. The window must be attached to the calling thread's message queue.
I wasn't aware that the last window was attached, since you always must use AttachThreadInput for external windows. Hmmm. Cool.:thumb:
BTW, I'm using a mouse hook to avoid focus from even reaching my osk.
However the titlebar must accept focus, so I call the SetActiveWindow API, only when the mouse enters the client part of the form.
Button presses never recieve the mouse down, so it's smooth like the real thing.
I guess I'm on the right track using motion detection to control a PC.
It just made total sense to me.
http://news.cnet.com/8301-13860_3-10...eadlinesArea.0
Video:
http://www.youtube.com/watch?v=AgWUtw0sbro
However, the microsoft camera design lacks the ability to help handicapped with mobility impairments, like mine has.
At least, as of now.
-
Re: mini osk at windows login for Vista?
Okay, well I just tried to install the osk service on Vista.
It doesn't want to run the service, unless you manually use InstallUtil.exe.
Then the service runs on boot, but does not show it's user interface.
Apparently, it's not so easy. Jeesh, I wonder why.:confused:
The main osk works on Vista though.
I would like to get some beta feedback, from Vista/7 users.
DOWNLOAD
http://www.mediafire.com/?uimmenifizh
If you have xp, and would like to try this on screen keyboard(BETA), then it should work with no problems.
By default, the option for installing the osk on boot, is unchecked, so you will have to check it.
There is a hidden benefit to using it, besides the obvious keyboard functionality.
When you are at the welcome screen(boot), the system is logged on.
This program has a couple extra features, that allow you to open the task manager, msconfig, or launch any other program using ShellExecute.
This is great for killing some of those spywares or viruses before login.:thumb:
I took a screenshot of the welcome screen.
I put it on the systems desktop, and the computer could not find it at all, when I was logged in, as a user or admin.:eek:
So, I went back into the welcome screen, and sure enough, there it was sitting on the systems desktop.
I copied over to my desktop, and here it is:
http://c1.ac-images.myspacecdn.com/i...1cfef91420.jpg
Installed files
Service name: LOGONCMD.EXE (IBM Touchboard in the ADD Remove Programs list. xp only)
Service Application: TOUCHBRD.EXE (vb6.0 for speed and reliability during logoff.)
Main Application: OnScreenKeyboard.exe
Minor Application: OSKMini.exe
MS Voice packs: Sp5TTIntXP(ADD Remove Programs. xp only)
-
Re: mini osk at windows login for Vista?
Correction,... it is pretty easy to start up a custom osk with Vista/7(32-64 bit)
All I had to do, was go into the registry path:
Code:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Accessibility\ATs\osk
You must change permissions of the key, which means also taking ownership first.
Then you can modify the reg key's path to start your osk instead.
I assume you can start any app by re-directing that path.
However, I still must navigate to the accesibility options(bottom left) at the welcome screen.
My regular windows osk, does not show up unless you coax it. Common little buddy,... I said start up.
I've read that some people, can't get rid of the osk, and some have to hunt for it.
Sounds like a small bug, because when I clicked apply she says cancel instead.
EDIT UPDATED:
There is an administror setting hidden in the accessibility section, to apply to all desktops or something.
That's why people have to hunt for it, and some accidently turn it on, and can't get it off. heheheh
Might as well have a laugh, for everytime that kind of thing happened to me. Uhhg
In fact I only just recently found that hidden checkbox, all by itself, on some other page off to the side of the config area.
I really hate the Vista/7 hair-brained control panel.
For example, I didn't know that you can click small or large icons, and THAT brings me to a more classic look.
I would have expected just small or large icons that are currently showing. Not an entirely different view.
Who was the idiot behing the keyboard sleeping, when that was written?
The following registry key turns the osk on/off boot.
On
Code:
Dim regkey As Microsoft.Win32.RegistryKey
regkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion\Accessibility", True)
regkey.SetValue("Configuration", "osk")
regkey.Close()
Off
Code:
Dim regkey As Microsoft.Win32.RegistryKey
regkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion\Accessibility", True)
regkey.SetValue("Configuration", "")
regkey.Close()
The pointer to the osk, resides in this key:
"hkey_local_machine\software\microsoft\windows nt\currentversion\accessibility\ats\osk"
You can change the osk executable being pointed to like this:
Code:
Dim regkey As Microsoft.Win32.RegistryKey
regkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion\Accessibility\ATs\osk", True)
regkey.SetValue("ATExe", "osk.exe")
regkey.SetValue("StartExe", Environment.SystemDirectory & "\" & "osk.exe")
regkey.Close()
You need to have full administrative access to this key before setting it.
You may need to gain ownership, in order to get full administrative access to the key.
Post 12 offers possible solution
___________
-
Re: mini osk at windows login for Vista?
Comments from an XP user:
Quote:
It works fairly well. Main problem: the keyboard appears and works for the password but then does not appear after startup, even when I click on a test entry field.
-
Re: mini osk at windows login for Vista?
Hey thanks for having tested.
I've got one questions.:)
Did the main app, appear in the users startup menu?
Did it run at all during a session? Manually started from the program list.
Some security programs may prevent it from being placed in the startup menu. I'd have to respect that.
If not, then I'll have to kill off the mini osk, so that the main osk can load/run without issue after logging in.
They must be interfering with each other.
Works fine here, but that's why I wanted to test on other machines.
Vista beta soon,
Shane
-
Re: mini osk at windows login for Vista?
I killed the VHD of Windows 7, and so did the my tester, so I can't test it, yet. I will after August 6th, when I get the new bits. I'll try it on the old hard drive after I back it up. I'm running RC right now, but it's my production machine.
-
Re: mini osk at windows login for Vista?
Thank you.
I'll slate the beta for august.
Plenty of time to work things out.
I've been on quite a few wild goose chases, trying to find out how to programmatically take ownership of a registry key.
Mainly because Vista/7 uses TrustedInstaller, as the default owner, even though admins are fully allowed ownership!
If you do not take ownership, then some registry changes will throw an error, even for admins.
I couldn't get the framework or API to work, as legend has it.
No clear full examples online either.
If anyone can figure out a solution with the framework, then you get 10 brownie points from me.
An API solution would involve RegSetKeySecurity.
A Framework solution would involve,
Code:
System.Security.Permissions.RegistryPermission
System.Security.Principal
System.Security.AccessControl.RegistrySecurity
But, I found a reliable solution, using microsofts subinacl.exe.
http://www.microsoft.com/downloads/d...displaylang=en
You may take ownership only if you are logged in as a user/administrator.
Add subinacl.msi to your project.
You may have to change the .msi extension, so that the IDE accepts it as a file, then rename it(.msi) when the app opens.
I changed mine to subinacl.msi.exe.
Example(take ownership and full control over Vistas registry key for the on screen keyboard):
Code:
Public Class Form1
Private progFiles As String = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
RenameFiles("subinacl.msi.exe")'Take off the dummy extension
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TakeOwnership("hkey_local_machine\software\microsoft\windows nt\currentversion\accessibility\ats\osk")
Threading.Thread.Sleep(0) 'Ownership may take a second or two, so full control would fail, if you are not the owner yet.
TakeFullControl("hkey_local_machine\software\microsoft\windows nt\currentversion\accessibility\ats\osk")
End Sub
Private Sub TakeOwnership(ByVal keyName As String)'Take what's rightfully yours
If IsSubInACL() = False Then Exit Sub
keyName = """" & keyName & """"
Process.Start(progFiles & "\Windows Resource Kits\Tools\subinacl.exe", "/verbose /regkey " & keyName & " /setowner=builtin\administrators").WaitForInputIdle()
End Sub
Private Sub TakeFullControl(ByVal keyName As String)'Take full control after you are the owner
If IsSubInACL() = False Then Exit Sub
keyName = """" & keyName & """" 'Wrap in quotes otherwise "windows nt", will fail because of the space.
Process.Start(progFiles & "\Windows Resource Kits\Tools\subinacl.exe", "/verbose /regkey " & keyName & " /grant=builtin\administrators=f").WaitForInputIdle()
End Sub
Private Function IsSubInACL() As Boolean 'Make sure it's installed if not then do so quietly
If IO.File.Exists("subinacl.msi") = True AndAlso IO.File.Exists(progFiles & "\Windows Resource Kits\Tools\subinacl.exe") = False Then
Process.Start("subinacl.msi", "/quiet").WaitForInputIdle()
End If
For i As Int32 = 1 To 4
If IO.File.Exists(progFiles & "\Windows Resource Kits\Tools\subinacl.exe") = True Then
Threading.Thread.Sleep(400)
IsSubInACL = True
Exit For
End If
Threading.Thread.Sleep(1000)
Next
End Function
Private Sub RenameFiles(ByVal fName As String) 'Strips dummy extension off
If IO.File.Exists(fName) = True AndAlso IO.File.Exists(fName.Substring(0, fName.Length - 4)) = False Then
FileCopy(fName, fName.Substring(0, fName.Length - 4))
End If
End Sub
End Class
While on the subject of Vista ownership, I found a sweet little tool to take ownership of folders.
This avoids the annoying Vista permission errors for administrators.
It adds the item: Take Ownership, to your right click menu.
Written for regedit:
Code:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\runas]
@="Take Ownership"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\*\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="Take Ownership"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
Remove it from your right click menu:
Code:
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\*\shell\runas]
[-HKEY_CLASSES_ROOT\Directory\shell\runas]
Cheers :wave:
-
Re: mini osk at windows login for Vista?
I'm logged into Win7 RC(32-bit) now, and both osks are working perfectly!
Found a large bug, yet not critical with Win7 RC(32-bit).
The "minimize all" button on the lower right corner needs to be re-written.
Problem:
If a window has "border style none", it messes up the entire process, leaving some windows showing, and some not.
Then if you try to manually minimize the left behind windows, they cause the already minimized windows to be restored to normal. Huh?
Exactly backwards of what was intended.
Then non-related windows toggle each others window state.
Overall, I'd have to give Win7RC a grade of B+.
It's much snappier than Vista so far, and the visual haze is much clearer.
I rarely ever see the infinite circle,.....looping endlessly....
I didn't like the default permission settings, which are a touch worse than Vista.
I could not download things where I wanted to, without jumping through extra hoops.
The control panel is now more miss-organized and miss-categorized than ever before. And there is no classic style this time.
I wouldn't even call the old style classic, it's just one that worked logically.
In closing Win7 is the first real operating system since xp, but it's got it's quirks.:)
-
Re: mini osk at windows login for Vista?
Hey, just discovered a new RunAs. Just highlight the .exe, and hit cntrl-enter!
Works in Win 7 as well!
-
1 Attachment(s)
Re: mini osk at windows login for Vista?
Hi TT(n)
Nice work !
Love the Setup Options
Recently completed one myself in VB6 (not as commercial as yours)
Is there a way of launching the OSK from within a program ?
ie, Click a Button - eg, "ON SCREEN KEYBOARD"
Works well from a Quicklaunch shortcut (which will do nicely if its not possible any other way)
I would also need to have .Net Framework Installed - which version is minimum ?
Many thanks
-
Re: mini osk at windows login for Vista?
Hello George,
Thanks for the feekback.
Quote:
Love the Setup Options
The setup options are pretty handy huh.
Especially the Nothing Beneath option, which works better than AlwaysOnTop.
Although you could use both at the same time, you'll find that the osk takes up it's own unique piece of real estate,
and so AlwaysOnTop rarely applies to begin with.
This avoids other windows overlapping the keyboard(vica versa), which make it harder to interface the computer.
Quote:
Is there a way of launching the OSK from within a program ?
ie, Click a Button - eg, "ON SCREEN KEYBOARD"
Sure, in Vb6 you could launch the osk with the Shell("path", vbNormalNoFocus ) function.
In .net you could use Process.start("path")
Many other ways I use too.
I think that was what you were asking, but if you need more specifics let me know. For example if you need help obtaining the path or something.
Quote:
I would also need to have .Net Framework Installed - which version is minimum ?
This was written with VB.NET 2005, so .NET framework 2.0 or higher.
I don't recommend 3.5, as it slows my machines way down, and causes all sorts of side issues and glitches.
Ironically, I ended up re-writing a vb6 version of the mini osk, just in the last few days.
.NET apps, are just not capable of smoothly handling the windows bootups, and logoffs.
vb6 however has such a low overhead that the window immediately responds to exactly
what it is supposed to be doing. Not some wonky .NET behavior.
It's not a question of doing things right, the .NET way either.
Even basic .NET apps(hello world) will have irratic behavior during the boot processes.
vb6 is the smart, reliable, stable solution in this isolated case, and not some fall back crutch.
Good programmers will know this, and know when to occasionally
rely(not resort) on vb6 as a professional, when appropriate.
Quote:
Originally Posted by
George1111
Hi TT(n)
Recently completed one myself in VB6 (not as commercial as yours)
Many thanks
Looks pretty good.
How are you handling the mouse presses and keyboard focus?
----------------
-
Re: mini osk at windows login for Vista?
Quote:
How are you handling the mouse presses and keyboard focus?
I actually included the keyboard within my application (so it only comes into play with certain screens) - used in a Tablet or Touchscreen Environment
Wish I could have designed one like yours, but its all about time (and in my case, ability)
Thats where yours is far superior (than mine) - works just like the XP Tablet PC keyboard, but more featured.
-
Re: mini osk at windows login for Vista?
Quote:
Is there a way of launching the OSK from within a program ?
ie, Click a Button - eg, "ON SCREEN KEYBOARD"
Quote:
Sure, in Vb6 you could launch the osk with the Shell("path", vbNormalNoFocus ) function.
In .net you could use Process.start("path")
Many other ways I use too.
I hunted for OnScreenKeyboard.exe but cant find it
What is the program called and where is it installed ?
-
Re: mini osk at windows login for Vista?
Ah, yes where does .NET install it's programs.....
You won't find them in the program files folder. lol
First thing to do, is go into your control panel.
Then you click Folder options.
Then click on the View tab.
There is an option for "Show hidden files and folders"
Now that you can see hidden folders (not hidden by me BTW).
Navigate to this path on XP:
Quote:
C:\Documents and Settings\YourUserNameHere\Local Settings\Apps\2.0\
.NET does let you get the bulk of that path with:
Code:
Dim locSet As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
locSet = locSet.Replace("Application Data", "Apps\2.0")
MessageBox.Show(locSet)
Here is where it gets cryptic, the end of the path may vary depending on the computer, mine is:
Code:
C:\Documents and Settings\John\Local Settings\Apps\2.0\Q8JJDDY9.AJO\C3OX9B17.LBH\opti..tion_df839ceb162d241b_0001.0000_7ede6352c32b4323\OnScreenKeyboard.exe
Programmatically, this requires an extra step to search the sub folders of the 2.0 folder, for OnScreenKeyboard.exe.
If you need that code, I can dig it up.
Unless you want to just move the folders content out of there, so that you can include it in your apps folder or whatever.
Feel free, it was just beta, and I'm not opposed to anyone using it in a project.
Vista and 7, navigates through the Users folder, instead of document and settings.
________________
-
Re: mini osk at windows login for Vista?
I clicked START, typed OSK, and it found OSK.EXE in C:\Windows\System32
-
Re: mini osk at windows login for Vista?
Quote:
I clicked START, typed OSK, and it found OSK.EXE in C:\Windows\System32
Sure, but we were talking about where .NET installs it's applications by default.
That is in the Users folder in Vista/7.
It's helpful to others, that may not know where their installed(.NET) applications are actually located.
______________
-
Re: mini osk at windows login for Vista?
This is the path on my machine
C:\Documents and Settings\MyUserName\Local Settings\Apps\2.0\9A62PBTM.N38\1MZ1GBRH.48V\onsc..tion_bcd22f2a362192ed_0001.0000_80dfbd3a65e7fdfb\OnScreenKeyboard.exe
Nasty bit of work :eek:
And I cant put your OnScreenKeyboard.exe into another Folder to run it as it will just crash
What is OSK.exe ?
Rather, why is it OSK.exe when the process running is called OnScreenKeyboard.exe ?
Now I get it - OSK.exe is nothing to do with OnScreenKeyboard.exe
OSK.exe is the Windows XP OnScreenKeyboard
Why is that relevant to this question ?
-
Re: mini osk at windows login for Vista?
Yeah they did really hide it, and you'd have to be curious enough to wonder where the heck it is. lol
Quote:
And I cant put your OnScreenKeyboard.exe into another Folder to run it as it will just crash
Are you sure about that.
I said folders content, which means the important dlls, and other related files.
You can trim some files out. Most of them must be there in the new folder.
Let me know if it crashes if you copy the whole folder content, to another directory folder. Like the drive C:\ newfolder or whatever.
Quote:
Now I get it - OSK.exe is nothing to do with OnScreenKeyboard.exe
OSK.exe is the Windows XP OnScreenKeyboard
Why is that relevant to this question ?
I think that was another communication difficulty.
we do use osk for short sometimes as a general term, although I usually specify osk.exe if I'm refering to the windows osk.
Created by Madentec.
The built in windows osk.exe is actually a watered down version of the full program called Screen Doors.
I made OnScreenKeyboard.exe to excede ScreenDoors and other popular osks, in functionality and stability.
The big flaw with ScreenDoors, is the repeat function.
If you hold down the mouse to repeat keypresses, the window focus flashes back and forth.
Sometimes leaving it mistracked not where you intended it to be.
-----
-
Re: mini osk at windows login for Vista?
Just tried it. OSK.exe is the same as On-Screen Keyboard (Windows 7 Ultimate RC)
-
Re: mini osk at windows login for Vista?
Quote:
.. said folders content, which means the important dlls, and other related files.
You can trim some files out. Most of them must be there in the new folder.
That works fine
-
Re: mini osk at windows login for Vista?
Quote:
Just tried it. OSK.exe is the same as On-Screen Keyboard (Windows 7 Ultimate RC)
Yup. I'm not sure what that has to do with .NET installed programs, but I agree.
The windows program is call osk.exe, located in the system32 folder, with the titlebar "On-Screen Keyboard"
The about window refers to Madentec producing this for Microsoft.
_____Separately
My program is OnScreenKeyboard.exe, located in the place where .NET installs it's special program folders.
The titlebar of my app is: "Keyboard is focused on: WindowsTitleHere"
-
Re: mini osk at windows login for Vista?
I didn't install your version here...