Jump to content
Sign in to follow this  
therks

Stop double click from copying label contents to clipboard?

Recommended Posts

therks

I'm not sure when this started happening but it's very annoying and it took me a while to realize it wasn't a bug in my code. Is there some way to keep this from happening? Is it a bug or a feature? I checked on a few other Static controls in Windows and it doesn't copy on double click so I can only think it's AutoIt exclusive.

AutoIt:3.3.9.5 (Os:WIN_7/SP1/X64 OSLang:0409)

Example:

#include <GUIConstants.au3>

$hGUI = GUICreate('', 150, 100)
GUICtrlCreateLabel('Double click me', 5, 5, 100, 20)
GUISetState()

ClipPut('Example')

While 1
    ToolTip('ClipGet() = ' & ClipGet())
    $iGUIGetMsg = GUIGetMsg()
    Switch $iGUIGetMsg
        Case $GUI_EVENT_CLOSE
            ExitLoop
    EndSwitch
WEnd
Edited by therks

Share this post


Link to post
Share on other sites
trancexx

It's a feature of Static controls. If you don't want it then remove SS_NOTIFY style.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
PhoenixXL

The reason of this problem is that the Label receives the WM_GETTEXT message when we double click on it. To stop this behavior, we can ignore the WM_GETTEXT message when double-clicking operation happens.

To do this, create a new class derived from the Label class and override the WndProc method. In the override method, if the Label has received the WM_LBUTTONDBLCLK message before it receives the WM_GETTEXT message, we ignore the WM_GETTEXT message.

The following is a sample:

class MyLabel:Label

{

int WM_GETTEXT = 0xD;

int WM_LBUTTONDBLCLK = 0x203;

bool doubleclickflag = false;

protected override void WndProc(ref Message m)

{

if (m.Msg == WM_LBUTTONDBLCLK)

{

doubleclickflag = true;

}

if (m.Msg == WM_GETTEXT && doubleclickflag)

{

doubleclickflag = false;

return;

}

base.WndProc(ref m);

}

}The reason of this problem is that the Label receives the WM_GETTEXT message when we double click on it. To stop this behavior, we can ignore the WM_GETTEXT message when double-clicking operation happens.

But how to use this class through Autoit [i dont have any idea]

I got this from this Link

Its not just for Autoit, its for all the Static controls in Windows Vista and above

try Subclassing

orelse try tracking the doubleclick event and restore the Clipboard


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
PhoenixXL

i tried to remove the SS_NOTIFY but it didnt work

This will work

Create the label with $SS_SIMPLE

& Disable the Label

This will stop receive you messages from the label and the text wont be copied

Code

#include-once
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$hGUI = GUICreate('', 150, 100)
GUICtrlCreateLabel('Double click me', 5, 5, 100, 20,0x0B)
GUICtrlSetState(-1,$GUI_DISABLE)
GUISetState()

ClipPut('Example')

While 1
ToolTip('ClipGet() = ' & ClipGet())
$iGUIGetMsg = GUIGetMsg()
Switch $iGUIGetMsg
Case $GUI_EVENT_CLOSE
ExitLoop
Case Else
If $iGUIGetMsg > 0 Then
ToolTip($iGUIGetMsg &amp; ':' &amp; GUICtrlRead($iGUIGetMsg))
EndIf
EndSwitch
WEnd
Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
Melba23

PhoenixXL,

Removing the SS_NOTIFY style is just one line: ;)

#include <GUIConstants.au3>

$hGUI = GUICreate('', 150, 100)
GUICtrlCreateLabel('Double click me', 5, 5, 100, 20)
GUICtrlSetStyle(-1, 0) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GUISetState()

ClipPut('Example')

While 1
    ToolTip('ClipGet() = ' & ClipGet())
    $iGUIGetMsg = GUIGetMsg()
    Switch $iGUIGetMsg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case Else
            If $iGUIGetMsg > 0 Then
                ToolTip($iGUIGetMsg & ':' & GUICtrlRead($iGUIGetMsg))
            EndIf
    EndSwitch
WEnd

Your subclassing idea is interesting but I am not sure that it is entirely correct. When I subclass the label as you propose I certainly do not get the content of the label on a double click, but the clipboard content is still erased: :(

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

OnAutoItExitRegister("_AutoExit")

Global $fDblClk = False

; Register callback function and obtain handle to _New_WndProc
$hNew_WndProc = DllCallbackRegister("_New_WndProc", "int", "hwnd;uint;wparam;lparam")

; Get pointer to _New_WndProc
Local $pNew_WndProc = DllCallbackGetPtr($hNew_WndProc)


$hGUI = GUICreate('', 150, 100)
$clabel = GUICtrlCreateLabel('Double click me', 5, 5, 100, 20)
GUISetState()

; Store old WndProc
$pOld_WndProc = _Label_SubClass(GUICtrlGetHandle($cLabel), $pNew_WndProc)


ClipPut('Example')

While 1
    ToolTip('ClipGet() = ' & ClipGet())
    $iGUIGetMsg = GUIGetMsg()
    Switch $iGUIGetMsg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case Else
            If $iGUIGetMsg > 0 Then
                ToolTip($iGUIGetMsg & ':' & GUICtrlRead($iGUIGetMsg))
            EndIf
    EndSwitch
WEnd


Func _New_WndProc($hWnd, $iMsg, $wParam, $lParam)

    ; Set DBLCLK flag if one detected
    If $iMsg = 0x203 Then
        $fDblClk = True
    EndIf

    ; If GETTEXT message sent
    If $iMsg = 0x000D Then ; WM_GETTEXT
        ; Check state of DBLCLK flag
        If $fDblClk Then
            ; Clear flag
            $fDblClk = False
            ; Ignore specific message from subclassed control
            Return 0
        Else
            ; Pass message to original WindowProc
            Return _WinAPI_CallWindowProc($pOld_WndProc, $hWnd, $iMsg, $wParam, $lParam)
        EndIf
    Else
        ; Pass other messages to original WindowProc
        Return _WinAPI_CallWindowProc($pOld_WndProc, $hWnd, $iMsg, $wParam, $lParam)
    EndIf

EndFunc   ;==>_New_WndProc

Func _Label_SubClass($hWnd, $pNew_WindowProc)

    Local $iRes = _WinAPI_SetWindowLong($hWnd, -4, $pNew_WindowProc)
    If @error Then Return SetError(1, 0, 0)
    If $iRes = 0 Then Return SetError(1, 0, 0)
    Return $iRes

EndFunc   ;==>_Label_SubClass

Func _AutoExit()

    ; Unsubclass the label
    _Label_SubClass(GUICtrlGetHandle($cLabel), $pOld_WndProc)
    ; Now free UDF created WndProc
    DllCallbackFree($hNew_WndProc)

EndFunc

So I think there is something else going on with the clipboard. ;)

Anyway, trancexx's solution works fine - and is a lot simpler! :D

M23

Edit:

In fact all you need to do is to prevent the DBLCLK message being actioned: ;)

Func _New_WndProc($hWnd, $iMsg, $wParam, $lParam)

    If $iMsg = 0x203 Then
        Return 0
    EndIf

EndFunc   ;==>_New_WndProc

But I would still just remove the SS_NOTIFY style. :)

Edited by Melba23
Added code

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
PhoenixXL

Yup

removing SS_NOTIFY works that way

but this is even the same thing i guess then why isnt this working

#include <GUIConstants.au3>

$hGUI = GUICreate('', 150, 100)
GUICtrlCreateLabel('Double click me', 5, 5, 100, 20,0)
;GUICtrlSetStyle(-1, 0) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GUISetState()

ClipPut('Example')

While 1
ToolTip('ClipGet() = ' & ClipGet())
$iGUIGetMsg = GUIGetMsg()
Switch $iGUIGetMsg
Case $GUI_EVENT_CLOSE
ExitLoop
Case Else
If $iGUIGetMsg > 0 Then
ToolTip($iGUIGetMsg & ':' & GUICtrlRead($iGUIGetMsg))
EndIf
EndSwitch
WEnd

and BTW does the following work

#include-once
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
$hGUI = GUICreate('', 150, 100)
GUICtrlCreateLabel('Double click me', 5, 5, 100, 20,0x0B)
GUICtrlSetState(-1,$GUI_DISABLE)
GUISetState()

ClipPut('Example')

While 1
ToolTip('ClipGet() = ' & ClipGet())
$iGUIGetMsg = GUIGetMsg()
Switch $iGUIGetMsg
Case $GUI_EVENT_CLOSE
ExitLoop
Case Else
If $iGUIGetMsg > 0 Then
ToolTip($iGUIGetMsg & ':' &GUICtrlRead($iGUIGetMsg))
EndIf
EndSwitch
WEnd
Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
therks

Unfortunately I can't just disable double clicking entirely in my program because I'm actually using the double click to trigger something. I just don't want it to affect the clipboard.

*Edit: I actually thought that copying label contents to clipboard on double click was something that happened only recently, and I was thinking it was almost bug-like, but I just found an old compiled script (3.1.1.61) and labels in it do the same thing, so I guess I just over looked it all this time.

*Edit 2: Although I just tested on a WinXP VM and it doesn't copy, so maybe that's where I'm getting mixed up (I haven't done nearly as much scripting since I moved to Win 7).

Edited by therks

Share this post


Link to post
Share on other sites
rover

Stop double click from copying label contents to clipboard?

CS_DBLCLKS style issue again.

My solution for the static/button click lag/slowdown issue a few years back solves this one too.

#include <GUIConstants.au3>
#include <WinAPIEx.au3>

$hGUI = GUICreate('', 150, 100)
$cLbl = GUICtrlCreateLabel('Double click me', 5, 5, 100, 20)
_Remove_CS_DBLCLKS(-1)
GUISetState()

ClipPut('Example')

While 1
ToolTip('ClipGet() = ' & ClipGet())
$iGUIGetMsg = GUIGetMsg()
Switch $iGUIGetMsg
     Case $GUI_EVENT_CLOSE
         ExitLoop
;Case $cLbl
;ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $cLbl = ' & $cLbl & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
     Case Else
         If $iGUIGetMsg > 0 Then
             ToolTip($iGUIGetMsg & ':' & GUICtrlRead($iGUIGetMsg))
         EndIf
EndSwitch
WEnd


Func _Remove_CS_DBLCLKS($Ctrl)
;Author; rover 2k9 - updated 2k12
;Requires WinAPIEx.au3
;
;Removes the CS_DBLCLKS style from Static or Button class controls
;Fixes the issue of slow response(lag) with Labels or colour Buttons when rapidly clicking with the mouse
;
;NOTE: Run one time only on the first control created in your script process with the control class you want to remove this style from
;All subsequently created controls of the Static or Button class for the current process will not have the CS_DBLCLKS style
;http://www.autoitscript.com/forum/topic/90309-why-the-huge-performance-hit/page__view__findpost__p__663443
If Not IsHWnd($Ctrl) Then
$Ctrl = GUICtrlGetHandle($Ctrl)
If Not IsHWnd($Ctrl) Then Return SetError(1, 0, 0)
EndIf
If Not IsDeclared("GCL_STYLE") Then Local Const $GCL_STYLE = -26
If Not IsDeclared("CS_DBLCLKS") Then Local Const $CS_DBLCLKS = 0x8
Local $ClassStyle = _WinAPI_GetClassLongEx($Ctrl, $GCL_STYLE)
If @error Or Not $ClassStyle Then Return SetError(2, @error, 0)
Local $NewStyle = BitAND($ClassStyle, BitNOT($CS_DBLCLKS))
_WinAPI_SetClassLongEx($Ctrl, $GCL_STYLE, $NewStyle)
If @error Then Return SetError(3, @error, 0)
Local $ClassChk = _WinAPI_GetClassLongEx($Ctrl, $GCL_STYLE)
If @error Or Not $ClassChk Then Return SetError(4, @error, 0)
If $ClassStyle = $ClassChk Then Return SetError(5, 0, 0)
Return SetError(0, 0, 1)
EndFunc ;==>_Remove_CS_DBLCLKS

I see fascists...

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • Paxman
      By Paxman
      Just seem to have hit a bit of a hurdle.
      I am trying to get Autoit to tick a box in a dialogue box. However no windows shortcut works (eg. spacebar etc.).
      So having moved to the tick box (how can i produce a double click of the mouse (which ticks the box) without moving the mouse each time. I will need to do this many times in a tall dialogue box you need to scroll through if trying to use the mouse to do it?
      Can i map a keyboard shortcut or something?
      Thanks
      Neil
       
    • dadalt95
      By dadalt95
      Hi!
      I want to get the signal in this website:
      https://binary-signal.com/pt/chart/eurusd
      I have tried using _IEBodyReadText  and some _StringBetween. What happens is that the text are being update every tick and _IEBodyReadText doesn't.
      To perform the update I used  _IEAction($oIE, "refresh") but it's not good because the website block me after some time due too many requests..
      Is there any other way to get this text every tick?
      PS: The text I want to get is WAIT, CALL or PUT.
       
      Here is the code:
      global $oIE = _IECreate ('https://binary-signal.com/pt/chart/eurusd', 0, 1 , 1 , 0) Local $sText = _IEBodyReadText($oIE) $result = _StringBetween ( $sText , 'PUTEUR/USD on Binary-signal.com', 'sinal está PRONTA') ;MsgBox ( 0, "asf", $result[0]) $espera=StringInStr($result[0], "WAIT") $compra=StringInStr($result[0], "CALL") $venda=StringInStr($result[0], "PUT") ;MsgBox($MB_SYSTEMMODAL, "", $espera) $n=0 $c=0 Captar() Func Captar() ;_IENavigate($oIE, "https://binary-signal.com/pt/chart/eurusd") ;MsgBox($MB_SYSTEMMODAL, "", $n) Local $sText = _IEBodyReadText($oIE) $result = _StringBetween ( $sText , 'PUTEUR/USD on Binary-signal.com', 'sinal está PRONTA') If (Not $compra=0) And $n=0 Then MsgBox($MB_SYSTEMMODAL, "", "COMPRE") $n=1 $c=$c+1 ;_IEAction($oIE, "refresh") Sleep(60000) Captar() ElseIf (Not $venda=0) And $n=0 Then MsgBox($MB_SYSTEMMODAL, "", "VENDA") $c=$c+1 $n=1 ;_IEAction($oIE, "refresh") ;MsgBox($MB_SYSTEMMODAL, "", $n) Sleep(60000) Captar() ElseIf (Not $venda=0) And $n=1 Then ;MsgBox($MB_SYSTEMMODAL, "", "Esperando próxima rodada") $n=1 ;MsgBox($MB_SYSTEMMODAL, "", $n) ;_IEAction($oIE, "refresh") Sleep(60000) Captar() ElseIf (Not $venda=0) And $n=1 Then ;MsgBox($MB_SYSTEMMODAL, "", "Esperando próxima rodada") $n=1 ;MsgBox($MB_SYSTEMMODAL, "", $n) ;_IEAction($oIE, "refresh") Sleep(60000) Captar() Else ;MsgBox("", "", "ESPERE") $n=0 Sleep(1000) ;_IEAction($oIE, "refresh") Local $sText = _IEBodyReadText($oIE) $result = _StringBetween ( $sText , 'PUTEUR/USD on Binary-signal.com', 'sinal está PRONTA') Captar() EndIf EndFunc  
    • Pike
      By Pike
      Hello Everyone,
      New Guy here. This is a two-part question, hopefully easy enough though. I know it's ugly coding, this is because I have only a couple hours worth of coding experience and could really use some help.
      1) When I single click the button I want one action (like playing a sound clip) and when I double click the button I want a different action (such as opening dialogue box to ask for soundclip directory address). At the bottom of the script I made a comment which one I would like single click versus double click.
      2) I can not get the FileOpenDialogue to save the file address to the config.ini file at the 'One' position on the .ini.
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <FileConstants.au3> #include <AutoItConstants.au3> #include <Sound.au3> Opt('MustDeclareVars', 1) Opt("GUIOnEventMode", 1) Global $OneID _Main() Func _Main() GUICreate("Form1", 156, 86, 281, 276) $OneID = GUICtrlCreateButton("Button", 15, 17, 122, 37) GUICtrlSetOnEvent($OneID, "OnOne") GUISetOnEvent($GUI_EVENT_CLOSE, "OnExit") GUISetState() While 1 While 1 Sleep(1000) WEnd WEnd EndFunc ;---------------Functions------------- While 1 Sleep(100) WEnd Func OnOne() ; ******************Single Click for this action**************** $OneID = IniRead("config.ini", "Config", "One", $OneID) If $OneID = True Then SoundPlay($OneID, @HotKeyPressed) Else ; *******Double Click for this action*****And Help Saving File Address to config.ini 'One'*********** $OneID = FileOpenDialog("Select file", @WorkingDir, "All (*.*)") IniWrite("config.ini", "Config", "One", $OneID) $OneID = InputBox("Enter Information", "Short Name for File?", "") IniWrite("config.ini", "Config", "NameOne", $OneID) EndIf EndFunc Any help would be greatly appreciated, and if you need anymore clarity as to what exactly I'm trying to do, please do not hesitate to ask. Thanks so much!
      Pike
    • PoojaKrishna
      By PoojaKrishna
      Hi friends,
      Is there any way to detect the left double clicks like we get the primary clicks  using _IsPressed("01").
      We can detect double clicks by initiating a timer and finding the delay between left clicks on same coordinates but still want to if there is a better direct way.
      Thank you friends.
       
      #Include <Misc.au3> ; Used for the _IsPressed HotKeySet("{ESC}", "_ExitScript") ;Hot key Esc to Exit script $nCountClick = 0 ;Click Count While 1 ; Loop until user presses ESc to exit the Recorder If _IsPressed("01") then ; If left mouse is pushed. While (_IsPressed("01")) ;Wait until user releases button Sleep(100) WEnd $pos = MouseGetPos() ; Get the position. $nCountClick = $nCountClick + 1 ;Add click count ToolTip($nCountClick & ") " & 'Left Clicked X: ' & $pos[0] & ', Y: ' & $pos[1]) ;Show the click count with position EndIf WEnd Func _ExitScript() ;HotKet method to Exit script Exit EndFunc ;=> _ExitScript  
    • AndyS19
      By AndyS19
      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[1][2] = [["^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
       
×