chtmleditor.cpp

来自「用visual c++写的一个超文本编辑器」· C++ 代码 · 共 86 行

CPP
86
字号

/*********************************************************************************
            Internet Explorer DHTML Editor class written by Elm黃oft
            tested on Visual   Studio   6.0, 7.0, 7.1
            tested on Internet Explorer 5.0, 5.5, 6.0
                              www.elmue.de.vu
                              kickme.to/elmue
                              elmue(at)gmx.de

----------------------------------------------------------------------------------
Using these conventions results in better readable code and less coding errors !
----------------------------------------------------------------------------------

     cName  for generic class definitions
     CName  for MFC     class definitions
     tName  for type    definitions
     eName  for enum    definitions
     kName  for struct  definitions

    e_Name  for enum variables
    E_Name  for enum constant values

    i_Name  for instances of classes
    h_Name  for handles

    T_Name  for Templates
    t_Name  for TCHAR or LPTSTR

    s_Name  for strings
   bs_Name  for BSTR
    f_Name  for function pointers
    k_Name  for contructs (struct)

    b_Name  bool,BOOL 1 Bit

   s8_Name    signed  8 Bit (char)
  s16_Name    signed 16 Bit (SHORT, WCHAR)
  s32_Name    signed 32 Bit (LONG, int)
  s64_Name    signed 64 Bit (LONGLONG)

   u8_Name  unsigned  8 Bit (BYTE)
  u16_Name  unsigned 16 bit (WORD)
  u32_Name  unsigned 32 Bit (DWORD, UINT)
  u64_Name  unsigned 64 Bit (ULONGLONG)

    d_Name  for double

  ----------------

    m_Name  for member variables of a class (e.g. ms32_Name for int member variable)
    g_Name  for global variables            (e.g. gu16_Name for global WORD)
    p_Name  for pointer                     (e.g.   ps_Name  *pointer to string)
   pp_Name  for pointer to pointer          (e.g.  ppd_Name **pointer to double)


   typedef short VARIANT_BOOL ( 0 == FALSE, 0xFFFF == TRUE )


*************************************************************************************/

#include "StdAfx.h"
#include "cHtmlEditor.h"

GUID GUID_MSHTML = {0xde4ba900, 0x59ca, 0x11cf, {0x95,0x92,0x44,0x45,0x53,0x54,0x00,0x00}};

static CWnd   *gp_Parent = 0; // global (parent for messageboxes)

// ###########################  MISC  #################################

void CHtmlEditor::cMisc::RegWriteString(HKEY h_Class, CString s_Path, CString s_Key, CString s_Value)
{
	CRegKey i_Reg;
	i_Reg.Create  (h_Class, s_Path);   // closed in destructor of CRegKey
	i_Reg.SetValue(s_Value, s_Key);
}

void CHtmlEditor::cMisc::RegWriteDword(HKEY h_Class, CString s_Path, CString s_Key, DWORD u32_Value)
{
	CRegKey i_Reg;
	i_Reg.Create  (h_Class,   s_Path);  // closed in destructor of CRegKey
	i_Reg.SetValue(u32_Value, s_Key);
}

// Replaces MIME encoded strings
// "%20" --> " "
// "%FC" --> "

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?