本帖最后由 jycel 于 2009-12-18 18:49 编辑
如图,文字消息从下面发送至上面已搞定,如果换成图片按文字消息处理不行,试过拷贝和粘贴命令没有成功,对RichEdit熟悉的请指教下!呵呵
不明之处:怎样从下面转移图片至上面,并保存至脚本同目录,同时判断框2是文字还是图片再执行!
代码如下:#Include <GuiEdit.au3>
#Include <Date.au3>
#Include <GuiRichEdit.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("RichEdit图片移动和内容测试", 633, 399, 192, 114)
$hRichEdit1=_GUICtrlRichEdit_Create($Form1,"", 16, 8, 425, 185,BitOR($ES_MULTILINE, $WS_VSCROLL,$ES_READONLY, $ES_AUTOVSCROLL))
$hRichEdit2=_GUICtrlRichEdit_Create($Form1,"", 16, 208, 425, 169,BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
$Button1 = GUICtrlCreateButton("移动并保存", 480, 48, 129, 81)
$Button2 = GUICtrlCreateButton("退出程序", 480, 240, 129, 97)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
GUIDelete()
Exit
Case $Button2
GUIDelete()
Exit
Case $Button1
If _GUICtrlRichEdit_GetText($hRichEdit2)="" Then
_GUICtrlRichEdit_AppendText($hRichEdit1,_Now()&@CRLF&"消息不能为空"&@CRLF)
Else
_GUICtrlRichEdit_AppendText($hRichEdit1, _Now()&@CRLF&_GUICtrlEdit_GetText($hRichEdit2)&@CRLF)
_GuiCtrlRichEdit_SetText($hRichEdit2,"");当发送后设置为空
guictrlsetstate($hRichEdit2, $GUI_FOCUS)
EndIf
EndSwitch
WEnd
|