Kanit Posted May 5, 2008 Posted May 5, 2008 I want to automate right click operation on one of the items of listview control and select a menu item. In particular, I have opened printer & faxes and I want to right click on one printer driver and select properties of that printer driver. Does any one know how to do last part? ie selecting a menu item? Thanks in advance Kanit
spudw2k Posted May 6, 2008 Posted May 6, 2008 There's a few ways to do it. You can emulate mouse clicks/keystrokes, or you can script it using a shell object. $shell = ObjCreate("Shell.Application") $folder = $shell.NameSpace(4) For $objItem in $folder.Items For $verb in $objItem.verbs If $verb.Name = "P&roperties" Then $ans = msgbox(4,"Configure Printer" ,"Open Properties for " & @CRLF & $objItem.Name) If $ans = 6 Then $verb.DoIt WinWait($objItem.name) While WinExists($objItem.name) Wend EndIF EndIf Next Next 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 Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
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