C# .NET - How to disable keypad icon in windows mobile???

Asked By balaram krishna on 02-Apr-10 07:38 AM


Can any body tell how to disable(vanish) the keyboard icon from screen in windows mobile
using c#?????
Christopher Havens replied to balaram krishna on 02-Apr-10 01:41 PM
Hello,  from my knowledge, if the current Windows Mobile for has no Menu object, the SIP keyboard will not be available.

If you have to have options, instead of using a menu, use buttons.
balaram krishna replied to Christopher Havens on 03-Apr-10 12:24 AM
Thaks For ur Response. It's working for me. But my reqrmnt is i want to disable the keypad icon with out ramoving the menu.

Christopher Havens replied to balaram krishna on 03-Apr-10 08:54 AM
If you truly need the menu but don't want the SIP then you have to put do the following:

Put this in the Form_Activated Sub

Dim hWnd As IntPtr = FindWindow(Nothing, "MS_SIPBUTTON")

SetWindowPos(hWnd, SetWindowPosZOrder.HWND_BOTTOM, 0, 0, 0, 0, SetWindowPosFlags.SWP_HIDEWINDOW)

You will need to declare the functions FindWindow and SetWindowPos functions along with the SetWindowPosZOrder and SetWindowPosFlags in a module:

<System.Runtime.InteropServices.DllImport("coredll.dll", EntryPoint:="FindWindow")> _
Public Declare Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
End Function 

<System.Runtime.InteropServices.DllImport("coredll.dll", EntryPoint:="SetWindowPos")> _
Public Declare Function SetWindowPos Lib "Coredll.dll" (ByVal hWnd As IntPtr, ByVal hWndInsertAfter As IntPtr, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal uFlags As UInteger) As Boolean
End Function

 Public Enum SetWindowPosFlag As Integer
        SWP_NOSIZE = &H1
        SWP_NOMOVE = &H2
        SWP_NOZORDER = &H4
        SWP_NOREDRAW = &H8
        SWP_NOACTIVATE = &H10
        SWP_SHOWWINDOW = &H40
        SWP_HIDEWINDOW = &H80
        SWP_NOCOPYBITS = &H100
        SWP_DEFERERASE = &H2000
    End Enum
    Public Enum SetWindowPosZOrder As Integer
        HWND_TOP = 0
        HWND_BOTTOM = 1
        HWND_TOPMOST = -1
        HWND_NOTOPMOST = -2
        HWND_MESSAGE = -3
    End Enum

That should help out, let me know if you have any problems.

Sorry.....!!!!! - balaram krishna replied to Christopher Havens on 05-Apr-10 08:28 AM

Sorry I dont know vb.net, By using Code Converters i tried to convert it into c# But it is saying that it is contains Errors.
Sorry Dude It's not working. - balaram krishna replied to Christopher Havens on 05-Apr-10 09:13 AM
end of post