回复 1# dunphy
论坛有例子的,我稍微修改一下发下吧#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Clipboard.au3>
#include <WinAPI.au3>
#Region
Global $Form1 = GUICreate("如何复制", 348, 113, 724, 542, -1, 0)
Global $Input1 = GUICtrlCreateInput("", 88, 32, 65, 21)
Global $Label2 = GUICtrlCreateLabel("对应值:", 176, 32, 52, 17)
Global $Input2 = GUICtrlCreateInput("", 240, 32, 65, 21)
#EndRegion
$wProcNew = DllCallbackRegister("_MyWindowProc", "ptr", "hwnd;uint;long;ptr")
$wProcOld = _WinAPI_SetWindowLong(GUICtrlGetHandle($Input2), $GWL_WNDPROC, DllCallbackGetPtr($wProcNew))
_Main()
Exit
Func _Main()
GUISetState(@SW_SHOW)
While 1
Local $nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
EndFunc ;==>_Main
Func _MyWindowProc($hWnd, $uiMsg, $wParam, $lParam)
Switch $uiMsg
Case $WM_LBUTTONDBLCLK
$ss = GUICtrlRead($Input2)
If $ss = "" Then
MsgBox(64, "提示", "没有复制任何数据")
Else
ClipPut($ss)
MsgBox(64, "提示", "数据已经复制到剪切板")
EndIf
EndSwitch
Return _WinAPI_CallWindowProc($wProcOld, $hWnd, $uiMsg, $wParam, $lParam)
EndFunc ;==>_MyWindowProc
|