Hey guys,
i have a problem with the ListView_GetItemCount Macro from Microsoft.
It's just a macro for
::SendMessage((hwnd), LVM_GETITEMCOUNT, 0, 0L)
When i send this message to my SysListView32 it always return 0.
Background:
I want to get the ttemcount from the ListCtrl Displayed in a FileOpenDlg (CCommonDlg).
I use this Code:
HWND hwndParentDlg = ::GetParent( this->m_hWnd );
HWND hwndShellDllDefView = ::FindWindowEx( hwndParentDlg, NULL, "SHELLDLL_DefView", NULL );
HWND hwndSysListView = ::FindWindowEx( hwndShellDllDefView, NULL, "SysListView32", NULL );
INT nCount = ListView_GetItemCount( hwndSysListView );
but nCount is always set to 0.
I also googled and found
this article at StackOverflow.
So i checked GetLastError(), but it return zero too.
What i'm doing wrong here?
Can anyone help me please?
Thank you so much guys for your answers!
best regards from Germany :)