Achilles Posted February 17, 2008 Share Posted February 17, 2008 (edited) My new problem is how to write this:$handle = ControlGetHandle(ControlGetHandle('[Class:Progman]', '', '[Class:SHELLDLL_DefView]'), '', '[Class:SysListView32;Instance:1]')So that it works with Opt('WinTitleMatchMode', 4)... Fixed problem that doesn't matter anymore:#include<GuiListView.au3> HotKeySet('`', '_CountItems') While 1 Sleep(200) WENd Func _CountItems() For $i = 1 to 2 $handle = ControlGetHandle('Program Manager', '', 'SysListView321') _GUICtrlListView_BeginUpdate($handle) $itemCount = _GUICtrlListView_GetItemCount($handle) Msgbox(0, '$itemCount', 'is equal to: ' & $itemCount) _GUICtrlListView_EndUpdate($handle) Next EndFuncInstructions: Run this. Press ` and it will tell you have x number of items on your desktop two times. Press Win + D. Press ` and it will tell you have 0 items once and then that you have x amount of items once. WHY?Edit: Managed to make an example... Is anybody getting this problem or is this just my computer? Edited February 18, 2008 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
rasim Posted February 17, 2008 Share Posted February 17, 2008 Piano_ManHi! I tryed your code and getting said problem... Hmm... i`m interesting why... Link to comment Share on other sites More sharing options...
Siao Posted February 17, 2008 Share Posted February 17, 2008 (edited) The actual Listview is not a direct child of 'Program Manager', but its grandchild. So the more reliable way of getting ListView handle is $handle = ControlGetHandle(ControlGetHandle('[Class:Progman]', '', '[Class:SHELLDLL_DefView]'), '', '[Class:SysListView32;Instance:1]') Edited February 17, 2008 by Siao "be smart, drink your wine" Link to comment Share on other sites More sharing options...
Achilles Posted February 17, 2008 Author Share Posted February 17, 2008 The actual Listview is not a direct child of 'Program Manager', but its grandchild. So the more reliable way of getting ListView handle is $handle = ControlGetHandle(ControlGetHandle('[Class:Progman]', '', '[Class:SHELLDLL_DefView]'), '', '[Class:SysListView32;Instance:1]')Thanks, that works good. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Achilles Posted February 18, 2008 Author Share Posted February 18, 2008 Would there be a way to make this work with Opt('WinTitleMatchMode', 4)? I thought that it should, but it doesn't.... I could add a Opt('WinTitleMatchMode', 1) before these commands but it seems inefficient.. I thought that the style that I have now was designed to work for option 4, but it doesn't.... My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Achilles Posted February 18, 2008 Author Share Posted February 18, 2008 bump... I'm not getting this because Opt 4 is supposed to use stuff like this: [CLASS:Notepad], which is what my statement has... but it doesn't work. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
rasim Posted February 19, 2008 Share Posted February 19, 2008 For me works fine, with Opt('WinTitleMatchMode', 4). Link to comment Share on other sites More sharing options...
Achilles Posted February 19, 2008 Author Share Posted February 19, 2008 (edited) For me works fine, with Opt('WinTitleMatchMode', 4).That's really weird. I'm running this: #include<GuiListView.au3> Opt('WinTitleMatchMode', 4) HotKeySet('`', '_CountItems') While 1 Sleep(200) WENd Func _CountItems() $handle = ControlGetHandle(ControlGetHandle('[Class:Progman]', '', '[Class:SHELLDLL_DefView]'), '', '[Class:SysListView32;Instance:1]') $itemCount = _GUICtrlListView_GetItemCount($handle) Msgbox(0, '$itemCount', 'is equal to: ' & $itemCount) EndFuncAnd when I run it the first time it returns 3, which is right. I press Win + D and then it's wrong, it shows 0. And if I press it again it returns 3 again. Edited February 19, 2008 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
rasim Posted February 19, 2008 Share Posted February 19, 2008 So this work correct for me: #include<GuiListView.au3> Opt('WinTitleMatchMode', 4) HotKeySet('`', '_CountItems') While 1 Sleep(200) WENd Func _CountItems() Opt('WinTitleMatchMode', 1) $handle = ControlGetHandle(ControlGetHandle('[Class:Progman]', '', '[Class:SHELLDLL_DefView]'), '', '[Class:SysListView32;Instance:1]') $itemCount = _GUICtrlListView_GetItemCount($handle) Msgbox(0, '$itemCount', 'is equal to: ' & $itemCount) EndFunc ;==>_CountItems 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