Click here to Skip to main content
6,293,171 members and growing! (11,865 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » Mobile Development » Howto     Beginner License: The Code Project Open License (CPOL)

Help File Integration in Windows Mobile Pocket PC

By PavanPareta

Help file integration with Windows Mobile applications programmatically.
C# (C# 2.0), Win Mobile, .NET CF, Mobile, WinForms, Dev
Version:10 (See All)
Posted:8 Jan 2009
Views:7,182
Bookmarked:17 times
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
33 votes for this article.
Popularity: 6.97 Rating: 4.59 out of 5

1

2
1 vote, 3.0%
3
5 votes, 15.2%
4
27 votes, 81.8%
5

HelpIntigration

Introduction

This article is helpful for Windows Mobile, Smart Device application developers, regarding how to integrate help files programmatically to a targeted device. To develop help files, we have to follow some steps which I have described below.

The .NET Compact Framework allows users to register custom application Help files in Pocket PC's Help systems. It provides access to the Windows CE Help program using peghelp.exe, to display custom application Help files within Windows Mobile Pocket PC applications.

The Solution

How can we create and integrate a Help files in Windows Mobile Pocket PC applications? To create and integrate a help file in Windows Mobile Pocket PC applications, we will follow the steps given below:

Step 1

First, we will create a help file including the help topics that we want to show in our application. Create an HTML file using some specific tags. For example, we are creating "DEMO-HELP.htm" to be integrated as a Help file in our application.

html_help_file.PNG

Note: you can find a sample HTML help file to download from the top of this article.

Step 2

We now have to put this (DEMO-HELP.htm) file in our Windows Mobile Pocket PC device/emulator's \windows directory.

Step 3

Step 3 is achieved programmatically.

The Help file needs to be registered in Pocket PC 's Help File System. To install your Help file on the Pocket PC Help Systems, we have to create a shortcut file in the \Windows\Help folder. Create a shortcut to "DEMO-HELP.htm" in the \Windows\Help folder.

How to create a shortcut to "DEMO-HELP.htm"?

Create a text file on you PC and write 16#\windows\DEMO-HELP.htm to it and save this file using the same name as the Help file with a .lnk extension (DEMO-HELP.lnk). Now, you can put it in the \Windows\Help folder.

You can now check out the application Help integration successfully with the device help system. Tap Help from the Start menu. If your Help is not already displayed, choose All Installed Help from the View menu. Your Help should be included alphabetically in the list.

Code snippet for step 3

private bool CreateLinkHelpFile()
{
    bool isLinkFileCreated = false;
    try
    {
        if (!System.IO.File.Exists(LINK_HELPFILE_PATH))
        {
            System.IO.StreamWriter sw = 
                    new System.IO.StreamWriter(LINK_HELPFILE_PATH);
            sw.Write("16#" + HELPFILE_PATH);
            sw.Close();
            sw = null;
            isLinkFileCreated = true;
        }
        else
        {
            isLinkFileCreated = true;
        }
    }
    catch (Exception ex)
    {
        MessageBox.Show("Link file does not create.", "CreateLinkHelpFile");
        Close();
    }
    return isLinkFileCreated;
}

LINK_HELPFILE_PATH is a variable which is assigned with the @"\Windows\Help" folder path. And it means insert the name of the Help file by the number of characters in the path and the number sign (#). This should be the only line in the file.

protected override void OnHelpRequested(HelpEventArgs e)
{
   try
   {
       if (System.IO.File.Exists(HELPFILE_PATH))
       {
           Help.ShowHelp(this, HELPFILE_PATH);
           base.OnHelpRequested(e);
       }  
       else
       {
           MessageBox.Show("Help File Not Found", "Help Intigration");
       }
    }
    catch (Exception ex)
    {
       MessageBox.Show(ex.Message, "OnHelpRequested");
    }
}

Here, HELPFILE_PATH is a variable which is assigned with the @"\windows\DEMO-HELP.htm" HTML help file.

Points of interest

After installing the application, you are able to view the application help on your device:

help_show_000.PNG

help_show_001.PNG

help_show_002.PNG

help_show_003.PNG

Reference

License

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

About the Author

PavanPareta


Member
as
Occupation: Software Developer (Senior)
Location: India India

Other popular Mobile Development articles:

  • Writing Your Own GPS Applications: Part 2
    In part two of the series, the author of "GPS.NET" teaches developers how to write GPS applications suitable for the real world by mastering GPS precision concepts. Source code includes a working NMEA interpreter and sample high-precision application in C# and VB.NET.
  • Writing Your Own GPS Applications: Part I
    What is it that GPS applications need to be good enough to use for in-car navigation? Also, how does the process of interpreting GPS data actually work? In this three-part series, I will cover both topics and give you the skills you need to write a commercial-grade GPS application.
  • Learn How to Find GPS Location on Any SmartPhone, and Then Make it Relevant
    A step by step tutorial for getting GPS from any SmartPhone, even without GPS built in, and then making location useful.
  • Pocket 1945 - A C# .NET CF Shooter
    An article on Pocket PC game development
  • iPhone UI in Windows Mobile
    It's an interface that works with transparency effects. As a sample I used an interface just like the iPhone one. In this tutorial I am explaining how simple is working with transparency on Windows Mobile.
Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 22 of 22 (Total in Forum: 22) (Refresh)FirstPrevNext
Generalthe number before # Pinmemberniktana21:49 17 Feb '09  
Generalnice article but PinmemberRupesh Kumar Swami2:42 14 Jan '09  
GeneralRe: nice article but PinmemberPavanPareta18:34 14 Jan '09  
GeneralGood one... PinmemberRajesh Ramachandra0:52 13 Jan '09  
Generalgood job done Pinmemberpramodverma0:51 13 Jan '09  
GeneralEfforts Appreciated PinmemberAradhya Agarwal0:00 13 Jan '09  
GeneralRe: Efforts Appreciated PinmemberPavanPareta0:06 13 Jan '09  
GeneralReally a nice Article Pinmember~Khatri Mitesh~20:22 12 Jan '09  
GeneralIf I used compact framework PinmvpSacha Barber2:59 12 Jan '09  
GeneralRe: If I used compact framework PinmemberPavanPareta4:19 12 Jan '09  
GeneralVery interesting article! PinmemberVesko Kolev4:12 10 Jan '09  
GeneralRe: Very interesting article! PinmemberPavanPareta4:19 12 Jan '09  
GeneralHelp file integration Pinmemberyuvraj.raj1:39 10 Jan '09  
GeneralRe: Help file integration PinmemberPavanPareta4:54 12 Jan '09  
Generalhi PinmemberRavenet1:20 10 Jan '09  
GeneralRe: hi PinmemberPavanPareta4:24 12 Jan '09  
GeneralIts Good Artical for integration of customised help with default help PinmemberRajSharma.engr23:32 9 Jan '09  
GeneralGood one .. PinmemberMember 384967621:58 9 Jan '09  
GeneralUseful Article PinmemberNikhil Airun23:45 8 Jan '09  
GeneralRe: Useful Article PinmemberPavanPareta4:52 12 Jan '09  
GeneralExcillent Contents PinmemberPankaj Kumar Gupta22:04 8 Jan '09  
GeneralRe: Excillent Contents PinmemberPavanPareta4:52 12 Jan '09  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 8 Jan 2009
Editor: Smitha Vijayan
Copyright 2009 by PavanPareta
Everything else Copyright © CodeProject, 1999-2009
Web13 | Advertise on the Code Project