Click here to Skip to main content
15,861,172 members
Articles / Mobile Apps / Windows Mobile

Enable floating SIP control in IPAQ/Windows CE .NET

Rate me:
Please Sign up or sign in to vote.
3.60/5 (5 votes)
10 Dec 2002CPOL2 min read 119.8K   176   23   18
Enable floating SIP control in iPAQ/Windows CE .NET devices.

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)


Written By
Software Developer
Australia Australia
Passion to be a software architect and solution researcher in enterprise solutions by simplify and unify the existing complex manual paper works into an automated environment friendly, comprehensive and dynamic workflow process system.

Comments and Discussions

 
Generalsip sdk solution Pin
dan rogy7-Oct-10 4:19
dan rogy7-Oct-10 4:19 
General[Message Deleted] Pin
it.ragester28-Mar-09 5:32
it.ragester28-Mar-09 5:32 
Questionproblem in porting wince to smdk 2410 board. Pin
amiya das30-Mar-08 21:09
amiya das30-Mar-08 21:09 
QuestionHow can I disable the SIP in the Telnet client Pin
Frank C29-Nov-07 8:55
Frank C29-Nov-07 8:55 
QuestionHow to disable the SIP? Pin
Lord Sy3-Jan-07 9:54
Lord Sy3-Jan-07 9:54 
QuestionIsn't it much easier... Pin
Fernando A. Gomez F.24-Jul-06 10:53
Fernando A. Gomez F.24-Jul-06 10:53 
GeneralSIP problem Pin
Marten7526-Sep-05 6:41
sussMarten7526-Sep-05 6:41 
GeneralIs SIP standard in WinCE.NET 4.2 Pin
linhjob22-Sep-05 7:09
susslinhjob22-Sep-05 7:09 
GeneralProblem displaying Floating SIP correctly Pin
Anonymous3-Aug-05 20:57
Anonymous3-Aug-05 20:57 
GeneralNetwork Pin
SMPCHRIS20-Apr-04 21:19
SMPCHRIS20-Apr-04 21:19 
Generalunresolved external symbol _SipShowIM Pin
karpavel12-Dec-03 20:00
karpavel12-Dec-03 20:00 
GeneralRe: unresolved external symbol _SipShowIM Pin
CT CHANG25-Dec-03 0:29
CT CHANG25-Dec-03 0:29 
GeneralRe: unresolved external symbol _SipShowIM Pin
Anonymous25-Dec-03 20:46
Anonymous25-Dec-03 20:46 
GeneralI have resolved this problem Pin
karpavel25-Dec-03 21:13
karpavel25-Dec-03 21:13 
The previous message is mine.

karpavel (Pavel Karev)
GeneralCool Pin
Conor O'Doherty18-Jul-03 1:59
Conor O'Doherty18-Jul-03 1:59 
QuestionWhat? Pin
John Burton11-Dec-02 0:59
John Burton11-Dec-02 0:59 
AnswerRe: What? Pin
Jared Bienz11-Dec-02 4:26
Jared Bienz11-Dec-02 4:26 
GeneralRe: What? Pin
CT CHANG11-Dec-02 5:02
CT CHANG11-Dec-02 5:02 

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.