Jump to content

Sort items in a listview of an external program


Recommended Posts

Hi

I want to sort items in a listview of an external program.

Could someone give me a clue. I tried the help file but somehow could not get it to work.

Thanks

Ajit

#Include <GUIListView.au3>

Global $Descending, $sTitle, $hList

$sTitle = StringRegExpReplace(@ProgramFilesDir, '^.*\\', '')
ShellExecute(@ProgramFilesDir)
If Not WinWait($sTitle, '', 3) Then
    Exit
EndIf
$hList = ControlGetHandle($sTitle, '', '[CLASS:SysListView32;INSTANCE:1]')
If $hList = '' Then
    Exit
EndIf
MsgBox(0, '', 'Press OK to sort descending.')
$Descending = 1
_GUICtrlListView_SimpleSort($hList, $Descending, 0)
MsgBox(0, '', 'Press OK to sort ascending.')
$Descending = 0
_GUICtrlListView_SimpleSort($hList, $Descending, 0)
Link to comment
Share on other sites

#Include <GUIListView.au3>

Global $Descending, $sTitle, $hList

$sTitle = StringRegExpReplace(@ProgramFilesDir, '^.*\\', '')
ShellExecute(@ProgramFilesDir)
If Not WinWait($sTitle, '', 3) Then
    Exit
EndIf
$hList = ControlGetHandle($sTitle, '', '[CLASS:SysListView32;INSTANCE:1]')
If $hList = '' Then
    Exit
EndIf
MsgBox(0, '', 'Press OK to sort descending.')
$Descending = 1
_GUICtrlListView_SimpleSort($hList, $Descending, 0)
MsgBox(0, '', 'Press OK to sort ascending.')
$Descending = 0
_GUICtrlListView_SimpleSort($hList, $Descending, 0)

@Yashied

It works perfect. Thanks so much. That was more than what I had asked.

Thanks again.

Ajit

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...