I want to copy just the selected text in an input control and put it to the clipboard, but GuiCtrlRead() always reads all of the text in the control.
In this test code, when I highlight a portion of the left control's text and press ^C, I want to copy just that text to the clipboard; but when I highlight a portion of the right control's text and press ^C, I want to copy all of its text to the clipboard.
#include <Debug.au3> _DebugSetup(@ScriptName & "_debug.txt", False, 2, "") _DebugOut("=============== " & @MON & "/" & @MDAY & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & " ====================") #include <GUIConstants.au3> #include <WinAPI.au3> #include <Array.au3> Opt("GUICloseOnESC", 1) ; ESC closes GUI? (0 = no, 1 = yes) Opt("GUIOnEventMode", 1) ; Set OnEvent mode Opt('MustDeclareVars', 1) OnAutoItExitRegister("Event_GUIClose") Opt("GUIEventOptions", 1) ;0=default, 1=just notification, 2=GuiCtrlRead tab index Opt("WinTitleMatchMode", -2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase Global $hWnd_MainWin, $iID_Left, $iID_Right _Main() Func _Main() $hWnd_MainWin = GUICreate("test7", 200, 300) $iID_Left = GUICtrlCreateInput("AAA BBB CCC (get Selected text)", 10, 30, 200, 25) GUICtrlSetOnEvent($iID_Left, "handle_left_btn") $iID_Right = GUICtrlCreateInput("DDD EEE FFF (get All text)", 10, 60, 200, 25) GUICtrlSetOnEvent($iID_Right, "handle_right_btn") Local $aAccelKeys = [["^c", $hWnd_MainWin]] GUISetAccelerators($aAccelKeys) GUISetOnEvent($GUI_EVENT_CLOSE, 'Event_GUIClose') GUISetState() ; Make everything visible While 1 Sleep(127) WEnd EndFunc ;==>_Main Func handle_CTRL_C_key() ConsoleWrite("+++: handle_CTRL_C_key() entered" & @CRLF) Local $hCtrl, $ctrlID, $control_classname, $text $control_classname = ControlGetFocus($hWnd_MainWin) $hCtrl = ControlGetHandle($hWnd_MainWin, "", $control_classname) $ctrlID = _WinAPI_GetDlgCtrlID($hCtrl) If ($ctrlID = $iID_Left) Then $text = GUICtrlRead($ctrlID) ClipPut($text) ConsoleWrite("+++: Copied selected text:" & @CRLF & "==>" & $text & "<==" & @CRLF) ElseIf ($ctrlID = $iID_Right) Then $text = GUICtrlRead($ctrlID) ClipPut($text) ConsoleWrite("+++: Copied all text:" & @CRLF & "==>" & $text & "<==" & @CRLF) EndIf EndFunc ;==>handle_CTRL_C_key Func Event_GUIClose() Exit (99) EndFunc ;==>Event_GUIClose Func handle_left_btn() ConsoleWrite("+++: handle_left_btn() entered" & @CRLF) EndFunc ;==>handle_left_btn Func handle_right_btn() ConsoleWrite("+++: handle_right_btn() entered" & @CRLF) EndFunc ;==>handle_right_btn
Hello to you, dear developers!
Could you please tell me if there is an easy way to determine if the information was pasted from the clipboard?
Without any variation of the insertion via Ctrl+V, or through the context menu.
I revised the Help and many forum topics, but found nothing suitable.
Can there be any WinAPI system events that determine this event?
I have excel file like this
and i want to cut cell/text from excel to other software.
I have to cut the cell of B column one by one and past into other software
If Winexists("No Data Found")
then restore cuted cell and goto next/down side cell
How to do it ?
Is it possible , and how can I read and write txt files from Icloud (apple service) ?
Let me try to explain my application.
On my Ipad and Iphone I create txt files. On my windows computer it is possible to read and modify these files manually, by logging in on www.icloud.com.
What I want to make is an auto-it script who reads the txt file and create an new txt file on www.icloud.com, so I can acces these on my ipad and/or phone.
cause im too new in the Auto it world i will try it with the your help. hopefully.
I woud like to know how i can handle my Problem.
I have a Excel Data with 362 random numbers.
this numbers are a part of the filepath ...example
as u can see its the first number of the Excel data. After the first 4 numbers it shoud make a "_" than another 5 "_"
This is my first question. How can i handle this to make it Shell execute.
If i am in the path.
the code shoud search for specific PDF Files.
They are named like: 0050569E364B1ED79B900F73E62660EC.pdf
the first 15 letters are always the same
when he found this data he has to copy it on a Folder on the Desktop.
(There can also be 2 or 3 pdfs in one Folder with this letters)
Please give me some help :-)