Skip to main content

Past Blast

Featured Products

Windows Mobile Developer Controls
Windows Mobile Developer Controls
Stay in touch using the DEVBUSS RSS feeds.
 

News

Windows Mobile Developer Controls
Windows Mobile Developer Controls

Part 2: Building a better world with Windows CE logo certification

Written by Carl Davis  [author's bio]  [read 34645 times]
Edited by Derek

Page 1  Page 2  Page 3 

The format of the link file is very simple. It contains the full path to the help file prefaced by the length of the link and a '#' separator. For example, "\windows\myhelp.htm" is 19 characters long, so the link file would contain a single line consisting of:

19#\windows\myhelp.htm

Now, that's about as easy as it gets? In summary, we've just created our help file and published it to the TOC using the routine in Listing 2. Figure 2 shows the TOC on the emulator with our test help file displayed.

That remark was taken out of context…

The last challenge we have is creating some context sensitive help for our users. I want to allow them to select help from the start menu (Figure 3) when they are using the application. As mentioned before, this is really the only Windows CE Logo compliant way of accessing help in our applications.

Fortunately, it's pretty easy to get help in your applications. Microsoft's eVB includes the Form_HelpClick() event on each form. When the user selects help from the start menu, we can react to it. We can offer help globally for the form, or use other state information, to decide what we'll show.

Once help is requested, you need to display it to the user. You could popup another form or display a hidden frame. However, we'll go a step further and use the standard help viewer (peghelp.exe) to display a section of our help file we already created. Listing 3 shows how we will accomplish this feat.

Option Explicit

' Declaration of API call to create an external process
Public Declare Function CeCreateProcess Lib "coredll" Alias "CreateProcessW" _
(ByVal lpApplicationName As String, ByVal lpCommandLine As String, _
ByVal lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, _
ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, _
ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, _
ByVal lpStartupInfo As Long, ByVal lpProcessInformation As Long) As Long
' Respond to start->Help selection

Private Sub Form_HelpClick()
'Thanks to Derek Mitchell code snippet to create a external process
Dim Success
Success = CeCreateProcess("peghelp.exe", "file:test.htm#one", 0, 0, 0, 0, 0, 0, 0, 0)
End Sub

Listing 3

We'll use a CE API call to create a new process with the help viewer. The API call I'm using for came from code snippets Derek had on deVBuzz (Hey, I not only write for DevBuzz, I'm a user too!). When we get the event, we spawn the help view with a reference to our help file and the particular section we want to view.

Conclusion

Providing help for your application's users is easy to do. Doing it in a Windows CE Logo compliant way isn't difficult either. I showed how to create a simple help file, publish it to the table of contents, and finally provide links to sections of the file within an application. Now, I got to go and start thinking about that new gaming application for next year's GenCon!

Previous Page