Jump to content

Open the windows on screen keyboard


Recommended Posts

All,

I'm working on a project that will have a touchscreen in a separate room.

I want to open the windows on screen keyboard.

I attached a snippet.

This opens the on screen keyboard in Win XP, VISTA but it does not work on Win7

Can someone help me out ?

Thanks.

EDIT:

If I manually type the command then it opens the osk, but with LabVIEW it doesn't work.

post-12590-0-00373700-1309980040_thumb.p

Link to comment

Perhaps this will be of some help.

Also, your snippet fails to open it on my Win 7 Pro machine.

I have the same problem as the last post there.

For now I have a workaround.

i copied the osk from WinXP and renamed the exe. I put this exe into my project and i can open it.

For now this is ok.

But it would be better if i can just open the osk form the operating system.

Cheers

Link to comment
  • 3 weeks later...

Yes, you may need admin privilege, depending on the task. The taskkiil command has a /u and /p parameter for specifying a username and password to use so the command can be run under that account. Of course, if it's the admin account, anybody who can see the code would also see the password...

An alternative is to send the window the WM_CLOSE message, which tells it to close. You can do this with the SendMessage Windows API function, as shown in attached example.

Send WM_CLOSE Message.vi

Link to comment

You cannot send messages from a process that has lower-level access (such as user-level) to a process that has higher-level (such as admin-level) access. However, I don't believe that launching osk in the fashion that I had provided would cause it run under admin privilege. I don't have time to play with this this morning, but I'll try to look at it later this afternoon.

Link to comment

So my problem persists: spawn On-Screen Keyboard from with LabVIEW, and shut it down when the application closes.

I've only done it before with calls relating to shutdown/standby/hibernation, but you should be able to acquire a security token for your application which grants you elevated privileges. I did not deal with UAC, but I know that UAC is compatible with the token system. Poke around on MSDN for some details.

It's common to use application manifest files to require these privileges but you can do it programmatically with the Windows API as well. I may be writing a wrapper for the WLAN API soon, so this might be helpful to me as well. If I find some spare time, I'll have a look as well.

Link to comment

codeproject.com has several articles on doing impersonation in .NET for this sort of thing. I used one of these in the in-house application I developed at work.

Here's one: http://www.codeproject.com/KB/cs/cpimpersonation1.aspx

and another: http://www.codeproject.com/KB/cs/zetaimpersonator.aspx

and another: http://www.codeproject.com/KB/dotnet/UserImpersonationInNET.aspx

Thus, you could take that code and use the assemblies they provide.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.