Editor html problema

« Older   Newer »
  Share  
ACIDBURN16
CAT_IMG Posted on 13/2/2010, 19:03     +1   -1




Ciao sto tentando di inserire un editor html per il mio mail bomber ed ho visto questo editor ingiro:
CODICE
#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_compression=4
#AutoIt3Wrapper_useupx=n
#AutoIt3Wrapper_res_comment=Slave to Mailer.exe
#AutoIt3Wrapper_res_description=Test Application
#AutoIt3Wrapper_res_language=1033
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****

;.......script written by trancexx (trancexx at yahoo dot com)

Opt("MustDeclareVars", 1)

Global $iSplash = -2
_Splash()

Global Const $hUSER32 = DllOpen("user32.dll")
Global Const $hGDI32 = DllOpen("gdi32.dll")
Global Const $hCOMDLG32 = DllOpen("comdlg32.dll")
Global Const $hADVAPI32 = DllOpen("advapi32.dll")
Global Const $hOLEACC = DllOpen("oleacc.dll")

Global $sTempDir = @TempDir & "TemporaryDirectoryForHTMLEditor"
If DirCreate($sTempDir) Then
       $sTempDir = FileGetShortName($sTempDir)
       If @error Then
               $sTempDir = @TempDir
       EndIf
Else
       $sTempDir = @TempDir
EndIf

DirCreate(@MyDocumentsDir & "HTMLEditor")

Global $sFile

Global $oIE, $oError, $hHMLControl, $oIEDocument, $oDocBody, $sInnerHTML
Global $hIEHandle, $hIEDocumentHandle

Global $hGui, $aMsg

Global $hFontPic, $hFontLabel, $hCombo, $hFontGroup

Global $hFontSizePic, $hFontSizeLabel, $hCombo1, $hFontSizeGroup

Global $hColorGroup, $hFontColorPic, $hMarkerPic
Global $hFoColGroup, $hFoColDoGroup, $hFoColSelectGroup, $hMarkerGroup, $hMarkerDoGroup, $hMarkerSelectGroup

Global $hUndoPic, $hRedoPic, $hUnReGroup, $hUnGroup, $hReGroup
Global $hCopyPic, $hDeletePic, $hCutPic, $hPastePic, $hCDCUPGroup, $hCGroup, $hDGroup, $hCUGroup, $hPGroup

Global $hBoldPic, $hItalicPic, $hUnderlinePic, $hBoldPic1, $hItalicPic1, $hUnderlinePic1
Global $hBIUGroup, $hBGroup, $hIGroup, $hUGroup

Global $hAligneLeftPic, $hAligneCenterPic, $hAligneRightPic, $hAligneLeftPic1, $hAligneCenterPic1, $hAligneRightPic1
Global $hAligneLeftGroup, $hAligneCenterGroup, $hAligneRightGroup

Global $hIndentPic, $hUnIndentPic
Global $hIndentGroup, $hUnIndentGroup

Global $hHyperPic, $hInsImagePic, $hOrdered, $hUnOrdered, $hSmileyPic, $hHorRulePic
Global $HIOUTHGroup, $hHyperPicGroup, $hInsImagePicGroup, $hOrderedGroup, $hUnOrderedGroup, $hSmileyPicGroup, $hHorRulePicGroup

Global $hInfoLabel, $hInfoLabelData

Global $hOpenPic, $hSavePic, $hRecyclePic
Global $hMiscGroup, $hOpenPicGroup, $hSaveGroup, $hRecyclePicGroup

Global $sLogoPicpic, $hFinishedLabel, $hOKButton

Global $sMD5Original, $sMD5Current

Global $sNewColor, $iNewHihglightColor

Global $hFontInfoLabel = _CreateFont(10, 800, 262, "Trebuchet MS")
Global $hFontInfoLabelData = _CreateFont(8.5, 400, 258, "Trebuchet MS")

_MakeGUI()

Global $iBoldState, $iItalicState, $iUnderlineState, $iLeftState, $iCenterState, $iRightState, $iForeColor, $sFontName, $iFontSize

Global $sJustify, $sJustify1
Global $iComboFocus, $iComboFocus1, $iSize
Global $sFontNameNew, $iFontSizeNew
Global $iBIUGroupIs = 0, $iBGroupIs, $iIGroupIs, $iUGroupIs
Global $iYellBold, $iYellIt, $iYellUnderl

Global $iColorable
Global $iItaliced, $iUnderlinabled, $iBoleadable
Global $iUndoedable, $iRedoedable, $iCopydable
Global $iCopydable, $iDeleteable, $iCuteable, $iPasteable
Global $iLeftable, $iCenterable, $iRightable
Global $iIndentable, $iUnIndentable
Global $iHyperable, $iInsImable
Global $iOrderable, $iUnorderable, $iHorruleable

Global $sClipContent
Global $iHighlightedIs
Global $iFontGroupIs, $iFontSizeGroupIs, $iColorGroupIs, $iUnReGroupIs, $iCDCUPGroupIs, $iHIOUTHGroupIs
Global $iUnGroupIs, $iReGroupIs, $iCGroupIs, $iDGroupIs, $iCUGroupIs, $iPGroupIs, $iIndentGroupIs, $iUnIndentGroupIs
Global $iAligneLeftGroupIs, $iAligneCenterGroupIs, $iAligneRightGroupIs
Global $iHyperPicGroupIs, $iInsImagePicGroupIs, $iOrderedGroupIs, $iUnOrderedGroupIs, $iTablePicGroupIs, $iHorRulePicGroupIs
Global $iFoColGroupIs, $MarkerGroupIs, $MarkeDolGroupIs, $MarkerSelectGroupIs, $FoColDoGroupIs, $FoColSelectGroupIs
Global $iOpenPicGroupIs, $iSaveGroupIs, $iRecyclePicGroupIs

Global $aCursorInfo
Global $aMousePos, $iTikTip, $hTimer
Global $iFirstRun = 1

GUISetState()
$oIEDocument.focus
$oIEDocument.focus

While 1

       If $iFirstRun Then
               $iFirstRun = 0
               $iSplash = 0
       EndIf

       If $iSplash > -1 Then
               $iSplash += 0.1
               If $iSplash > 7 Then
                       WinSetTrans("{F2A76B6C-73EE-41CA-B0E3-639023BB9D3F}", "", 200 - 10 * ($iSplash - 4))
               EndIf
               If $iSplash > 20 Then
                       SplashOff()
                       $iSplash = -2
               EndIf
       EndIf

       $aCursorInfo = GUIGetCursorInfo()
       If @error Then
               Global $aCursorInfo[5] = [0, 0, 0, 0, 0]
       EndIf

       $aMsg = GUIGetMsg(1)
       Switch $aMsg[0]
               Case - 3
                       ExitLoop
               Case $hUndoPic
                       If $iUndoedable = 0 Then
                               $oIEDocument.execCommand("Undo")
                               $iUndoedable = 1
                               $oIEDocument.focus
                       EndIf
               Case $hRedoPic
                       If $iRedoedable = 0 Then
                               $oIEDocument.execCommand("Redo")
                               $iRedoedable = 1
                               $oIEDocument.focus
                       EndIf
               Case $hCopyPic
                       If $oIEDocument.queryCommandEnabled("Copy") Then
                               If $iCopydable = 0 Then
                                       $oIEDocument.execCommand("Cut")
                                       $oIEDocument.execCommand("Paste")
                                       $iCopydable = 1
                                       $oIEDocument.focus
                               EndIf
                       EndIf
               Case $hDeletePic
                       If $iDeleteable = 0 Then
                               $oIEDocument.execCommand("Delete")
                               $iDeleteable = 1
                               $oIEDocument.focus
                       EndIf
               Case $hCutPic
                       If $iCuteable = 0 Then
                               $oIEDocument.execCommand("Cut")
                               $iCuteable = 1
                               $oIEDocument.focus
                       EndIf
               Case $hPastePic
                       If $iPasteable = 0 Then
                               $oIEDocument.execCommand("Paste")
                               $iPasteable = 1
                               $oIEDocument.focus
                       EndIf
               Case $hBoldPic, $hBoldPic1
                       If $iBoleadable = 0 Then
                               $oIEDocument.execCommand("Bold")
                               $sClipContent = ClipGet()
                               If $oIEDocument.queryCommandEnabled("Copy") Then
                                       $oIEDocument.execCommand("Copy")
                               Else
                                       ClipPut("")
                               EndIf
                               $oIEDocument.execCommand("Paste")
                               $oIEDocument.focus
                               ClipPut($sClipContent)
                               $iBoleadable = 1
                       EndIf
               Case $hItalicPic, $hItalicPic1
                       If $iItaliced = 0 Then
                               $oIEDocument.execCommand("Italic")
                               $sClipContent = ClipGet()
                               If $oIEDocument.queryCommandEnabled("Copy") Then
                                       $oIEDocument.execCommand("Copy")
                               Else
                                       ClipPut("")
                               EndIf
                               $oIEDocument.execCommand("Paste")
                               $oIEDocument.focus
                               ClipPut($sClipContent)
                               $iItaliced = 1
                       EndIf
               Case $hUnderlinePic, $hUnderlinePic1
                       If $iUnderlinabled = 0 Then
                               $oIEDocument.execCommand("Underline")
                               $sClipContent = ClipGet()
                               If $oIEDocument.queryCommandEnabled("Copy") Then
                                       $oIEDocument.execCommand("Copy")
                               Else
                                       ClipPut("")
                               EndIf
                               $oIEDocument.execCommand("Paste")
                               $oIEDocument.focus
                               ClipPut($sClipContent)
                               $iUnderlinabled = 1
                       EndIf
               Case $hAligneLeftPic, $hAligneLeftPic1
                       If $iLeftable = 0 Then
                               $oIEDocument.execCommand("JustifyLeft")
                               $oIEDocument.focus
                               $iLeftable = 1
                       EndIf
               Case $hAligneCenterPic, $hAligneCenterPic1
                       If $iCenterable = 0 Then
                               $oIEDocument.execCommand("JustifyCenter")
                               $oIEDocument.focus
                               $iCenterable = 1
                       EndIf
               Case $hAligneRightPic, $hAligneRightPic1
                       If $iRightable = 0 Then
                               $oIEDocument.execCommand("JustifyRight")
                               $oIEDocument.focus
                               $iRightable = 1
                       EndIf
               Case $hIndentPic
                       If $iIndentable = 0 Then
                               $oIEDocument.execCommand("Indent")
                               $iIndentable = 1
                               $oIEDocument.focus
                       EndIf
               Case $hUnIndentPic
                       If $iUnIndentable = 0 Then
                               $oIEDocument.execCommand("Outdent")
                               $iUnIndentable = 1
                               $oIEDocument.focus
                       EndIf
               Case $hHyperPic
                       If $oIEDocument.queryCommandEnabled("Copy") Then
                               If $iHyperable = 0 Then
                                       $oIEDocument.execCommand("CreateLink", True)
                                       $iHyperable = 1
                                       $oIEDocument.focus
                               EndIf
                       Else
                               ToolTip("")
                               MsgBox(64, "Hyperlink", "You need to select the text to transform to hyperlink." & @CRLF & @CRLF & "Note that 'www.example.com' is automatically transformed.", 0, $hGui)
                       EndIf
               Case $hInsImagePic
                       If $iInsImable = 0 Then
                               $oIEDocument.execCommand("InsertImage", True)
                               $iInsImable = 1
                               $oIEDocument.focus
                       EndIf
               Case $hOrdered
                       If $iOrderable = 0 Then
                               $oIEDocument.execCommand("InsertOrderedList")
                               $iOrderable = 1
                               $oIEDocument.focus
                       EndIf
               Case $hUnOrdered
                       If $iUnorderable = 0 Then
                               $oIEDocument.execCommand("InsertUnorderedList")
                               $iUnorderable = 1
                               $oIEDocument.focus
                       EndIf
               Case $hHorRulePic
                       If $iHorruleable = 0 Then
                               $oIEDocument.execCommand("InsertHorizontalRule")
                               $iHorruleable = 1
                               $oIEDocument.focus
                       EndIf
               Case $hSmileyPic
                       ToolTip("")
                       MsgBox(64, "Smiley", "Not implemented in this version.", 0, $hGui)
               Case $hOpenPic
                       ToolTip("")
                       DirCreate(@MyDocumentsDir & "HTMLEditor")
                       $sFile = FileOpenDialog("Choose File", @MyDocumentsDir & "HTMLEditor", "HTML files (*.htm;*.html)|Text Files(*.txt)", 3, "", $hGui)
                       If $sFile Then
                               $oDocBody.InnerHTML = FileRead($sFile)
                               $sMD5Original = _MD5($oDocBody.InnerHTML)
                       EndIf
                       $oIEDocument.focus
                       $oIEDocument.focus
               Case $hSavePic
                       ToolTip("")
                       $sInnerHTML = $oDocBody.innerHTML
                       If Not $sInnerHTML Or $sInnerHTML = "<P>&nbsp;</P>" Then
                               $aMousePos = MouseGetPos()
                               DllCall($hUSER32, "int", "MessageBeep", "dword", 64)
                               ToolTip("Empty message!", $aMousePos[0] - 100, Default, "Nothing to save", 2)
                               $iTikTip = 1
                       Else
                               $sMD5Current = _MD5($sInnerHTML)
                               If $sMD5Current = $sMD5Original And $sFile Then
                                       $aMousePos = MouseGetPos()
                                       DllCall($hUSER32, "int", "MessageBeep", "dword", 64)
                                       ToolTip("No changes!", $aMousePos[0] - 100, Default, "Nothing to save", 2)
                                       $iTikTip = 1
                               Else
                                       If _SaveToFile($sFile, $sInnerHTML) Then
                                               $sMD5Original = $sMD5Current
                                               $sMD5Current = ""
                                       EndIf
                               EndIf
                       EndIf
               Case $hRecyclePic
                       ToolTip("")
                       If $sFile Then
                               If MsgBox(4, "Confirm File Delete", "Are you sure you want to send '" & FileGetLongName($sFile) & "' to the Recycle Bin?", 0, $hGui) = 6 Then
                                       $oDocBody.InnerHTML = ""
                                       FileRecycle($sFile)
                                       $sFile = ""
                                       $sMD5Current = ""
                                       $sMD5Original = ""
                                       $oIEDocument.focus
                               EndIf
                       EndIf
               Case $hOKButton
                       ToolTip("")
                       $sInnerHTML = $oDocBody.innerHTML
                       If Not $sInnerHTML Or $sInnerHTML = "<P>&nbsp;</P>" Then
                               Exit
                       Else
                               $sMD5Current = _MD5($sInnerHTML)
                               If $sMD5Current = $sMD5Original And $sFile Then
                                       Exit
                               Else
                                       If Not $sFile Then
                                               Local $i
                                               Do
                                                       $i += 1
                                                       $sFile = @MyDocumentsDir & "HTMLEditorTemplateHTML_" & $i & ".htm"
                                               Until Not FileExists($sFile)
                                       EndIf
                                       _SaveToFile($sFile, $sInnerHTML)
                                       Exit
                               EndIf
                       EndIf
       EndSwitch


       $iBoldState = $oIEDocument.queryCommandState("Bold")
       $iItalicState = $oIEDocument.queryCommandState("Italic")
       $iUnderlineState = $oIEDocument.queryCommandState("Underline")
       $iLeftState = $oIEDocument.queryCommandState("JustifyLeft")
       $iCenterState = $oIEDocument.queryCommandState("JustifyCenter")
       $iRightState = $oIEDocument.queryCommandState("JustifyRight")

       $iForeColor = $oIEDocument.queryCommandValue("ForeColor")
       $sFontName = $oIEDocument.queryCommandValue("FontName")
       $iFontSize = $oIEDocument.queryCommandValue("FontSize")


       $sJustify = Abs($iLeftState) & Abs($iCenterState) & Abs($iRightState)
       If $sJustify <> $sJustify1 Then
               Switch $sJustify
                       Case 000, 100
                               GUICtrlSetState($hAligneLeftPic1, 16)
                               GUICtrlSetState($hAligneLeftPic, 32)
                               GUICtrlSetState($hAligneCenterPic, 16)
                               GUICtrlSetState($hAligneCenterPic1, 32)
                               GUICtrlSetState($hAligneRightPic, 16)
                               GUICtrlSetState($hAligneRightPic1, 32)
                       Case 010
                               GUICtrlSetState($hAligneLeftPic1, 32)
                               GUICtrlSetState($hAligneLeftPic, 16)
                               GUICtrlSetState($hAligneCenterPic1, 16)
                               GUICtrlSetState($hAligneCenterPic, 32)
                               GUICtrlSetState($hAligneRightPic, 16)
                               GUICtrlSetState($hAligneRightPic1, 32)
                       Case 001
                               GUICtrlSetState($hAligneLeftPic, 16)
                               GUICtrlSetState($hAligneLeftPic1, 32)
                               GUICtrlSetState($hAligneCenterPic, 16)
                               GUICtrlSetState($hAligneCenterPic1, 32)
                               GUICtrlSetState($hAligneRightPic1, 16)
                               GUICtrlSetState($hAligneRightPic, 32)
               EndSwitch
               $sJustify1 = $sJustify
       EndIf

       If $iBoldState = 0 And $iYellBold = 0 Then
               GUICtrlSetState($hBoldPic1, 32)
               GUICtrlSetState($hBoldPic, 16)
               $iYellBold = 1
       ElseIf $iBoldState = -1 And $iYellBold = 1 Then
               GUICtrlSetState($hBoldPic, 32)
               GUICtrlSetState($hBoldPic1, 16)
               $iYellBold = 0
       EndIf
       If $iItalicState = 0 And $iYellIt = 0 Then
               GUICtrlSetState($hItalicPic1, 32)
               GUICtrlSetState($hItalicPic, 16)
               $iYellIt = 1
       ElseIf $iItalicState = -1 And $iYellIt = 1 Then
               GUICtrlSetState($hItalicPic, 32)
               GUICtrlSetState($hItalicPic1, 16)
               $iYellIt = 0
       EndIf
       If $iUnderlineState = 0 And $iYellUnderl = 0 Then
               GUICtrlSetState($hUnderlinePic1, 32)
               GUICtrlSetState($hUnderlinePic, 16)
               $iYellUnderl = 1
       ElseIf $iUnderlineState = -1 And $iYellUnderl = 1 Then
               GUICtrlSetState($hUnderlinePic, 32)
               GUICtrlSetState($hUnderlinePic1, 16)
               $iYellUnderl = 0
       EndIf

       If $sFontNameNew <> $sFontName Then
               GUICtrlSetData($hFontLabel, $sFontName)
               GUICtrlSetFont($hFontLabel, 9, -1, 1, $sFontName)
       EndIf

       If $iFontSizeNew <> $iFontSize Then
               If Not $iFontSize Then
                       GUICtrlSetData($hFontSizeLabel, "?")
               Else
                       GUICtrlSetData($hFontSizeLabel, $iFontSize)
               EndIf
       EndIf

       If $aCursorInfo[4] = $hFoColSelectGroup And $aCursorInfo[2] Then
               $sNewColor = _SelectColor($iForeColor, 1, $hGui)
               If $sNewColor <> -1 And $oIEDocument.queryCommandEnabled("Copy") Then
                       $oIEDocument.execCommand("ForeColor", False, $sNewColor)
                       $sClipContent = ClipGet()
                       $oIEDocument.execCommand("Copy")
                       $oIEDocument.execCommand("Paste")
                       ClipPut($sClipContent)
               ElseIf $sNewColor <> -1 Then
                       $oIEDocument.execCommand("ForeColor", False, $sNewColor)
               EndIf
               $oIEDocument.focus()
       EndIf

       If $aCursorInfo[4] = $hFoColDoGroup And $aCursorInfo[2] Then
               If $sNewColor <> -1 And $iColorable = 0 Then
                       $oIEDocument.execCommand("ForeColor", False, $sNewColor)
                       $sClipContent = ClipGet()
                       If $oIEDocument.queryCommandEnabled("Copy") Then
                               $oIEDocument.execCommand("Copy")
                       Else
                               ClipPut("")
                       EndIf
                       $oIEDocument.execCommand("Paste")
                       $oIEDocument.focus()
                       ClipPut($sClipContent)
                       $iColorable = 1
               EndIf
       Else
               $iColorable = 0
       EndIf

       If $aCursorInfo[4] = $hMarkerSelectGroup And $aCursorInfo[2] Then
               _SelectColor($iNewHihglightColor, 2, $hGui)
               If $iNewHihglightColor <> -1 And $oIEDocument.queryCommandEnabled("Copy") Then
                       $oIEDocument.execCommand("BackColor", False, $iNewHihglightColor)
                       $sClipContent = ClipGet()
                       $oIEDocument.execCommand("Copy")
                       $oIEDocument.execCommand("Paste")
                       ClipPut($sClipContent)
               ElseIf $iNewHihglightColor <> -1 Then
                       $oIEDocument.execCommand("BackColor", False, $iNewHihglightColor)
               EndIf
               $oIEDocument.focus()
       EndIf
       If $aCursorInfo[4] = $hMarkerDoGroup And $aCursorInfo[2] Then
               If $iNewHihglightColor <> -1 And $iHighlightedIs = 0 Then
                       $oIEDocument.execCommand("BackColor", False, $iNewHihglightColor)
                       $sClipContent = ClipGet()
                       If $oIEDocument.queryCommandEnabled("Copy") = True Then
                               $oIEDocument.execCommand("Copy")
                       Else
                               ClipPut("")
                       EndIf
                       $oIEDocument.execCommand("Paste")
                       $oIEDocument.focus()
                       ClipPut($sClipContent)
                       $iHighlightedIs = 1
               EndIf
       Else
               $iHighlightedIs = 0
       EndIf

       If ($aCursorInfo[0] > 146 And $aCursorInfo[0] < 158) And ($aCursorInfo[1] > 73 And $aCursorInfo[1] < 93) Then
               $iComboFocus = 0
               $iComboFocus1 = 1
       ElseIf ($aCursorInfo[0] > 100 And $aCursorInfo[0] < 112) And ($aCursorInfo[1] > 73 And $aCursorInfo[1] < 93) Then
               $iComboFocus = 1
               $iComboFocus1 = 0
       EndIf

       If $iComboFocus Then
               If $aCursorInfo[2] Then
                       If ($aCursorInfo[0] > 7 And $aCursorInfo[0] < 112) And ($aCursorInfo[1] > 73 And $aCursorInfo[1] < 280) Then
                               If GUICtrlRead($hCombo) <> $sFontName Then
                                       $sFontName = GUICtrlRead($hCombo)
                                       GUICtrlSetData($hCombo, $sFontName)
                                       $oIEDocument.execCommand("FontName", False, $sFontName)
                                       GUICtrlSetData($hCombo, $sFontName)
                               EndIf
                       EndIf
                       $iComboFocus = 0
               EndIf
       EndIf
       If $iComboFocus1 Then
               If $aCursorInfo[2] Then
                       If ($aCursorInfo[0] > 128 And $aCursorInfo[0] < 158) And ($aCursorInfo[1] > 73 And $aCursorInfo[1] < 187) Then
                               If GUICtrlRead($hCombo1) <> $iFontSize Then
                                       $iFontSize = GUICtrlRead($hCombo1)
                                       $oIEDocument.execCommand("FontSize", False, $iFontSize)
                                       $iComboFocus1 = 0
                                       GUICtrlSetData($hCombo1, $iFontSize)
                               EndIf
                       EndIf
                       $iComboFocus1 = 0
               EndIf
       EndIf

       If $aCursorInfo[2] Or $aCursorInfo[3] Then
               $iComboFocus = 0
               $iComboFocus1 = 0
       EndIf

       If ($aCursorInfo[0] > 379 And $aCursorInfo[0] < 461) And ($aCursorInfo[1] > 7 And $aCursorInfo[1] < 107) Then
               If Not $iBIUGroupIs Then
                       GUICtrlSetState($hBIUGroup, 16)
                       $iBIUGroupIs = 1
               EndIf
       Else
               If $iBIUGroupIs Then
                       GUICtrlSetState($hBIUGroup, 32)
                       $iBIUGroupIs = 0
               EndIf
       EndIf

       If ($aCursorInfo[0] > 2 And $aCursorInfo[0] < 115) And ($aCursorInfo[1] > 7 And $aCursorInfo[1] < 107) Then
               If $iFontGroupIs = 0 Then
                       GUICtrlSetState($hFontGroup, 16)
                       _InfoUpdate($hFontGroup)
                       $iFontGroupIs = 1
               EndIf
       Else
               If $iFontGroupIs = 1 Then
                       GUICtrlSetState($hFontGroup, 32)
                       $iFontGroupIs = 0
               EndIf
       EndIf

       If ($aCursorInfo[0] > 120 And $aCursorInfo[0] < 168) And ($aCursorInfo[1] > 7 And $aCursorInfo[1] < 107) Then
               If $iFontSizeGroupIs = 0 Then
                       GUICtrlSetState($hFontSizeGroup, 16)
                       _InfoUpdate($hFontSizeGroup)
                       $iFontSizeGroupIs = 1
               EndIf
       Else
               If $iFontSizeGroupIs = 1 Then
                       GUICtrlSetState($hFontSizeGroup, 32)
                       $iFontSizeGroupIs = 0
               EndIf
       EndIf

       If ($aCursorInfo[0] > 232 And $aCursorInfo[0] < 275) And ($aCursorInfo[1] > 7 And $aCursorInfo[1] < 107) Then
               If $iUnReGroupIs = 0 Then
                       GUICtrlSetState($hUnReGroup, 16)
                       $iUnReGroupIs = 1
               EndIf
       Else
               If $iUnReGroupIs = 1 Then
                       GUICtrlSetState($hUnReGroup, 32)
                       $iUnReGroupIs = 0
               EndIf
       EndIf

       If ($aCursorInfo[0] > 280 And $aCursorInfo[0] < 373) And ($aCursorInfo[1] > 7 And $aCursorInfo[1] < 107) Then
               If $iCDCUPGroupIs = 0 Then
                       GUICtrlSetState($hCDCUPGroup, 16)
                       $iCDCUPGroupIs = 1
               EndIf
       Else
               If $iCDCUPGroupIs = 1 Then
                       GUICtrlSetState($hCDCUPGroup, 32)
                       $iCDCUPGroupIs = 0
               EndIf
       EndIf

       If ($aCursorInfo[0] > 173 And $aCursorInfo[0] < 227) And ($aCursorInfo[1] > 7 And $aCursorInfo[1] < 107) Then
               If $iColorGroupIs = 0 Then
                       GUICtrlSetState($hColorGroup, 16)
                       _InfoUpdate($hColorGroup)
                       $iColorGroupIs = 1
               EndIf
       Else
               If $iColorGroupIs = 1 Then
                       GUICtrlSetState($hColorGroup, 32)
                       $iColorGroupIs = 0
               EndIf
       EndIf

       If ($aCursorInfo[0] > 467 And $aCursorInfo[0] < 540) And ($aCursorInfo[1] > 7 And $aCursorInfo[1] < 107) Then
               If $iHIOUTHGroupIs = 0 Then
                       GUICtrlSetState($HIOUTHGroup, 16)
                       $iHIOUTHGroupIs = 1
               EndIf
       Else
               If $iHIOUTHGroupIs = 1 Then
                       GUICtrlSetState($HIOUTHGroup, 32)
                       $iHIOUTHGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hBoldPic Or $aCursorInfo[4] = $hBoldPic1 Then
               $iBoleadable = 0
               If Not $iBGroupIs Then
                       GUICtrlSetState($hBGroup, 16)
                       _InfoUpdate($hBoldPic)
                       $iBGroupIs = 1
               EndIf
       Else
               If $iBGroupIs Then
                       GUICtrlSetState($hBGroup, 32)
                       $iBGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hItalicPic Or $aCursorInfo[4] = $hItalicPic1 Then
               $iItaliced = 0
               If Not $iIGroupIs Then
                       GUICtrlSetState($hIGroup, 16)
                       _InfoUpdate($hItalicPic)
                       $iIGroupIs = 1
               EndIf
       Else
               If $iIGroupIs Then
                       GUICtrlSetState($hIGroup, 32)
                       $iIGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hUnderlinePic Or $aCursorInfo[4] = $hUnderlinePic1 Then
               $iUnderlinabled = 0
               If Not $iUGroupIs Then
                       GUICtrlSetState($hUGroup, 16)
                       _InfoUpdate($hUnderlinePic)
                       $iUGroupIs = 1
               EndIf
       Else
               If $iUGroupIs Then
                       GUICtrlSetState($hUGroup, 32)
                       $iUGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hUndoPic Then
               $iUndoedable = 0
               If $iUnGroupIs = 0 Then
                       GUICtrlSetState($hUnGroup, 16)
                       _InfoUpdate($hUndoPic)
                       $iUnGroupIs = 1
               EndIf
       Else
               If $iUnGroupIs = 1 Then
                       GUICtrlSetState($hUnGroup, 32)
                       $iUnGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hRedoPic Then
               $iRedoedable = 0
               If $iReGroupIs = 0 Then
                       GUICtrlSetState($hReGroup, 16)
                       _InfoUpdate($hRedoPic)
                       $iReGroupIs = 1
               EndIf
       Else
               If $iReGroupIs = 1 Then
                       GUICtrlSetState($hReGroup, 32)
                       $iReGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hCopyPic Then
               $iCopydable = 0
               If $iCGroupIs = 0 Then
                       GUICtrlSetState($hCGroup, 16)
                       _InfoUpdate($hCopyPic)
                       $iCGroupIs = 1
               EndIf
       Else
               If $iCGroupIs = 1 Then
                       GUICtrlSetState($hCGroup, 32)
                       $iCGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hDeletePic Then
               $iDeleteable = 0
               If $iDGroupIs = 0 Then
                       GUICtrlSetState($hDGroup, 16)
                       _InfoUpdate($hDeletePic)
                       $iDGroupIs = 1
               EndIf
       Else
               If $iDGroupIs = 1 Then
                       GUICtrlSetState($hDGroup, 32)
                       $iDGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hCutPic Then
               $iCuteable = 0
               If $iCUGroupIs = 0 Then
                       GUICtrlSetState($hCUGroup, 16)
                       _InfoUpdate($hCutPic)
                       $iCUGroupIs = 1
               EndIf
       Else
               If $iCUGroupIs = 1 Then
                       GUICtrlSetState($hCUGroup, 32)
                       $iCUGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hPastePic Then
               $iPasteable = 0
               If $iPGroupIs = 0 Then
                       GUICtrlSetState($hPGroup, 16)
                       _InfoUpdate($hPastePic)
                       $iPGroupIs = 1
               EndIf
       Else
               If $iPGroupIs = 1 Then
                       GUICtrlSetState($hPGroup, 32)
                       $iPGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hIndentPic Then
               $iIndentable = 0
               If $iIndentGroupIs = 0 Then
                       GUICtrlSetState($hIndentGroup, 16)
                       _InfoUpdate($hIndentPic)
                       $iIndentGroupIs = 1
               EndIf
       Else
               If $iIndentGroupIs = 1 Then
                       GUICtrlSetState($hIndentGroup, 32)
                       $iIndentGroupIs = 0
               EndIf
       EndIf
       If $aCursorInfo[4] = $hUnIndentPic Then
               $iUnIndentable = 0
               If $iUnIndentGroupIs = 0 Then
                       GUICtrlSetState($hUnIndentGroup, 16)
                       _InfoUpdate($hUnIndentPic)
                       $iUnIndentGroupIs = 1
               EndIf
       Else
               If $iUnIndentGroupIs = 1 Then
                       GUICtrlSetState($hUnIndentGroup, 32)
                       $iUnIndentGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hAligneLeftPic Or $aCursorInfo[4] = $hAligneLeftPic1 Then
               $iLeftable = 0
               If $iAligneLeftGroupIs = 0 Then
                       GUICtrlSetState($hAligneLeftGroup, 16)
                       _InfoUpdate($hAligneLeftPic)
                       $iAligneLeftGroupIs = 1
               EndIf
       Else
               If $iAligneLeftGroupIs = 1 Then
                       GUICtrlSetState($hAligneLeftGroup, 32)
                       $iAligneLeftGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hAligneCenterPic Or $aCursorInfo[4] = $hAligneCenterPic1 Then
               $iCenterable = 0
               If $iAligneCenterGroupIs = 0 Then
                       GUICtrlSetState($hAligneCenterGroup, 16)
                       _InfoUpdate($hAligneCenterPic)
                       $iAligneCenterGroupIs = 1
               EndIf
       Else
               If $iAligneCenterGroupIs = 1 Then
                       GUICtrlSetState($hAligneCenterGroup, 32)
                       $iAligneCenterGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hAligneRightPic Or $aCursorInfo[4] = $hAligneRightPic1 Then
               $iRightable = 0
               If $iAligneRightGroupIs = 0 Then
                       GUICtrlSetState($hAligneRightGroup, 16)
                       _InfoUpdate($hAligneRightPic)
                       $iAligneRightGroupIs = 1
               EndIf
       Else
               If $iAligneRightGroupIs = 1 Then
                       GUICtrlSetState($hAligneRightGroup, 32)
                       $iAligneRightGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hHyperPic Then
               $iHyperable = 0
               If $iHyperPicGroupIs = 0 Then
                       GUICtrlSetState($hHyperPicGroup, 16)
                       _InfoUpdate($hHyperPic)
                       $iHyperPicGroupIs = 1
               EndIf
       Else
               If $iHyperPicGroupIs = 1 Then
                       GUICtrlSetState($hHyperPicGroup, 32)
                       $iHyperPicGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hInsImagePic Then
               $iInsImable = 0
               If $iInsImagePicGroupIs = 0 Then
                       GUICtrlSetState($hInsImagePicGroup, 16)
                       _InfoUpdate($hInsImagePic)
                       $iInsImagePicGroupIs = 1
               EndIf
       Else
               If $iInsImagePicGroupIs = 1 Then
                       GUICtrlSetState($hInsImagePicGroup, 32)
                       $iInsImagePicGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hOrdered Then
               $iOrderable = 0
               If $iOrderedGroupIs = 0 Then
                       GUICtrlSetState($hOrderedGroup, 16)
                       _InfoUpdate($hOrdered)
                       $iOrderedGroupIs = 1
               EndIf
       Else
               If $iOrderedGroupIs = 1 Then
                       GUICtrlSetState($hOrderedGroup, 32)
                       $iOrderedGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hUnOrdered Then
               $iUnorderable = 0
               If $iUnOrderedGroupIs = 0 Then
                       GUICtrlSetState($hUnOrderedGroup, 16)
                       _InfoUpdate($hUnOrdered)
                       $iUnOrderedGroupIs = 1
               EndIf
       Else
               If $iUnOrderedGroupIs = 1 Then
                       GUICtrlSetState($hUnOrderedGroup, 32)
                       $iUnOrderedGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hSmileyPic Then
               If $iTablePicGroupIs = 0 Then
                       GUICtrlSetState($hSmileyPicGroup, 16)
                       _InfoUpdate($hSmileyPic)
                       $iTablePicGroupIs = 1
               EndIf
       Else
               If $iTablePicGroupIs = 1 Then
                       GUICtrlSetState($hSmileyPicGroup, 32)
                       $iTablePicGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hHorRulePic Then
               $iHorruleable = 0
               If $iHorRulePicGroupIs = 0 Then
                       GUICtrlSetState($hHorRulePicGroup, 16)
                       _InfoUpdate($hHorRulePic)
                       $iHorRulePicGroupIs = 1
               EndIf
       Else
               If $iHorRulePicGroupIs = 1 Then
                       GUICtrlSetState($hHorRulePicGroup, 32)
                       $iHorRulePicGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hOpenPic Then
               If $iOpenPicGroupIs = 0 Then
                       GUICtrlSetState($hOpenPicGroup, 16)
                       _InfoUpdate($hOpenPic)
                       $iOpenPicGroupIs = 1
               EndIf
       Else
               If $iOpenPicGroupIs = 1 Then
                       GUICtrlSetState($hOpenPicGroup, 32)
                       $iOpenPicGroupIs = 0
               EndIf
       EndIf
       If $aCursorInfo[4] = $hSavePic Then
               If $iSaveGroupIs = 0 Then
                       GUICtrlSetState($hSaveGroup, 16)
                       _InfoUpdate($hSavePic)
                       $iSaveGroupIs = 1
               EndIf
       Else
               If $iSaveGroupIs = 1 Then
                       GUICtrlSetState($hSaveGroup, 32)
                       $iSaveGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hRecyclePic Then
               If $iRecyclePicGroupIs = 0 Then
                       GUICtrlSetState($hRecyclePicGroup, 16)
                       _InfoUpdate($hRecyclePic)
                       $iRecyclePicGroupIs = 1
               EndIf
       Else
               If $iRecyclePicGroupIs = 1 Then
                       GUICtrlSetState($hRecyclePicGroup, 32)
                       $iRecyclePicGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hFontColorPic Or $aCursorInfo[4] = $hFoColSelectGroup Or $aCursorInfo[4] = $hFoColDoGroup Then
               If $iFoColGroupIs = 0 Then
                       GUICtrlSetState($hFoColGroup, 16)
                       $iFoColGroupIs = 1
               EndIf
       Else
               If $iFoColGroupIs = 1 Then
                       GUICtrlSetState($hFoColGroup, 32)
                       $iFoColGroupIs = 0
               EndIf
       EndIf

       If $aCursorInfo[4] = $hMarkerPic Or $aCursorInfo[4] = $hMarkerSelectGroup Or $aCursorInfo[4] = $hMarkerDoGroup Then
               If $MarkerGroupIs = 0 Then
                       GUICtrlSetState($hMarkerGroup, 16)
                       $MarkerGroupIs = 1
               EndIf
       Else
               If $MarkerGroupIs = 1 Then
                       GUICtrlSetState($hMarkerGroup, 32)
                       $MarkerGroupIs = 0
               EndIf
       EndIf

       If ($aCursorInfo[0] > 177 And $aCursorInfo[0] < 202) And ($aCursorInfo[1] > 47 And $aCursorInfo[1] < 71) Then
               If $MarkeDolGroupIs = 0 Then
                       GUICtrlSetState($hMarkerDoGroup, 16)
                       $MarkeDolGroupIs = 1
               EndIf
       Else
               If $MarkeDolGroupIs = 1 Then
                       GUICtrlSetState($hMarkerDoGroup, 32)
                       $MarkeDolGroupIs = 0
               EndIf
       EndIf

       If ($aCursorInfo[0] > 204 And $aCursorInfo[0] < 223) And ($aCursorInfo[1] > 47 And $aCursorInfo[1] < 71) Then
               If $MarkerSelectGroupIs = 0 Then
                       GUICtrlSetTip($hMarkerPic, "Select highlighting color")
                       GUICtrlSetState($hMarkerSelectGroup, 16)
                       $MarkerSelectGroupIs = 1
               EndIf
       Else
               If $MarkerSelectGroupIs = 1 Then
                       GUICtrlSetTip($hMarkerPic, "Highlight selected")
                       GUICtrlSetState($hMarkerSelectGroup, 32)
                       $MarkerSelectGroupIs = 0
               EndIf
       EndIf

       If ($aCursorInfo[0] > 177 And $aCursorInfo[0] < 202) And ($aCursorInfo[1] > 17 And $aCursorInfo[1] < 41) Then
               If $FoColDoGroupIs = 0 Then
                       GUICtrlSetTip($hFontColorPic, "Change font color")
                       GUICtrlSetState($hFoColDoGroup, 16)
                       $FoColDoGroupIs = 1
               EndIf
       Else
               If $FoColDoGroupIs = 1 Then
                       GUICtrlSetState($hFoColDoGroup, 32)
                       $FoColDoGroupIs = 0
               EndIf
       EndIf

       If ($aCursorInfo[0] > 204 And $aCursorInfo[0] < 223) And ($aCursorInfo[1] > 17 And $aCursorInfo[1] < 41) Then
               If $FoColSelectGroupIs = 0 Then
                       GUICtrlSetTip($hFontColorPic, "Select font color")
                       GUICtrlSetState($hFoColSelectGroup, 16)
                       $FoColSelectGroupIs = 1
               EndIf
       Else
               If $FoColSelectGroupIs = 1 Then
                       GUICtrlSetState($hFoColSelectGroup, 32)
                       $FoColSelectGroupIs = 0
               EndIf
       EndIf

       If Not ($iFontGroupIs Or $iFontSizeGroupIs Or $iColorGroupIs Or $iUnReGroupIs Or $iCDCUPGroupIs Or $iHIOUTHGroupIs _
                       Or $iUnGroupIs Or $iReGroupIs Or $iCGroupIs Or $iDGroupIs Or $iCUGroupIs Or $iPGroupIs Or $iIndentGroupIs Or $iUnIndentGroupIs _
                       Or $iAligneLeftGroupIs Or $iAligneCenterGroupIs Or $iAligneRightGroupIs _
                       Or $iHyperPicGroupIs Or $iInsImagePicGroupIs Or $iOrderedGroupIs Or $iUnOrderedGroupIs Or $iTablePicGroupIs Or $iHorRulePicGroupIs _
                       Or $iFoColGroupIs Or $MarkerGroupIs Or $MarkeDolGroupIs Or $MarkerSelectGroupIs Or $FoColDoGroupIs Or $FoColSelectGroupIs _
                       Or $iOpenPicGroupIs Or $iSaveGroupIs Or $iRecyclePicGroupIs) Then
               _InfoUpdate(1)
       EndIf

       If $iTikTip = 1 Then
               $hTimer = TimerInit()
               $iTikTip = 0
       ElseIf $iTikTip = 0 Then
               If TimerDiff($hTimer) > 1200 Then
                       ToolTip("")
                       $iTikTip = 2
                       $hTimer = 0
               EndIf
       EndIf

       $sFontNameNew = $oIEDocument.queryCommandValue("FontName")
       $iFontSizeNew = $oIEDocument.queryCommandValue("FontSize")

WEnd



; FUNCTIONS...

Func _InfoUpdate($iControl)

       Switch $iControl
               Case $hFontGroup
                       GUICtrlSetData($hInfoLabelData, "Font changing options." & @CRLF & "Web-safe fonts only.")
               Case $hFontSizeGroup
                       GUICtrlSetData($hInfoLabelData, "Change size of the font.")
               Case $hColorGroup
                       GUICtrlSetData($hInfoLabelData, "Color changing options." & @CRLF & "Change fore color or highlight important part of your message with selected color.")
               Case $hBoldPic
                       GUICtrlSetData($hInfoLabelData, "Change style to bold or to 'unbold' the text.")
               Case $hItalicPic
                       GUICtrlSetData($hInfoLabelData, "Change style to italic or to 'unitalic' the text.")
               Case $hUnderlinePic
                       GUICtrlSetData($hInfoLabelData, "Change style to underline and backward.")
               Case $hAligneLeftPic
                       GUICtrlSetData($hInfoLabelData, "Aligne text to the left.")
               Case $hAligneCenterPic
                       GUICtrlSetData($hInfoLabelData, "Click to center the text.")
               Case $hAligneRightPic
                       GUICtrlSetData($hInfoLabelData, "Aligne text to the right.")
               Case $hIndentPic
                       GUICtrlSetData($hInfoLabelData, "Insrease indent." & @CRLF & "Done by one indentation increment")
               Case $hUnIndentPic
                       GUICtrlSetData($hInfoLabelData, "Decrease by one increment if possible.")
               Case $hHyperPic
                       GUICtrlSetData($hInfoLabelData, "Make hyperlink out of selected text (or image).")
               Case $hInsImagePic
                       GUICtrlSetData($hInfoLabelData, "Click to open dialog for importing pictures.")
               Case $hOrdered
                       GUICtrlSetData($hInfoLabelData, "Insert odered list or to remove it.")
               Case $hUnOrdered
                       GUICtrlSetData($hInfoLabelData, "Insert unodered list or to remove it.")
               Case $hSmileyPic
                       GUICtrlSetData($hInfoLabelData, "Click to insert smiley.")
               Case $hHorRulePic
                       GUICtrlSetData($hInfoLabelData, "Insert horizontal rule.")
               Case $hUndoPic
                       GUICtrlSetData($hInfoLabelData, "Undo last action.")
               Case $hRedoPic
                       GUICtrlSetData($hInfoLabelData, "Click to redo.")
               Case $hCopyPic
                       GUICtrlSetData($hInfoLabelData, "Copy selected.")
               Case $hDeletePic
                       GUICtrlSetData($hInfoLabelData, "Delete selected.")
               Case $hCutPic
                       GUICtrlSetData($hInfoLabelData, "Cut selected." & @CRLF & "Same as 'Copy' and then 'Delete'")
               Case $hPastePic
                       GUICtrlSetData($hInfoLabelData, "Paste clipboard data.")
               Case $hOpenPic
                       GUICtrlSetData($hInfoLabelData, "Start 'Choose File' dialog.")
               Case $hSavePic
                       GUICtrlSetData($hInfoLabelData, "Save message to desired location" & @CRLF & "If you don't specify extension it will be automatically added (.htm).")
               Case $hRecyclePic
                       GUICtrlSetData($hInfoLabelData, "Recycle message." & @CRLF & "Use this option to dump opened message to the recycle bin.")
               Case 1
                       If GUICtrlRead($hInfoLabelData) Then GUICtrlSetData($hInfoLabelData, "")
       EndSwitch

EndFunc   ;==>_InfoUpdate


Func _MakeGUI()

       Local $sWindowName = "HTML editor"
       $hGui = GUICreate($sWindowName, 750, 521)
       GUISetBkColor(0xFFFFFA, $hGui)

       Local $sFontPic = $sTempDir & "font.bmp"
       FileInstall("HTML Picfont.bmp", $sFontPic, 1)
       Local $sFontSizePic = $sTempDir & "fontsize.bmp"
       FileInstall("HTML Picfontsize.bmp", $sFontSizePic, 1)
       Local $sFontColorPic = $sTempDir & "fontcol.bmp"
       FileInstall("HTML Picfontcol.bmp", $sFontColorPic, 1)
       Local $sMarkerPic = $sTempDir & "marker.bmp"
       FileInstall("HTML Picmarker.bmp", $sMarkerPic, 1)
       Local $sUndoPic = $sTempDir & "undo.bmp"
       FileInstall("HTML Picundo.bmp", $sUndoPic, 1)
       Local $sRedoPic = $sTempDir & "redo.bmp"
       FileInstall("HTML Picredo.bmp", $sRedoPic, 1)
       Local $sCopyPic = $sTempDir & "copy.bmp"
       FileInstall("HTML Piccopy.bmp", $sCopyPic, 1)
       Local $sDeletePic = $sTempDir & "delete.bmp"
       FileInstall("HTML Picdelete.bmp", $sDeletePic, 1)
       Local $sPastePic = $sTempDir & "paste.bmp"
       FileInstall("HTML Picpaste.bmp", $sPastePic, 1)
       Local $sCutPic = $sTempDir & "cut.bmp"
       FileInstall("HTML Piccut.bmp", $sCutPic, 1)
       Local $sBoldPic = $sTempDir & "bold.bmp"
       FileInstall("HTML Picbold.bmp", $sBoldPic, 1)
       Local $sItalicPic = $sTempDir & "italic.bmp"
       FileInstall("HTML Picitalic.bmp", $sItalicPic, 1)
       Local $sUnderlinePic = $sTempDir & "underline.bmp"
       FileInstall("HTML Picunderline.bmp", $sUnderlinePic, 1)
       Local $sBoldPic1 = $sTempDir & "bold1.bmp"
       FileInstall("HTML Picbold1.bmp", $sBoldPic1, 1)
       Local $sItalicPic1 = $sTempDir & "italic1.bmp"
       FileInstall("HTML Picitalic1.bmp", $sItalicPic1, 1)
       Local $sUnderlinePic1 = $sTempDir & "underline1.bmp"
       FileInstall("HTML Picunderline1.bmp", $sUnderlinePic1, 1)
       Local $sAligneLeftPic = $sTempDir & "alleft.bmp"
       FileInstall("HTML Picalleft.bmp", $sAligneLeftPic, 1)
       Local $sAligneCenterPic = $sTempDir & "alcenter.bmp"
       FileInstall("HTML Picalcenter.bmp", $sAligneCenterPic, 1)
       Local $sAligneRightPic = $sTempDir & "alright.bmp"
       FileInstall("HTML Picalright.bmp", $sAligneRightPic, 1)
       Local $sAligneLeftPic1 = $sTempDir & "alleft1.bmp"
       FileInstall("HTML Picalleft1.bmp", $sAligneLeftPic1, 1)
       Local $sAligneCenterPic1 = $sTempDir & "alcenter1.bmp"
       FileInstall("HTML Picalcenter1.bmp", $sAligneCenterPic1, 1)
       Local $sAligneRightPic1 = $sTempDir & "alright1.bmp"
       FileInstall("HTML Picalright1.bmp", $sAligneRightPic1, 1)
       Local $sMakeIntPic = $sTempDir & "int.bmp"
       FileInstall("HTML Picint.bmp", $sMakeIntPic, 1)
       Local $sMakeIntUnPic = $sTempDir & "intun.bmp"
       FileInstall("HTML Picintun.bmp", $sMakeIntUnPic, 1)
       Local $sHyperPic = $sTempDir & "hyper1.bmp"
       FileInstall("HTML Pichyper3.bmp", $sHyperPic, 1)
       Local $sInsImagePic = $sTempDir & "insimage.bmp"
       FileInstall("HTML Picinsimage2.bmp", $sInsImagePic, 1)
       Local $sOrderedPic = $sTempDir & "orderedlist.bmp"
       FileInstall("HTML Picorderedlist1.bmp", $sOrderedPic, 1)
       Local $sUnOrderedPic = $sTempDir & "unorderedlist.bmp"
       FileInstall("HTML Picunorderedlist1.bmp", $sUnOrderedPic, 1)
       Local $sSmileyPic = $sTempDir & "table.bmp"
       FileInstall("HTML Pictablex.bmp", $sSmileyPic, 1)
       Local $sHorRulePic = $sTempDir & "horrule.bmp"
       FileInstall("HTML Pichorrule.bmp", $sHorRulePic, 1)
       Local $sOpenPic = $sTempDir & "open.bmp"
       FileInstall("HTML Picopend.bmp", $sOpenPic, 1)
       Local $sSavePic = $sTempDir & "save.bmp"
       FileInstall("HTML Picsave.bmp", $sSavePic, 1)
       Local $sRecyclePic = $sTempDir & "recycle.bmp"
       FileInstall("HTML Picrecycle.bmp", $sRecyclePic, 1)
       Local $sLogoPic = $sTempDir & "HTMLlogo.bmp"
       FileInstall("HTML Pichtmllogo.bmp", $sLogoPic, 1)

       GUICtrlCreateLabel("", 3, 113, 614, 1)
       GUICtrlSetBkColor(-1, 0x0099FF)
       GUICtrlSetResizing(-1, 672)

       GUICtrlCreateLabel("", 3, 114, 615, 1)
       GUICtrlSetBkColor(-1, 0xCFCFCF)
       GUICtrlSetResizing(-1, 672)

       $hFontPic = GUICtrlCreatePic($sFontPic, 2, 12, 42, 42)

       $hFontLabel = GUICtrlCreateLabel("Times New Roman", 45, 27, 70, 33)
       GUICtrlSetFont(-1, -1, -1, 1, "Times New Roman")
       GUICtrlSetColor(-1, 0x000080)

       $hCombo = GUICtrlCreateCombo("Arial", 6, 73, 106, 20, 2097219)
       GUICtrlSetData($hCombo, "Comic Sans MS|Courier New|Georgia|Impact|Lucida Console|Lucida Sans Unicode|Palatino Linotype" _
                        & "|Tahoma|Times New Roman|Trebuchet MS|Verdana|MS Sans Serif|MS Serif", "Times New Roman")

       GUICtrlCreateLabel("", 117, 15, 1, 92)
       GUICtrlSetBkColor(-1, 0xDEDEDE)

       $hFontGroup = GUICtrlCreateGroup("", 2, 2, 113, 107)
       GUICtrlSetState(-1, 32)

       $hFontSizePic = GUICtrlCreatePic($sFontSizePic, 123, 12, 42, 42)

       $hFontSizeLabel = GUICtrlCreateLabel("3", 156, 27, 10, 15)
       GUICtrlSetFont(-1, 9, 400, 2, "Arial")
       GUICtrlSetColor(-1, 0x000080)

       $hCombo1 = GUICtrlCreateCombo("", 128, 73, 30, 20, 2097219)
       GUICtrlSetData($hCombo1, "1|2|3|4|5|6|7", "3")

       $hFontSizeGroup = GUICtrlCreateGroup("", 120, 2, 48, 107)
       GUICtrlSetState(-1, 32)

       GUICtrlCreateLabel("", 170, 15, 1, 92)
       GUICtrlSetBkColor(-1, 0xDEDEDE)

       $hColorGroup = GUICtrlCreateGroup("", 173, 2, 54, 107)
       GUICtrlSetState(-1, 32)

       $hFontColorPic = GUICtrlCreatePic($sFontColorPic, 176, 17, 48, 24)

       $hMarkerPic = GUICtrlCreatePic($sMarkerPic, 176, 47, 48, 24)

       $hFoColGroup = GUICtrlCreateGroup("", 175, 10, 50, 33)
       GUICtrlSetState(-1, 32)

       $hFoColDoGroup = GUICtrlCreateGroup("", 177, 12, 25, 29)
       GUICtrlSetState(-1, 32)

       $hFoColSelectGroup = GUICtrlCreateGroup("", 205, 12, 18, 29)
       GUICtrlSetState(-1, 32)

       $hMarkerGroup = GUICtrlCreateGroup("", 175, 40, 50, 33)
       GUICtrlSetState(-1, 32)

       $hMarkerDoGroup = GUICtrlCreateGroup("", 177, 42, 25, 29)
       GUICtrlSetState(-1, 32)

       $hMarkerSelectGroup = GUICtrlCreateGroup("", 205, 42, 18, 29)
       GUICtrlSetState(-1, 32)

       GUICtrlCreateLabel("", 229, 15, 1, 92)
       GUICtrlSetBkColor(-1, 0xDEDEDE)

       $hUndoPic = GUICtrlCreatePic($sUndoPic, 235, 12, 32, 32)

       $hRedoPic = GUICtrlCreatePic($sRedoPic, 240, 52, 32, 32)

       $hUnReGroup = GUICtrlCreateGroup("", 232, 2, 43, 107)
       GUICtrlSetState(-1, 32)

       $hUnGroup = GUICtrlCreateGroup("", 234, 5, 34, 41)
       GUICtrlSetState(-1, 32)

       $hReGroup = GUICtrlCreateGroup("", 239, 45, 34, 41)
       GUICtrlSetState(-1, 32)

       GUICtrlCreateLabel("", 277, 15, 1, 92)
       GUICtrlSetBkColor(-1, 0xDEDEDE)

       $hCopyPic = GUICtrlCreatePic($sCopyPic, 283, 12, 42, 42)

       $hDeletePic = GUICtrlCreatePic($sDeletePic, 328, 12, 42, 42)

       $hCutPic = GUICtrlCreatePic($sCutPic, 283, 57, 42, 42)

       $hPastePic = GUICtrlCreatePic($sPastePic, 328, 57, 42, 42)

       $hCDCUPGroup = GUICtrlCreateGroup("", 280, 2, 93, 107)
       GUICtrlSetState(-1, 32)

       $hCGroup = GUICtrlCreateGroup("", 282, 5, 44, 51)
       GUICtrlSetState(-1, 32)

       $hDGroup = GUICtrlCreateGroup("", 327, 5, 44, 51)
       GUICtrlSetState(-1, 32)

       $hCUGroup = GUICtrlCreateGroup("", 282, 50, 44, 51)
       GUICtrlSetState(-1, 32)

       $hPGroup = GUICtrlCreateGroup("", 327, 50, 44, 51)
       GUICtrlSetState(-1, 32)

       GUICtrlCreateLabel("", 375, 15, 1, 92)
       GUICtrlSetBkColor(-1, 0xDEDEDE)

       $hBoldPic = GUICtrlCreatePic($sBoldPic, 381, 12, 24, 24)

       $hItalicPic = GUICtrlCreatePic($sItalicPic, 408, 12, 24, 24)

       $hUnderlinePic = GUICtrlCreatePic($sUnderlinePic, 435, 12, 24, 24)

       $hBoldPic1 = GUICtrlCreatePic($sBoldPic1, 381, 12, 24, 24)
       GUICtrlSetState(-1, 32)

       $hItalicPic1 = GUICtrlCreatePic($sItalicPic1, 408, 12, 24, 24)
       GUICtrlSetState(-1, 32)

       $hUnderlinePic1 = GUICtrlCreatePic($sUnderlinePic1, 435, 12, 24, 24)
       GUICtrlSetState(-1, 32)

       $hBIUGroup = GUICtrlCreateGroup("", 378, 2, 84, 107)
       GUICtrlSetState(-1, 32)

       $hBGroup = GUICtrlCreateGroup("", 380, 5, 26, 33)
       GUICtrlSetState(-1, 32)

       $hIGroup = GUICtrlCreateGroup("", 407, 5, 26, 33)
       GUICtrlSetState(-1, 32)

       $hUGroup = GUICtrlCreateGroup("", 434, 5, 26, 33)
       GUICtrlSetState(-1, 32)

       GUICtrlCreateLabel("", 464, 15, 1, 92)
       GUICtrlSetBkColor(-1, 0xDEDEDE)

       $hAligneLeftPic = GUICtrlCreatePic($sAligneLeftPic, 381, 42, 24, 24)

       $hAligneCenterPic = GUICtrlCreatePic($sAligneCenterPic, 408, 42, 24, 24)

       $hAligneRightPic = GUICtrlCreatePic($sAligneRightPic, 435, 42, 24, 24)

       $hAligneLeftPic1 = GUICtrlCreatePic($sAligneLeftPic1, 381, 42, 24, 24)
       GUICtrlSetState(-1, 32)

       $hAligneCenterPic1 = GUICtrlCreatePic($sAligneCenterPic1, 408, 42, 24, 24)
       GUICtrlSetState(-1, 32)

       $hAligneRightPic1 = GUICtrlCreatePic($sAligneRightPic1, 435, 42, 24, 24)
       GUICtrlSetState(-1, 32)

       $hAligneLeftGroup = GUICtrlCreateGroup("", 380, 35, 26, 33)
       GUICtrlSetState(-1, 32)

       $hAligneCenterGroup = GUICtrlCreateGroup("", 407, 35, 26, 33)
       GUICtrlSetState(-1, 32)

       $hAligneRightGroup = GUICtrlCreateGroup("", 434, 35, 26, 33)
       GUICtrlSetState(-1, 32)

       $hIndentPic = GUICtrlCreatePic($sMakeIntPic, 392, 75, 24, 24)

       $hUnIndentPic = GUICtrlCreatePic($sMakeIntUnPic, 426, 75, 24, 24)

       $hIndentGroup = GUICtrlCreateGroup("", 391, 68, 26, 33)
       GUICtrlSetState(-1, 32)

       $hUnIndentGroup = GUICtrlCreateGroup("", 425, 68, 26, 33)
       GUICtrlSetState(-1, 32)

       $hHyperPic = GUICtrlCreatePic($sHyperPic, 475, 13, 24, 24)

       $hInsImagePic = GUICtrlCreatePic($sInsImagePic, 510, 13, 24, 24)

       $hOrdered = GUICtrlCreatePic($sOrderedPic, 475, 47, 24, 24)

       $hUnOrdered = GUICtrlCreatePic($sUnOrderedPic, 510, 47, 24, 24)

       $hSmileyPic = GUICtrlCreatePic($sSmileyPic, 475, 78, 24, 24)

       $hHorRulePic = GUICtrlCreatePic($sHorRulePic, 510, 78, 24, 24)

       $HIOUTHGroup = GUICtrlCreateGroup("", 467, 2, 73, 107)
       GUICtrlSetState(-1, 32)

       $hHyperPicGroup = GUICtrlCreateGroup("", 471, 5, 31, 35)
       GUICtrlSetState(-1, 32)

       $hInsImagePicGroup = GUICtrlCreateGroup("", 506, 5, 31, 35)
       GUICtrlSetState(-1, 32)

       $hOrderedGroup = GUICtrlCreateGroup("", 471, 36, 31, 35)
       GUICtrlSetState(-1, 32)

       $hUnOrderedGroup = GUICtrlCreateGroup("", 506, 36, 31, 35)
       GUICtrlSetState(-1, 32)

       $hSmileyPicGroup = GUICtrlCreateGroup("", 471, 67, 31, 35)
       GUICtrlSetState(-1, 32)

       $hHorRulePicGroup = GUICtrlCreateGroup("", 506, 67, 31, 35)
       GUICtrlSetState(-1, 32)

       GUICtrlCreateLabel("", 542, 15, 1, 92)
       GUICtrlSetBkColor(-1, 0xDEDEDE)

       GUICtrlCreateLabel("", 616, 114, 1, 398)
       GUICtrlSetBkColor(-1, 0x0099FF)
       GUICtrlSetResizing(-1, 356)

       GUICtrlCreateLabel("", 617, 114, 1, 398)
       GUICtrlSetBkColor(-1, 0xCFCFCF)
       GUICtrlSetResizing(-1, 356)

       $hInfoLabel = GUICtrlCreateLabel("What is it for?", 565, 15, 100, 25)
       GUICtrlSendMsg(-1, 48, $hFontInfoLabel, 1) ; WM_SETFONT
       GUICtrlSetColor(-1, 0x0099FF)
       GUICtrlSetTip(-1, "Drag cursor over desired item to display what is it for")

       $hInfoLabelData = GUICtrlCreateLabel("", 555, 41, 190, 63)
       GUICtrlSendMsg(-1, 48, $hFontInfoLabelData, 1) ; WM_SETFONT
       GUICtrlSetColor(-1, 0x8A8A8A)

       $sLogoPicpic = GUICtrlCreatePic($sLogoPic, 635, 109, 88, 36)
       GUICtrlSetResizing(-1, 804)
       GUICtrlSetTip(-1, "Logo")

       $hMiscGroup = GUICtrlCreateGroup("", 637, 183, 91, 201)
       GUICtrlSetResizing(-1, 292)

       $hOpenPic = GUICtrlCreatePic($sOpenPic, 670, 205, 24, 24)
       GUICtrlSetResizing(-1, 804)

       $hOpenPicGroup = GUICtrlCreateGroup("", 664, 194, 35, 41)
       GUICtrlSetState(-1, 32)
       GUICtrlSetResizing(-1, 804)

       $hSavePic = GUICtrlCreatePic($sSavePic, 670, 245, 24, 24)
       GUICtrlSetResizing(-1, 804)

       $hSaveGroup = GUICtrlCreateGroup("", 664, 233, 35, 41)
       GUICtrlSetState(-1, 32)
       GUICtrlSetResizing(-1, 804)

       $hRecyclePic = GUICtrlCreatePic($sRecyclePic, 664, 300, 36, 36)
       GUICtrlSetResizing(-1, 804)

       $hRecyclePicGroup = GUICtrlCreateGroup("", 664, 291, 35, 50)
       GUICtrlSetState(-1, 32)
       GUICtrlSetResizing(-1, 804)

       $hFinishedLabel = GUICtrlCreateLabel("Finished?", 647, 425, 70, 21)
       GUICtrlSetFont(-1, 9, 600, 1, "Trebuchet MS")

       GUICtrlSetColor(-1, 0x009933)
       GUICtrlSetTip(-1, "Click button below if you are")

       $hOKButton = GUICtrlCreateButton("That's it", 643, 450, 80, 25, -1, 8)
       GUICtrlSetFont(-1, 11, 800, 2, "Arial")

       GUICtrlSetTip(-1, "Finished writting")

       GUICtrlSetTip($hFontPic, "Font")
       GUICtrlSetTip($hFontLabel, "Current font")
       GUICtrlSetTip($hCombo, "Select font")
       GUICtrlSetTip($hFontSizePic, "Font size")
       GUICtrlSetTip($hCombo1, "Select font size")
       GUICtrlSetTip($hUndoPic, "Undo")
       GUICtrlSetTip($hRedoPic, "Redo")
       GUICtrlSetTip($hCopyPic, "Copy selected")
       GUICtrlSetTip($hDeletePic, "Delete selected")
       GUICtrlSetTip($hPastePic, "Paste")
       GUICtrlSetTip($hCutPic, "Cut selected")
       GUICtrlSetTip($hBoldPic, "Bold style")
       GUICtrlSetTip($hItalicPic, "Italic style")
       GUICtrlSetTip($hUnderlinePic, "Underline")
       GUICtrlSetTip($hAligneLeftPic, "Aligne left")
       GUICtrlSetTip($hAligneCenterPic, "Center")
       GUICtrlSetTip($hAligneRightPic, "Aligne right")
       GUICtrlSetTip($hAligneLeftPic1, "Aligned left")
       GUICtrlSetTip($hAligneCenterPic1, "Centered")
       GUICtrlSetTip($hAligneRightPic1, "Aligned right")
       GUICtrlSetTip($hIndentPic, "Indent")
       GUICtrlSetTip($hUnIndentPic, "Outdent")
       GUICtrlSetTip($hHyperPic, "Hyperlink")
       GUICtrlSetTip($hInsImagePic, "Image")
       GUICtrlSetTip($hOrdered, "Ordered list")
       GUICtrlSetTip($hUnOrdered, "UnOrdered list")
       GUICtrlSetTip($hSmileyPic, "Smiley")
       GUICtrlSetTip($hHorRulePic, "Horizontal rule")
       GUICtrlSetTip($hSavePic, "Save")
       GUICtrlSetTip($hRecyclePic, "Recycle")
       GUICtrlSetTip($hOpenPic, "Open previously saved")

       FileDelete($sFontPic)
       FileDelete($sFontSizePic)
       FileDelete($sUndoPic)
       FileDelete($sRedoPic)
       FileDelete($sCopyPic)
       FileDelete($sDeletePic)
       FileDelete($sPastePic)
       FileDelete($sCutPic)
       FileDelete($sBoldPic)
       FileDelete($sItalicPic)
       FileDelete($sUnderlinePic)
       FileDelete($sAligneLeftPic)
       FileDelete($sAligneCenterPic)
       FileDelete($sAligneRightPic)
       FileDelete($sAligneLeftPic1)
       FileDelete($sAligneCenterPic1)
       FileDelete($sMarkerPic)
       FileDelete($sHyperPic)
       FileDelete($sInsImagePic)
       FileDelete($sOrderedPic)
       FileDelete($sUnOrderedPic)
       FileDelete($sSmileyPic)
       FileDelete($sHorRulePic)
       FileDelete($sSavePic)
       FileDelete($sRecyclePic)
       FileDelete($sOpenPic)
       FileDelete($sLogoPic)
       FileDelete($sAligneRightPic1)
       FileDelete($sMakeIntPic)
       FileDelete($sItalicPic1)
       FileDelete($sFontColorPic)
       FileDelete($sUnderlinePic1)
       FileDelete($sMakeIntUnPic)
       FileDelete($sBoldPic1)

       $oIE = ObjCreate("Shell.Explorer.2")
       If Not IsObj($oIE) Then
               Exit
       EndIf

       $oError = ObjEvent("AutoIt.Error", "_ErrFunc_HTML")

       $hHMLControl = GUICtrlCreateObj($oIE, 1, 115, 615, 395)
       GUICtrlSetResizing(-1, 102)

       $oIE.navigate("about:blank")

       While 1
               If $oIE.readyState = "complete" Or $oIE.readyState = 4 Then ExitLoop
               Sleep(100)
       WEnd

       $oIEDocument = $oIE.document
       If Not IsObj($oIE) Then
               Exit
       EndIf

       $oIEDocument.write('<body onclick="return false" ondragover="return false">')
       $oIEDocument.execCommand("LiveResize")

       $oDocBody = $oIEDocument.body
       If Not IsObj($oDocBody) Then
               Exit
       EndIf

       $oDocBody.style.border = "None"
       $oDocBody.contentEditable = "True"
       $oDocBody.scroll = "Yes"

       $hIEHandle = _GetObjectWinHandle($oIE)
       $hIEDocumentHandle = _GetObjectWinHandle($oIEDocument)

       Return 1

EndFunc   ;==>_MakeGUI


Func _ErrFunc_HTML()

       If IsObj($oIEDocument) Then
               $oIEDocument.focus
               MouseClick("left")
               Sleep(500)
       Else
               Exit
       EndIf

EndFunc   ;==>_ErrFunc_HTML


Func _GetObjectWinHandle($oObject)

       Local $aCall = DllCall($hOLEACC, "int", "WindowFromAccessibleObject", _
                       "idispatch", $oObject, _
                       "hwnd*", 0)

       If @error Or $aCall[0] Then
               Return SetError(1, 0, 0)
       EndIf

       Return $aCall[2]

EndFunc   ;==>_GetObjectWinHandle


Func _SelectColor(ByRef $iDefault, $iStyle, $hOwner)

       Local $iFlag

       Switch $iStyle
               Case 1
                       $iFlag = 0x103
               Case 2
                       $iFlag = 0x101
       EndSwitch

       Local $tCHOOSECOLOR = DllStructCreate("dword Size;" & _
                       "hwnd Ownder;" & _
                       "ptr Instance;" & _
                       "dword Result;" & _
                       "ptr CustColors;" & _
                       "dword Flags;" & _
                       "ptr CustData;" & _
                       "ptr Hook;" & _
                       "ptr TemplateName")

       DllStructSetData($tCHOOSECOLOR, "Size", DllStructGetSize($tCHOOSECOLOR))
       DllStructSetData($tCHOOSECOLOR, "Ownder", $hOwner)
       DllStructSetData($tCHOOSECOLOR, "Result", $iDefault)
       DllStructSetData($tCHOOSECOLOR, "CustColors", DllStructGetPtr(DllStructCreate("dword[16]")))
       DllStructSetData($tCHOOSECOLOR, "Flags", $iFlag)

       Local $aCall = DllCall($hCOMDLG32, "long", "ChooseColor", "ptr", DllStructGetPtr($tCHOOSECOLOR))

       If @error Or Not $aCall[0] Then
               Return SetError(1, 0, -1)
       EndIf

       Local $iColor = DllStructGetData($tCHOOSECOLOR, "Result")

       If $iStyle = 2 Then
               $iDefault = $iColor
       EndIf

       Return $iColor

       Return "#" & Hex(BinaryMid($iColor, 1, 3))

EndFunc   ;==>_SelectColor


Func _CreateFont($iSize = 8.5, $iWeight = 400, $iAttribute = 0, $sFontName = "", $hWnd = 0)

       Local $iItalic = BitAND($iAttribute, 2)
       Local $iUnderline = BitAND($iAttribute, 4)
       Local $iStrikeout = BitAND($iAttribute, 8)

       Local $iQuality
       If BitAND($iAttribute, 16) Then
               $iQuality = 1 ; DRAFT_QUALITY
       ElseIf BitAND($iAttribute, 32) Then
               $iQuality = 2 ; PROOF_QUALITY
       ElseIf BitAND($iAttribute, 64) Then
               $iQuality = 3 ; NONANTIALIASED_QUALITY
       ElseIf BitAND($iAttribute, 128) Then
               $iQuality = 4 ; ANTIALIASED_QUALITY
       ElseIf BitAND($iAttribute, 256) Then
               $iQuality = 5 ; CLEARTYPE_QUALITY
       ElseIf BitAND($iAttribute, 512) Then
               $iQuality = 6 ; CLEARTYPE_COMPAT_QUALITY
       EndIf

       Local $aCall = DllCall($hUSER32, "hwnd", "GetDC", "hwnd", $hWnd)

       If @error Or Not $aCall[0] Then
               Return SetError(1, 0, 0)
       EndIf

       Local $hDC = $aCall[0]

       $aCall = DllCall($hGDI32, "int", "GetDeviceCaps", _
                       "hwnd", $hDC, _
                       "int", 90) ; LOGPIXELSY

       If @error Or Not $aCall[0] Then
               Return SetError(2, 0, 0)
       EndIf

       Local $iDCaps = $aCall[0]

       DllCall($hUSER32, "int", "ReleaseDC", "hwnd", $hWnd, "hwnd", $hDC)

       $aCall = DllCall($hGDI32, "hwnd", "CreateFontW", _
                       "int", -$iSize * $iDCaps / 72, _
                       "int", 0, _
                       "int", 0, _
                       "int", 0, _
                       "int", $iWeight, _
                       "dword", $iItalic, _
                       "dword", $iUnderline, _
                       "dword", $iStrikeout, _
                       "dword", 0, _
                       "dword", 0, _
                       "dword", 0, _
                       "dword", $iQuality, _
                       "dword", 0, _
                       "wstr", $sFontName)

       If @error Or Not $aCall[0] Then
               Return SetError(3, 0, 0)
       EndIf

       Local $hFont = $aCall[0]

       Return SetError(0, 0, $hFont)

EndFunc   ;==>_CreateFont


Func _MD5($sData)

       Local $bData = Binary($sData)
       Local $iBufferSize = BinaryLen($bData)

       Local $tData = DllStructCreate("byte[" & $iBufferSize & "]")
       DllStructSetData($tData, 1, $bData)

       Local $tMD5_CTX = DllStructCreate("dword i[2];" & _
                       "dword buf[4];" & _
                       "ubyte in[64];" & _
                       "ubyte digest[16]")

       DllCall($hADVAPI32, "none", "MD5Init", "ptr", DllStructGetPtr($tMD5_CTX))

       If @error Then
               Return SetError(1, 0, "")
       EndIf

       DllCall($hADVAPI32, "none", "MD5Update", _
                       "ptr", DllStructGetPtr($tMD5_CTX), _
                       "ptr", DllStructGetPtr($tData), _
                       "dword", $iBufferSize)

       If @error Then
               Return SetError(2, 0, "")
       EndIf

       DllCall($hADVAPI32, "none", "MD5Final", "ptr", DllStructGetPtr($tMD5_CTX))

       If @error Then
               Return SetError(3, 0, "")
       EndIf

       Return Hex(DllStructGetData($tMD5_CTX, "digest"))

EndFunc   ;==>_MD5


Func _SaveToFile(ByRef $sFile, $sData)

       Local $sName = StringRegExpReplace($sFile, ".*", "")

       Local $sDir = StringReplace($sFile, $sName, "")
       If Not $sDir Then $sDir = @MyDocumentsDir & "HTMLEditor"

       Local $sExtension = StringRegExpReplace($sFile, ".*.", "")
       If Not $sExtension Then $sExtension = "htm"

       Local $sSaveFile = FileSaveDialog("Save", $sDir, "(*." & StringLower($sExtension) & ")|All files (*.*)", 18, $sName, $hGui)

       If @error Then
               Return SetError(1, 0, 0)
       EndIf

       If Not (StringRight($sSaveFile, 4) = ".htm" Or StringRight($sSaveFile, 5) = ".html") Then
               $sSaveFile &= ".htm"
       EndIf

       Local $hFile = FileOpen($sSaveFile, 2)
       FileWrite($hFile, $sData)
       FileClose($hFile)

       $sFile = $sSaveFile

       Return 1

EndFunc   ;==>_SaveToFile


Func _Splash()

       Local $sLogoPic = @TempDir & "logo.bmp"
       FileInstall("HTML Piclogo.bmp", $sLogoPic, 1)
       SplashImageOn("{F2A76B6C-73EE-41CA-B0E3-639023BB9D3F}", $sLogoPic, 259, 63, @DesktopWidth - 270, @DesktopHeight - 100, 1)
       WinSetTrans("{F2A76B6C-73EE-41CA-B0E3-639023BB9D3F}", "", 200)
       FileDelete($sLogoPic)

EndFunc   ;==>_Splash


Func OnAutoItExit()

       FileDelete($sTempDir)
       DirRemove($sTempDir, 1)
       DirRemove($sTempDir)

EndFunc   ;==>OnAutoItExit


come posso generare l'html in un edit invece di un file.
 
Top
0 replies since 13/2/2010, 19:03   177 views
  Share