From: Arshif on
I am running my 32 bit application on a Win7 64-bit machine and when my code
tries to open the on-screen keyboard via the ShellExecute command, e.g.
ShellExecute(NULL,_T("open"),_T("osk.exe"), NULL, NULL, SW_SHOWNORMAL), the
osk process runs but shows the message "Could not start On-Screen Keybaord."

I can run it manually from cmd so the osk works properly. I think the
reason why it is failing has something do to because my 32 bit application
is trying to run the 32 bit version of osk. When I just run osk from cmd,
it runs the 64 bit version. So perhaps the 32 bit version of osk is not
working but I can't tell if this is the case since I can't run the 32 bit
version manually even if I go to the system32\syswow64 folder and run osk.

I also modified my application so that it starts cmd.exe instead and when I
type osk in there, I get the same error message. In this case, the 32 bit
version of cmd was opened so I am thinking it has to do with running a 32
bit version.

Does anyone know what would cause the osk to show the "Could not start
On-Screen Keyboard" message? Is it some configuration issue?


From: Charlie Russel - MVP on
Your 32-bit application is, as you surmise, only able to call the 32-bit
version of the on-screen keyboard. I'm guessing that the 32-bit version
can't run in 64-bit explorer correctly, but honestly don't know why that
would be. However, I'd speculate that it isn't allowed to run because it
can't interact correctly with the 64-bit Explorer shell.

Normally, your 32-bit application doesn't "see" the 64-bit version of the
filesystem or executables. From a 32-bit CMD window, for example:
C:\Windows>dir system32\osk.exe
Volume in drive C has no label.
Volume Serial Number is 0A61-DFB7

Directory of C:\Windows\system32

13/07/2009 06:14 PM 646,144 osk.exe
1 File(s) 646,144 bytes
0 Dir(s) 55,493,632,000 bytes free

C:\Windows>dir syswow64\osk.exe
Volume in drive C has no label.
Volume Serial Number is 0A61-DFB7

Directory of C:\Windows\syswow64

13/07/2009 06:14 PM 646,144 osk.exe
1 File(s) 646,144 bytes
0 Dir(s) 55,493,632,000 bytes free

BUT, from a 64-bit CMD window:

C:\>dir windows\system32\osk.exe
Volume in drive C has no label.
Volume Serial Number is 0A61-DFB7

Directory of C:\windows\system32

13/07/2009 06:39 PM 692,736 osk.exe
1 File(s) 692,736 bytes
0 Dir(s) 55,493,619,712 bytes free


There are specific calls that can be used from a 32-bit application to allow
it to explicitly call a 64-bit EXE. I'm not enough of a programmer to point
you at them, but if you ask over on the MSDN forums, someone should be able
to. Or I may have given you enough to go on to binggle the correct answer.

--
Charlie.
http://msmvps.com/blogs/russel




"Arshif" <arshif(a)luidia.com> wrote in message
news:FAAB2528-9D5F-4AC1-8CFB-99610780D7C9(a)microsoft.com...
>I am running my 32 bit application on a Win7 64-bit machine and when my
>code tries to open the on-screen keyboard via the ShellExecute command,
>e.g. ShellExecute(NULL,_T("open"),_T("osk.exe"), NULL, NULL,
>SW_SHOWNORMAL), the osk process runs but shows the message "Could not start
>On-Screen Keybaord."
>
> I can run it manually from cmd so the osk works properly. I think the
> reason why it is failing has something do to because my 32 bit application
> is trying to run the 32 bit version of osk. When I just run osk from cmd,
> it runs the 64 bit version. So perhaps the 32 bit version of osk is not
> working but I can't tell if this is the case since I can't run the 32 bit
> version manually even if I go to the system32\syswow64 folder and run osk.
>
> I also modified my application so that it starts cmd.exe instead and when
> I type osk in there, I get the same error message. In this case, the 32
> bit version of cmd was opened so I am thinking it has to do with running a
> 32 bit version.
>
> Does anyone know what would cause the osk to show the "Could not start
> On-Screen Keyboard" message? Is it some configuration issue?
>
>