Help File Integration in Windows Mobile Pocket PC

No.of Views786
Bookmarked0 times
Downloads 
Votes0
By  pavan.pareta   On  16 Feb 2010 00:02:32
Tag : Windows Mobile , How to
Help File Integration in Windows Mobile Pocket PC
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 


Download CAB file - 4.37 KB

Download demo help - 0.7 KB (HTML file)

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.

Image Loading..

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\Helpfolder. 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

{codecitation class="brush: csharp; gutter: true;" width="650px"}

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;
}

{/codecitation}
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.
{codecitation class="brush: csharp; gutter: true;" width="650px"}

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");
}
}

{/codecitation}

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

Interesting Point:

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

Screens

Image Loading..

Image Loading..

Image Loading...

Image loading...

Reference

1. MSDN

Thank you

Pavan Pareta

 
Sign Up to vote for this article
 
About Author
 
pavan.pareta
Occupation-Software Engineer
Company-
Member Type-Fresh
Location-India
Joined date-19 Jul 2009
Home Page-http://windows-mobile-dev.blogspot.com/
Blog Page-http://windows-mobile-dev.blogspot.com/
My name is Pavan, I enjoy computers and general technology. I am more interested in the areas of Computer Security, Programming and developing innovative s/w for Windows Mobile and Windows Phone 7. I like MS Technology and support open-source software, because I believe it plays a major role in knowledge sharing and exchange of ideas, which effectively leads to better software. Additionally, I am a follower of the KISS (Keep It Simple Stupid) philosophy. I Love C#.NET and recently I am fall in love with Silverlight :)
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top