youtuber Posted August 24, 2017 Posted August 24, 2017 I want to block right click on Input2 expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 799, 216) $Input1 = GUICtrlCreateInput("", 72, 48, 641, 21) $Input2 = GUICtrlCreateInput("",72, 88, 649, 21,2305);Input2 right click copy blocking $Input3 = GUICtrlCreateInput("", 72, 128, 649, 21) $Button1 = GUICtrlCreateButton("Button1", 72, 160, 75, 25) $aCopy = GUICtrlCreateButton("C", 727, 86, 35, 25) GUISetState(@SW_SHOW) Local $input0 While 1 $inputcontrol = GUICtrlRead($Input1) If $inputcontrol <> $input0 Then GUICtrlSetData($Input2,_GenerateID()) $input0 = $inputcontrol EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If guictrlread($input1) = "" or guictrlread($Input3) = "" Then MsgBox(0,"Error", "No entered",5) Else MsgBox(48,"Ok","OK",5) EndIf Case $aCopy If guictrlread($input1) = "" Then MsgBox(48,"Error","No entered",5) Else ClipPut(GUICtrlRead($Input2)) ToolTip('Copied ok..') Sleep(500) ToolTip("") EndIf EndSwitch WEnd Func _GenerateID() $Characters = StringSplit("ABCDEF0123456789", "") $Addrand = "" For $I = 1 To 15 $Addrand &= $Characters[Random(1, 16, 1)] Next Return $Addrand EndFunc
Danp2 Posted August 24, 2017 Posted August 24, 2017 Have you reviewed this thread? youtuber 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
youtuber Posted August 24, 2017 Author Posted August 24, 2017 I guess this is not a problem right? expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPIShellEx.au3> $Form1 = GUICreate("Form1", 799, 216) $Input1 = GUICtrlCreateInput("", 72, 48, 641, 21) Local $Input2 = GUICtrlCreateInput("",72, 88, 649, 21,2305);Input2 right click copy blocking Local $hMyedit = GUICtrlGetHandle( $Input2 ) $Input3 = GUICtrlCreateInput("", 72, 128, 649, 21) $Button1 = GUICtrlCreateButton("Button1", 72, 160, 75, 25) $aCopy = GUICtrlCreateButton("C", 727, 86, 35, 25) Local $pEditCallback = DllCallbackGetPtr( DllCallbackRegister( "EditCallback", "lresult", "hwnd;uint;wparam;lparam;uint_ptr;dword_ptr" ) ) _WinAPI_SetWindowSubclass( $hMyedit, $pEditCallback, 1, 0 ) ; $iSubclassId = 1, $pData = 0 GUISetState(@SW_SHOW) Local $input0 While 1 $inputcontrol = GUICtrlRead($Input1) If $inputcontrol <> $input0 Then GUICtrlSetData($Input2,_GenerateID()) $input0 = $inputcontrol EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If guictrlread($input1) = "" or guictrlread($Input3) = "" Then MsgBox(0,"Error", "No entered",5) Else MsgBox(48,"Ok","OK",5) EndIf Case $aCopy If guictrlread($input1) = "" Then MsgBox(48,"Error","No entered",5) Else ClipPut(GUICtrlRead($Input2)) ToolTip('Copied ok..') Sleep(500) ToolTip("") EndIf EndSwitch WEnd Func _GenerateID() $Characters = StringSplit("ABCDEF0123456789", "") $Addrand = "" For $I = 1 To 15 $Addrand &= $Characters[Random(1, 16, 1)] Next Return $Addrand EndFunc Func EditCallback( $hWnd, $iMsg, $wParam, $lParam, $iSubclassId, $pData ) ; If $iMsg <> $WM_RBUTTONUP then call next function in subclass chain (this forwards messages to Edit control) If $iMsg <> $WM_RBUTTONUP Then Return DllCall( "comctl32.dll", "lresult", "DefSubclassProc", "hwnd", $hWnd, "uint", $iMsg, "wparam", $wParam, "lparam", $lParam )[0] Return 0 ; If $iMsg = $WM_RBUTTONUP then cancel the message by returning 0 EndFunc
Danp2 Posted August 24, 2017 Posted August 24, 2017 49 minutes ago, youtuber said: I guess this is not a problem right? Appears to work to me. Did you have a specific concern / issue? Latest Webdriver UDF Release Webdriver Wiki FAQs
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