--- a/CryptKeyEntry.cpp
+++ b/CryptKeyEntry.cpp
@@ -3,9 +3,15 @@
 
 #include "stdafx.h"
 #include "PasswordSafe.h"
+#include "PwsPlatform.h"
 
 #include "ThisMfcApp.h"
-#include "resource.h"
+#if defined(POCKET_PC)
+  #include "pocketpc/resource.h"
+  #include "pocketpc/PocketPC.h"
+#else
+  #include "resource.h"
+#endif
 #include "util.h"
 
 #include "CryptKeyEntry.h"
@@ -19,23 +25,29 @@
 
 //-----------------------------------------------------------------------------
 CCryptKeyEntry::CCryptKeyEntry(CWnd* pParent)
-   : CDialog(CCryptKeyEntry::IDD, pParent)
+   : super(CCryptKeyEntry::IDD, pParent)
 {
-   m_cryptkey1 = "";
-   m_cryptkey2 = "";
+   m_cryptkey1	= "";
+   m_cryptkey2	= "";
 }
 
 
 void CCryptKeyEntry::DoDataExchange(CDataExchange* pDX)
 {
-   CDialog::DoDataExchange(pDX);
+   super::DoDataExchange(pDX);
    DDX_Text(pDX, IDC_CRYPTKEY1, (CString &)m_cryptkey1);
    DDX_Text(pDX, IDC_CRYPTKEY2, (CString &)m_cryptkey2);
 }
 
 
-BEGIN_MESSAGE_MAP(CCryptKeyEntry, CDialog)
+BEGIN_MESSAGE_MAP(CCryptKeyEntry, super)
    ON_BN_CLICKED(ID_HELP, OnHelp)
+#if defined(POCKET_PC)
+   ON_EN_SETFOCUS(IDC_CRYPTKEY1, OnPasskeySetfocus)
+   ON_EN_SETFOCUS(IDC_CRYPTKEY2, OnPasskeySetfocus)
+   ON_EN_KILLFOCUS(IDC_CRYPTKEY1, OnPasskeyKillfocus)
+   ON_EN_KILLFOCUS(IDC_CRYPTKEY2, OnPasskeyKillfocus)
+#endif
 END_MESSAGE_MAP()
 
 
@@ -43,7 +55,7 @@
 CCryptKeyEntry::OnCancel() 
 {
    app.m_pMainWnd = NULL;
-   CDialog::OnCancel();
+   super::OnCancel();
 }
 
 
@@ -54,29 +66,56 @@
 
    if (m_cryptkey1 != m_cryptkey2)
    {
-      AfxMessageBox("The two entries do not match.");
+      AfxMessageBox(_T("The two entries do not match."));
       ((CEdit*)GetDlgItem(IDC_CRYPTKEY2))->SetFocus();
       return;
    }
    if (m_cryptkey1 == "")
    {
-      AfxMessageBox("Please enter the key and verify it.");
+      AfxMessageBox(_T("Please enter the key and verify it."));
       ((CEdit*)GetDlgItem(IDC_CRYPTKEY1))->SetFocus();
       return;
    }
 
    app.m_pMainWnd = NULL;
-   CDialog::OnOK();
+   super::OnOK();
 }
 
 
 void
 CCryptKeyEntry::OnHelp() 
 {
+#if defined(POCKET_PC)
+	CreateProcess( _T("PegHelp.exe"), _T("pws_ce_help.html#comboentry"), NULL, NULL, FALSE, 0, NULL, NULL, NULL, NULL );
+#else
    //WinHelp(0x20084, HELP_CONTEXT);
    ::HtmlHelp(NULL,
               "pwsafe.chm::/html/pws_combo_entry.htm",
               HH_DISPLAY_TOPIC, 0);
+#endif
 }
+
+
+#if defined(POCKET_PC)
+/************************************************************************/
+/* Restore the state of word completion when the password field loses   */
+/* focus.                                                               */
+/************************************************************************/
+void CCryptKeyEntry::OnPasskeyKillfocus()
+{
+	EnableWordCompletion( m_hWnd );
+}
+
+
+/************************************************************************/
+/* When the password field is activated, pull up the SIP and disable    */
+/* word completion.                                                     */
+/************************************************************************/
+void CCryptKeyEntry::OnPasskeySetfocus()
+{
+	DisableWordCompletion( m_hWnd );
+}
+#endif
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------