Jump to content

How can i create a Function of Select an item from "[CLASS:DirectUIHWND]" type windows?


 Share

Recommended Posts

How can i create a Function of Select an item from "[CLASS:DirectUIHWND]" type windows?

I have no idea please Guide me......

Edited by adnanbaloch

Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once."

Link to comment
Share on other sites

What have you been given so far?

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

i tried but nothing.............

Func _ObjectSHFolderViewFromWin($hWnd)
    If Not IsHWnd($hWnd) Then Return SetError(1,0,0)
    Local $oShell,$oShellWindows,$oIEObject,$oSHFolderView

    ; Shell Object
    $oShell=ObjCreate("Shell.Application")
    If Not IsObj($oShell) Then Return SetError(2,0,0)

;   Get a 'ShellWindows Collection' object
    $oShellWindows = $oShell.Windows()
    If Not IsObj($oShellWindows) Then Return SetError(3,0,0)

;   Iterate through the collection - each of type 'InternetExplorer' Object

    For $oIEObject In $oShellWindows
        If $oIEObject.HWND = $hWnd Then
            ; InternetExplorer->Document = ShellFolderView object
            $oSHFolderView=$oIEObject.Document
            If IsObj($oSHFolderView) Then Return $oSHFolderView
            Return SetError(4,0,0)
        EndIf
    Next

    Return SetError(-1,0,0)
EndFunc

Run("control netconnections")
WinWaitActive("Network Connections")
Sleep(100)

$hWin=WinGetHandle('[REGEXPCLASS:^(Explore|Cabinet)WClass$]')
$hCtrl=ControlGetHandle($hWin,'','[CLASS:SysListView32; INSTANCE:1]')
; Windows 7
If $hCtrl='' Then $hCtrl=ControlGetHandle($hWin,'','[CLASS:DirectUIHWND]')
$sFileToSelect="Network Connection2"
$oSHFolderView=_ObjectSHFolderViewFromWin($hWin)
If Not @error Then
    ; Comment this out to choose your own file here:
    $sFileToSelect=$oSHFolderView.FocusedItem.Name
    ConsoleWrite("Focusing on : "&$sFileToSelect&@CRLF)
    WinActivate($hWin)
    ; Select ONLY the item
    $oSHFolderView.SelectItem($oSHFolderView.Folder.ParseName($sFileToSelect),4+1+8+16)
EndIf 

Select an item from "[CLASS:DirectUIHWND]" type windows without a function is impossible. Therefore i thought to create a function first.

post-76662-0-22599400-1382342785_thumb.p
Edited by adnanbaloch

Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once."

Link to comment
Share on other sites

  • 6 months later...

These windows can be handled by the UI Automation framework. In this thread you can also find an implementation of the accessibility (MSAA) interfaces. If the window is Windows Explorer, you can find several examples.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...