XeThanh Posted June 6, 2014 Share Posted June 6, 2014 Hello all there, The first I would like to apologize for my very bad english. I'm am writing an application and I feel Autoit language made me very interested and easy to apply. I having trouble sending string from my script to the WorldPad. I tried using the command ControlSetText to use, and it has successfully sent over the WorldPad text, but I do not understand why after sending it through WorldPad can not get the font color? I do not know how it can send the text color from tool send to WordPad. I hope everyone help me and i thank for this! Thank and good luck to all! And this is the code currently my use expandcollapse popup#Include <GuiRichEdit.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Global $hGui, $hRichEdit, $iMsg, $hControl $hGui = GUICreate("Document Send", 320, 180) $hRichEdit = _GUICtrlRichEdit_Create($hGui, "", 10, 10, 300, 120, _ BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) _GUICtrlRichEdit_SetCharColor($hRichEdit, "304050") _GUICtrlRichEdit_AppendText($hRichEdit, "This is more text") $SendBNT = GUICtrlCreateButton("Send Text", 190, 135, 120, 30) GUICtrlSetOnEvent($SendBNT, "GuiSendText") GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUISetState() While True $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE _GUICtrlRichEdit_Destroy($hRichEdit) ; needed unless script crashes Exit EndSelect WEnd Func GuiSendText() $ToText = _GUICtrlRichEdit_GetText($hRichEdit) $wWHND = WinGetHandle("Document - WordPad", "") ControlSetText($wWHND, "", "[CLASS:RICHEDIT50W; INSTANCE:1]", $ToText) EndFunc Func _GUICtrlRichEdit_AppendTextEx($hWnd, $sText) Local $hParent = _WinAPI_GetParent($hWnd) ControlSetText($hParent, '', $hWnd, $sText ) EndFunc Func _Exit() _GUICtrlRichEdit_Destroy($hRichEdit) GUIDelete() Exit EndFunc And Now Tool Send I want to here THANK FOR ALL HELPPPPP Link to comment Share on other sites More sharing options...
XeThanh Posted June 6, 2014 Author Share Posted June 6, 2014 Please help me!!! Pls... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 6, 2014 Moderators Share Posted June 6, 2014 XeThanh,Please do not bump your own threads within 24 hours. Remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
XeThanh Posted July 2, 2014 Author Share Posted July 2, 2014 HELP ME PLS!!! I WAITING TO LONGTIME!!!! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 2, 2014 Moderators Share Posted July 2, 2014 XeThanh,Please do not SHOUT! Remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. You need to use the _GUICtrlRichEdit_Copy/Paste functions like this:expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiRichEdit.au3> Opt("GUIOnEventMode", 1) $hGui = GUICreate("Document Send", 320, 180) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $hRichEdit = _GUICtrlRichEdit_Create($hGui, "", 10, 10, 300, 120, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) _GUICtrlRichEdit_SetCharColor($hRichEdit, 304050) _GUICtrlRichEdit_AppendText($hRichEdit, "This is more text") $SendBNT = GUICtrlCreateButton("Send Text", 190, 135, 120, 30) GUICtrlSetOnEvent($SendBNT, "GuiSendText") GUISetState() While 1 Sleep(10) ; No point in using GUIGetMsg in OnEvent mode <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< WEnd Func GuiSendText() ; get curretn selection $aSel = _GUICtrlRichEdit_GetSel($hRichEdit) ; Select all text _GUICtrlRichEdit_SetSel($hRichEdit, 0, -1) ; Caopy to clipboard _GUICtrlRichEdit_Copy($hRichEdit) ; Get WordPad edit handle - note on my Win7 system this is Instance 3 <<<<<<<<<<<<<<<<<<<<<<< $wWHND = ControlGetHandle("Document - WordPad", "", "[CLASS:RICHEDIT50W; INSTANCE:3]") ; Paste clipboard contents _GUICtrlRichEdit_Paste($wWHND) ; Reset original selection if stored If IsArray($aSel) Then _GUICtrlRichEdit_SetSel($hRichEdit, $aSel[0], $aSel[1]) Else _GUICtrlRichEdit_SetSel($hRichEdit, 0, 0) EndIf EndFunc Func _Exit() _GUICtrlRichEdit_Destroy($hRichEdit) GUIDelete() Exit EndFuncHappy now? M23 XeThanh 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
XeThanh Posted July 2, 2014 Author Share Posted July 2, 2014 XeThanh, Please do not SHOUT! Remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. You need to use the _GUICtrlRichEdit_Copy/Paste functions like this: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiRichEdit.au3> Opt("GUIOnEventMode", 1) $hGui = GUICreate("Document Send", 320, 180) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $hRichEdit = _GUICtrlRichEdit_Create($hGui, "", 10, 10, 300, 120, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) _GUICtrlRichEdit_SetCharColor($hRichEdit, 304050) _GUICtrlRichEdit_AppendText($hRichEdit, "This is more text") $SendBNT = GUICtrlCreateButton("Send Text", 190, 135, 120, 30) GUICtrlSetOnEvent($SendBNT, "GuiSendText") GUISetState() While 1 Sleep(10) ; No point in using GUIGetMsg in OnEvent mode <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< WEnd Func GuiSendText() ; get curretn selection $aSel = _GUICtrlRichEdit_GetSel($hRichEdit) ; Select all text _GUICtrlRichEdit_SetSel($hRichEdit, 0, -1) ; Caopy to clipboard _GUICtrlRichEdit_Copy($hRichEdit) ; Get WordPad edit handle - note on my Win7 system this is Instance 3 <<<<<<<<<<<<<<<<<<<<<<< $wWHND = ControlGetHandle("Document - WordPad", "", "[CLASS:RICHEDIT50W; INSTANCE:3]") ; Paste clipboard contents _GUICtrlRichEdit_Paste($wWHND) ; Reset original selection if stored If IsArray($aSel) Then _GUICtrlRichEdit_SetSel($hRichEdit, $aSel[0], $aSel[1]) Else _GUICtrlRichEdit_SetSel($hRichEdit, 0, 0) EndIf EndFunc Func _Exit() _GUICtrlRichEdit_Destroy($hRichEdit) GUIDelete() Exit EndFunc Happy now? M23 Thank MOD Melba23!!!!!!! It is amazing and I'm happy. It works well! Thank for you time support!!!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now