单独使用已解决,应用到其它中还有点小小问题,继续研究
#include <GuiRichEdit.au3>
#include <GuiMenu.au3>
#include <GUIConstants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $hRichEdit, $mnu, $mnuUndo, $mnuRedo, $mnuCut, $mnuCopy
Global $mnuPaste, $mnuPasteSpl, $mnuPasteSplRTF, $mnuPasteSplwObjs
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 454, 192, 114)
$hRichEdit = _GUICtrlRichEdit_Create($Form1,""& @CR, 8, 8, 617, 369,BitOR($ES_MULTILINE, $WS_VSCROLL,$ES_READONLY, $ES_AUTOVSCROLL))
;_GUICtrlRichEdit_AppendText($hRichEdit, ReadBmpToRtf(FindFirstBMP(@ScriptDir)) & @CR)
$Button1 = GUICtrlCreateButton("Button1", 248, 416, 113, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $Button1
_GUICtrlRichEdit_AppendText($hRichEdit, ReadBmpToRtf(FindFirstBMP(@ScriptDir)) & @CR)
EndSwitch
WEnd
Func ReadBmpToRtf($sBmpFilspc)
Local $hFile, $sRtf
$hFile = FileOpen($sBmpFilspc, 16)
If FileRead($hFile, 2) <> "0x424D" Then Return SetError(1, 0, "")
FileRead($hFile, 12)
$sRtf = '{\rtf1{\pict\dibitmap ' & Hex(FileRead($hFile)) & '}}'
FileClose($hFile)
Return $sRtf
EndFunc ;==>ReadBmpToRtf
Func FindFirstBMP($sPath);@WindowsDir)
Local $hFind, $sBmpFilspc
$hFind = FileFindFirstFile($sPath& "\send.bmp")
$sBmpFilspc = FileFindNextFile($hFind)
FileClose($hFind)
Return $sPath & "\" & $sBmpFilspc
EndFunc ;==>FindFirstBMP
|