Click here to Skip to main content
Click here to Skip to main content

Enable floating SIP control in IPAQ/Windows CE .NET

By , 10 Dec 2002
 

Introduction

This article give you the tips on how to have a floating SIP control in your Pocket PC/Windows CE .NET device. At the same time, you have learn on how to do a soft reset (without pressing any button) on your device.

Background

You need to have some basic idea on how to access the registry as well as changing the respective value. The key value in this article is changing the registry value in order to create a floating SIP control.

Using the code

To implement this is quite simple, all you need is to include the soft reset API declare from winioctl.h as shown below, so that you can call the reset function right after changing the registry value.

// FOR SOFT RESET USED ONLY
// ------------------------------------------------------------
#include <winioctl.h>
#define IOCTL_HAL_REBOOT CTL_CODE(FILE_DEVICE_HAL, 15, 
                            METHOD_BUFFERED, FILE_ANY_ACCESS)

extern "C" __declspec(dllimport) BOOL KernelIoControl(
    DWORD dwIoControlCode, 
    LPVOID lpInBuf, 
    DWORD nInBufSize, 
    LPVOID lpOutBuf, 
    DWORD nOutBufSize, 
    LPDWORD lpBytesReturned);
// ------------------------------------------------------------

Once you have declared the above API, then you are free to execute the declare function as the code show below:

// Soft reset the device
KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);

Next is the registry location for SIP style where the OS reference to. This will be the key value before the OS proceeds to create the SIP control. Therefore, the SIP style is controlled by the following registry key:

HKEY_CURRENT_USER\ControlPanel\Sip\DragStyle
  • DragStyle = 0, means the SIP is non-movable.
  • DragStyle = 1, means the SIP is movable.

I have simplified the registry access by putting all the messy code into the few functions defined under the RegEdit.h and RegEdit.cpp. Hence, all you need is to call the SaveDWORD with the correct value when you tend to switch from non-movable to movable SIP control or vice-versa.

// Enable the movable SIP control
SaveDWORD(HKEY_CURRENT_USER, TEXT("ControlPanel\\Sip"), 
                                   TEXT("DragStyle"), 1);

// Disable the movable SIP control
SaveDWORD(HKEY_CURRENT_USER, TEXT("ControlPanel\\Sip"), 
                                   TEXT("DragStyle"), 0);

A soft reset is required for the changes made to take effect. Hence, after the above code is executed, the device is going to reset with the discuss reset function.

Points of interest

Feel free to explorer more on the Pocket PC registry setting and you will get more fun with it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

hackzai
Web Developer
Malaysia Malaysia
Member
Hackzai was graduated from Double-E, and being certified as MCSD (VS6) at spring 2003. But move forward with ASP.NET, VB.NET, C#, Silverlight, LINQ, XML

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
Generalunresolved external symbol _SipShowIMmemberkarpavel12 Dec '03 - 20:00 
Explain me, please. What should I do?
I downloaded your sample project but could not compile one.
Linker says “SipStyle.obj : error LNK2019: unresolved external symbol _SipShowIM referenced in function "long __cdecl DlgProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DlgProc@@YAJPAUHWND__@@IIJ@Z)”.
 
I use eVC++4.0 SP1.

 
Karev Pavel
GeneralRe: unresolved external symbol _SipShowIMmemberK-PAX25 Dec '03 - 0:29 
Have you include the Sipapi.h in your project?
 
K-PAX? CHANGE THE WAY YOU LOOK AT YOURSELF, OTHERS & THE WORLD...
GeneralRe: unresolved external symbol _SipShowIMsussAnonymous25 Dec '03 - 20:46 
I have resolved this problem by downloading eVC++ SP2 & Microsoft Pocket PC 2003 SDK.msi
 
Thank you.

GeneralI have resolved this problemmemberkarpavel25 Dec '03 - 21:13 
The previous message is mine.
 
karpavel (Pavel Karev)
GeneralCoolmemberConor O'Doherty18 Jul '03 - 1:59 
Smile | :) Nice one. How many other gems are hidden away under the hood that us developers/user don't know about but would make our life so much easier. Smile | :)
QuestionWhat?memberJohn Burton11 Dec '02 - 0:59 
It might have helped if anywhere in your article you mentioned what a "SIP control" was or why you might want to enable one.
AnswerRe: What?memberJared Bienz11 Dec '02 - 4:26 
SIP is a standard acronym used in Windows CE / Pocket PC. It stands for Software Input Panel. One of the obvious uses for enableing / disabling / floating the panel would be to control the on-screen keyboard.
 
Jared Bienz

jared@bienz.com

GeneralRe: What?memberK-PAX11 Dec '02 - 5:02 
There is a build-in keyword in the WindowsCE/PocketPC OS as we call it Software Input Panel (SIP). Normally in MS PocketPC, the SIP is always stick at the bottom of the screen.
 
Actually there is a setting to control the style of the SIP control as I mention in my article. Upon switch the SIP to floating, which mean the SIP is free to move anywhere in the screen Wink | ;)
 
Hope my explaination will provide you a clear picture about the floating SIP i intend to discuss in my article.
 
regards,
K-PAX

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 11 Dec 2002
Article Copyright 2002 by hackzai
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid