tmailkura Posted October 25, 2009 Posted October 25, 2009 i want find handle rightclick menu in pic http://img245.imageshack.us/i/20091024214748.png/
Yashied Posted October 25, 2009 Posted October 25, 2009 Use "Start" from Toolbar. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
tmailkura Posted October 25, 2009 Author Posted October 25, 2009 i understand Use "Start" from Toolbar. ิ code it not work! i think 1 remove option > preference 2 remove ring click > force start expandcollapse popup#Include <GuiListView.au3> #include <WinAPI.au3> #Include <GuiMenu.au3> #include <Misc.au3> Opt("WinTitleMatchMode", 4) ;Opt("TrayIconHide", 1) ProcessWait("uTorrent.exe") $hWindow = _ProcessGetWinEx("uTorrent.exe", "", "Torrent") If Not $hWindow[0] Then Exit 1 WinWaitActive ($hWindow[1]) MsgBox(4096, "start", "start", 10) $whwindow = WinGetHandle($hWindow[1],"") $hControl = ControlGetHandle($hWindow[1], "", "[CLASSNN:SysListView322]") $dll = DllOpen("user32.dll") _DeletePreferences($hWindow[1]) _DisableForceStart($hWindow,$hControl) ; not work 100% ;-------------------code remove force start------------------------------ ;------------------------------------------------------------------------ Func _DeletePreferences($title) ; windows title $whwindow = WinGetHandle($title,"") $hmainmenu = _GUICtrlMenu_GetMenu($whwindow) $hFile = _GUICtrlMenu_GetItemSubMenu($hmainmenu, 1) return _GUICtrlMenu_DeleteMenu ($hFile, 0) EndFunc Func _DisableForceStart($hWindow,$hControl) while True WinWaitActive ($hWindow[1]) If ControlClick($hWindow[1],"",$hControl,"right")Then MsgBox(4096, "PID is", "oooooooooo") EndIf If _IsPressed("02", $dll) Then If _GUICtrlListView_GetItemFocused($hControl,_GUICtrlListView_GetSelectedIndices($hControl)) Then $pos = MouseGetPos() MouseClick("left",$pos[0]-0.1,$pos[1]+0.1,10) ControlDisable ( $hWindow[1], "", $hControl) Sleep(10*1000) ControlEnable( $hWindow[1], "", $hControl) EndIf EndIf WEnd DllClose($dll) EndFunc Func _ProcessGetWinEx($ivPid, $svClass = "", $svTitle = "", $svText = "") $ivPid = ProcessExists($ivPid) If Not $ivPid Then Return(SetError(1, 0, 0)) Local $avwArray = WinList() Local $avRet[1] = [0] For $i = 1 To $avwArray[0][0] If WinGetProcess($avwArray[$i][1]) = $ivPid Then If $svClass = "" Or _WinAPI_GetClassName($avwArray[$i][1]) = $svClass Then If ($svTitle = "" Or StringInStr($avwArray[$i][0], $svTitle)) And ($svText = "" Or StringInStr(WinGetText($avwArray[$i][1]), $svText)) Then $avRet[0] += 1 ReDim $avRet[$avRet[0]+1] $avRet[$avRet[0]] = $avwArray[$i][1] EndIf EndIf EndIf Next Return $avRet EndFunc
Authenticity Posted October 25, 2009 Posted October 25, 2009 Linkexpandcollapse popup#include <GuiMenu.au3> #include "WinEventHook.au3" Opt('WinSearchChildren', 1) HotKeySet('{ESC}', '_EXIT') Global Const $MN_GETHMENU = 0x01E1 Global $hFunc, $pFunc Global $hWinHook $hFunc = DllCallbackRegister('_WinEventProc', 'none', 'ptr;uint;hwnd;int;int;uint;uint') $pFunc = DllCallbackGetPtr($hFunc) $hWinHook = _SetWinEventHook($EVENT_MIN, $EVENT_MAX, 0, $pFunc, 0, 0, _ BitOR($WINEVENT_SKIPOWNPROCESS, $WINEVENT_OUTOFCONTEXT)) If $hWinHook = 0 Then Exit MsgBox(0x10, 'Error', 'Could not register callback procedure') While 1 Sleep(20) WEnd Func _EXIT() Exit EndFunc Func OnAutoItExit() _UnhookWinEvent($hWinHook) DllCallbackFree($hFunc) EndFunc Func _WinEventProc($hHook, $iEvent, $hWnd, $iObjectID, $iChildID, $iEventThread, $imsEventTime) Local $hMenu If $iEvent = $EVENT_SYSTEM_MENUPOPUPSTART Then If WinGetHandle("") <> WinGetHandle("[CLASS:SciTEWindow]") Then Return $hMenu = _SendMessage($hWnd, 0x01E1) If _GUICtrlMenu_IsMenu($hMenu) Then For $i = 0 To _GUICtrlMenu_GetItemCount($hMenu)-1 If _GUICtrlMenu_GetItemText($hMenu, $i) = "select all" Then _GUICtrlMenu_SetItemEnabled($hMenu, $i, False) ExitLoop EndIf Next EndIf EndIf EndFunc
tmailkura Posted October 27, 2009 Author Posted October 27, 2009 Link expandcollapse popup#include <GuiMenu.au3> #include "WinEventHook.au3" Opt('WinSearchChildren', 1) HotKeySet('{ESC}', '_EXIT') Global Const $MN_GETHMENU = 0x01E1 Global $hFunc, $pFunc Global $hWinHook $hFunc = DllCallbackRegister('_WinEventProc', 'none', 'ptr;uint;hwnd;int;int;uint;uint') $pFunc = DllCallbackGetPtr($hFunc) $hWinHook = _SetWinEventHook($EVENT_MIN, $EVENT_MAX, 0, $pFunc, 0, 0, _ BitOR($WINEVENT_SKIPOWNPROCESS, $WINEVENT_OUTOFCONTEXT)) If $hWinHook = 0 Then Exit MsgBox(0x10, 'Error', 'Could not register callback procedure') While 1 Sleep(20) WEnd Func _EXIT() Exit EndFunc Func OnAutoItExit() _UnhookWinEvent($hWinHook) DllCallbackFree($hFunc) EndFunc Func _WinEventProc($hHook, $iEvent, $hWnd, $iObjectID, $iChildID, $iEventThread, $imsEventTime) Local $hMenu If $iEvent = $EVENT_SYSTEM_MENUPOPUPSTART Then If WinGetHandle("") <> WinGetHandle("[CLASS:SciTEWindow]") Then Return $hMenu = _SendMessage($hWnd, 0x01E1) If _GUICtrlMenu_IsMenu($hMenu) Then For $i = 0 To _GUICtrlMenu_GetItemCount($hMenu)-1 If _GUICtrlMenu_GetItemText($hMenu, $i) = "select all" Then _GUICtrlMenu_SetItemEnabled($hMenu, $i, False) ExitLoop EndIf Next EndIf EndIf EndFunc Thank you so much example and library
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