[Moved] Windows 7/Server 2008 R2 OSK.exe (on screen keyboard) launch problems

Discussion in 'Windows 7 Help and Support' started by JPLAL, Apr 2, 2010.

  1. JPLAL

    JPLAL New Member

    Joined:
    Apr 2, 2010
    Messages:
    20
    Likes Received:
    0
    Issue with Windows 7 32/64 bit and Windows 2008 R2 environments

    Hi Friends,
    I am facing issue when I am trying of open OSK.EXE (On-Screen Keyboard) through ShellExecute() in both Windows 7 32/64 bit and Windows 2008 R2 environments. OSK is not getting popped up after executing the command.
    My source code’s statement follows:
    Statement1: ShellExecute ( pWnd, "open", "C:\\WINDOWS\\system32\\osk.exe", NULL, NULL, SW_SHOWNORMAL);
    Note (FYI):
    (1) If I execute following statement2 by putting OSK.EXE in C:\, then On – Screen Keyboard is getting popped up.

    Statement2: ShellExecute ( pWnd, "open", "C:\\osk.exe", NULL, NULL, SW_SHOWNORMAL);
    (2) Statement1 is successfully executed on XP, W2K Server and Vista with expected behavior.
    (3) If I try to get the last error through GetLastError() after executing the Statement 1, “Operation has been performed successfully” is translated from the return value of the GetLastError().
    (4) On my Windows 7 machine, UAC is disable.
    (5) I am running ShellExecute() function by logging through the login ID having added to administrator group.
    Please guide me for executing the Statement1.
    Thanks in advance.
    JP
     
  2. cybercore

    cybercore New Member

    Joined:
    Jul 7, 2009
    Messages:
    15,823
    Likes Received:
    321
    For 7 x64, the path is:

    C:\Windows\syswow64\osk.exe
     
  3. JPLAL

    JPLAL New Member

    Joined:
    Apr 2, 2010
    Messages:
    20
    Likes Received:
    0
    Issue with Windows 7 32/64 bit and Windows 2008 R2 environments

    Thanks cybercore for your reply.

    I had already tried this path of OSK, it was also not helpful for my application. OSK was not getting popped up.
     
  4. cybercore

    cybercore New Member

    Joined:
    Jul 7, 2009
    Messages:
    15,823
    Likes Received:
    321
    Why not CreateProcess instead of ShellExecute?
     
  5. JPLAL

    JPLAL New Member

    Joined:
    Apr 2, 2010
    Messages:
    20
    Likes Received:
    0
    I tried with CreateProcess too, but no luck. Sorry I did not mention it in my notes.

    I am worried why OSK is getting popped up.

    Thanks for your reply.
     
  6. cybercore

    cybercore New Member

    Joined:
    Jul 7, 2009
    Messages:
    15,823
    Likes Received:
    321
    Do you mean CreateProcess didn't pop it up either ?

    What error message do you get ?
     
  7. JPLAL

    JPLAL New Member

    Joined:
    Apr 2, 2010
    Messages:
    20
    Likes Received:
    0
    Yes, CreateProcess did not work either.
    I am getting error message "Could not start On-Screen Keyboard.".
     
  8. cybercore

    cybercore New Member

    Joined:
    Jul 7, 2009
    Messages:
    15,823
    Likes Received:
    321
    Your 32-bit application is only able to call the 32-bit version of the on-screen keyboard. Try Start64.exe.
     
  9. JPLAL

    JPLAL New Member

    Joined:
    Apr 2, 2010
    Messages:
    20
    Likes Received:
    0
    As per my understanding I tried this but no use for me. I even gone thru the link you forwarded to me. Could you please guide me based on my system infrastructure mention below.
    I want to tell you my system infrastructure so that you have clear picture of my problem. I am building my application on Windows 2003 Server 32 bit and executing the built application on Window 7 32/64 bit and Windows 2008 R2.
    As I said earlier, I don't have any problem in executing the application on XP, Win 2K3 Server and Vista.
    thanks.
     
  10. cybercore

    cybercore New Member

    Joined:
    Jul 7, 2009
    Messages:
    15,823
    Likes Received:
    321
  11. JPLAL

    JPLAL New Member

    Joined:
    Apr 2, 2010
    Messages:
    20
    Likes Received:
    0
    I have not find "sysnative" folder in %SystemRoot% folder. Even I checked it after installing fresh W2K8 R2 and Window 7.
    Yes, I also find on some online journal about "sysnative" as far as W2K8 R2 OS is concerned.
     
  12. cybercore

    cybercore New Member

    Joined:
    Jul 7, 2009
    Messages:
    15,823
    Likes Received:
    321
    sysnative is file system redirector, not a folder. Use %SystemRoot%\sysnative\osk.exe path to launch osk.exe, visual studio recognizes this path.

    File System Redirector (MSDN)
     
  13. JPLAL

    JPLAL New Member

    Joined:
    Apr 2, 2010
    Messages:
    20
    Likes Received:
    0
    Hi Cybercore,

    I tried sysnative path also but it does not help me. I tried to run the application as an administrator too.

    Manually if I tried to run the OSK.Exe, it is working fine. The application can pop up the OSK if I put the OSK.Exe to c:\. This is for your information.

    Thanks.
     
  14. Mitchell_A

    Mitchell_A Excellent Member

    Joined:
    Feb 7, 2009
    Messages:
    5,068
    Likes Received:
    240
    I've moved these posts to a new thread under Windows 7 Support, where hopefully more people can offer assistance :)
    Sorry if I missed any posts here, don't hesitate to tell me.
    Cheers!
     
  15. JPLAL

    JPLAL New Member

    Joined:
    Apr 2, 2010
    Messages:
    20
    Likes Received:
    0
    My problem of OSK's is solved by Cybercore's last suggestion (File System Redirector (Windows)). Thanks Cybercore for your valuable guidance and I am sorry for making the delayed update on this thread.

    What I did in my code is: I put Wow64DisableWow64FsRedirection(FALSE) before the statement (ShellExecute(pWnd,"open","C:\\Windows\\System32\\osk.exe",NULL,NULL,SW_SHOWNORMAL);). I works and OSK pops up.

    Now, I got another issue which is linked with OSK in my application. Application is:

    Before invoking the OSK, there is one modeless dialog box creation with "CreateDialog()" so that user can key in to the Dialog text box by OSK. Scenario is working fine in XP/W2K3 Server but in Win7 64/Win2K8 R2, dialog's text box losing its Focus when I move the OSK on the screen. As per application design, whenever user moves the OSK, the previous OSK is destroyed by calling a separate function with the statement Windows Message (WM_Destroy). Same call is happening in Win7 64/Win2K8 R2 but what strange thing I have observed is, OSK becomes invisible but its instance presents in Task Manager's process list. So, if I click on dialog text box (as OSK's invocation is on Button Click Event), OSK does not pop up until and unless I manually close the OSK from Task Manager. Once I got the OSK it behaves same as explained above i.e. after moving it loses its focus. I tried to find the OSK and tried to terminate with TerminateProcess() but OSK's instance is not getting killed by this function.

    If you have any further query on the understanding the application, please feel free to write. Any help will be appreciated.

    Thanks Mitchell_A for your posting the thread as a separate one.
     

Share This Page

Loading...