GoravG Posted May 13, 2015 Share Posted May 13, 2015 Global Const $GUI_EVENT_CLOSE = -3 _Main() Func _Main() Local $OCSE2, $GUIActiveX, $gui_button_Exit, $Msg $OCSE2 = ObjCreate("Shell.Explorer.2") GUICreate("Google", 800, 400, (@DesktopWidth - 400) / 2, (@DesktopHeight - 400) / 2) GUISetBkColor(0x000000) $GUIActiveX = GUICtrlCreateObj($OCSE2, 10, 45, 780, 350) $gui_button_Exit = GUICtrlCreateButton("Exit", 710, 5, 80, 30) GUICtrlSetBkColor(-1, 0xFFFFFF) $OCSE2.navigate("http:\\www.google.com") GUISetState() While 1 $Msg = GUIGetMsg() Select Case $Msg = $GUI_EVENT_CLOSE ExitLoop Case $Msg = $gui_button_Exit = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GUIDelete() EndFunci am new no idea to disable right click in GUICtrlCreateObj I am new, i am not programmer..... Sorry my bad English...... Link to comment Share on other sites More sharing options...
MikahS Posted May 13, 2015 Share Posted May 13, 2015 (edited) Have a look at this topic, it seems you will need to insert some javascript to stop the context menu from coming up with _IEHeadInsertEventScript:. Edited May 13, 2015 by MikahS function name Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
GoravG Posted May 13, 2015 Author Share Posted May 13, 2015 MikahSthanks to reply it's work.... I am new, i am not programmer..... Sorry my bad English...... Link to comment Share on other sites More sharing options...
MikahS Posted May 13, 2015 Share Posted May 13, 2015 Glad to help. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
jguinch Posted May 13, 2015 Share Posted May 13, 2015 Also, for a single web page, you can use _IEHeadInsertEventScript (see example #2) :#Include <IE.au3> #Include <GUIConstantsEx.au3> $oIE = _IECreateEmbedded() GUICreate("Google", 800, 400, (@DesktopWidth - 400) / 2, (@DesktopHeight - 400) / 2) GUISetBkColor(0x000000) $GUIActiveX = GUICtrlCreateObj($oIE, 10, 45, 780, 350) $gui_button_Exit = GUICtrlCreateButton("Exit", 710, 5, 80, 30) GUICtrlSetBkColor(-1, 0xFFFFFF) _IENavigate($oIE, "http://www.google.com") GUISetState() _IEHeadInsertEventScript($oIE, "document", "oncontextmenu", "return false;") While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE , $gui_button_Exit ExitLoop EndSwitch WEnd Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
GoravG Posted May 16, 2015 Author Share Posted May 16, 2015 jguinchThanks to reply, im create already this script My Work#Include <IE.au3> #Include <GUIConstantsEx.au3> $oIE = _IECreateEmbedded() $gui = GUICreate("Google", 800, 400, (@DesktopWidth - 400) / 2, (@DesktopHeight - 400) / 2) GUISetBkColor(0x000000) $GUIActiveX = GUICtrlCreateObj($oIE, 10, 45, 780, 350) $gui_button_Exit = GUICtrlCreateButton("Exit", 710, 5, 80, 30) GUICtrlSetBkColor(-1, 0xFFFFFF) GUISetState() GUISetState(@SW_DISABLE, $gui) _IENavigate($oIE, "http://www.google.com") _IEHeadInsertEventScript($oIE, "document", "oncontextmenu", "return false;") GUISetState(@SW_ENABLE, $gui) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE , $gui_button_Exit ExitLoop EndSwitch WEnd I am new, i am not programmer..... Sorry my bad English...... Link to comment Share on other sites More sharing options...
spudw2k Posted May 18, 2015 Share Posted May 18, 2015 (edited) I noticed after navigating to a new page the eventscript no longer applies and Right-Click functionality resumes. One way I found this can be addressed is to register objevent and listen for NavigateComplete events.#include <IE.au3> #include <GUIConstantsEx.au3> $oIE = _IECreateEmbedded() GUICreate("Google", 800, 400, (@DesktopWidth - 400) / 2, (@DesktopHeight - 400) / 2) GUISetBkColor(0x000000) $GUIActiveX = GUICtrlCreateObj($oIE, 10, 45, 780, 350) $gui_button_Exit = GUICtrlCreateButton("Exit", 710, 5, 80, 30) GUICtrlSetBkColor(-1, 0xFFFFFF) Local $oIEEvents = ObjEvent($oIE, "_IEEvent_", "DWebBrowserEvents2") _IENavigate($oIE, "http://www.google.com") GUISetState() While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE, $gui_button_Exit ExitLoop EndSwitch WEnd ;https://www.autoitscript.com/autoit3/docs/functions/ObjEvent.htm Func _IEEvent_NavigateComplete2($oIEpDisp, $sIEURL, $iIEFlags, $sIETargetFrameName, $sIEPostData, $iIEHeaders, $bIECancel) _DisableRightClick() EndFunc ;==>_IEEvent_NavigateComplete2 Func _DisableRightClick() _IEHeadInsertEventScript($oIE, "document", "oncontextmenu", "return false;") EndFunc ;==>_DisableRightClickedit: code tags Edited May 18, 2015 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF 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