Reputation: 31
hi i use c++ code blocks. and i try to get the heade of a listview with ListView_GetHeade():
BOOL CALLBACK enumWindowsProc(HWND hwnd,LPARAM lParam)
{
int length = ::GetWindowTextLength( hwnd ); //get the length of handler title.
if( 0 == length ) return true;
TCHAR* buffer;
buffer = new TCHAR[ length + 1 ];
memset( buffer, 0, ( length + 1 ) * sizeof( TCHAR ) );
GetWindowText( hwnd, buffer, length + 1 ); //get the name of the handler.
std::wstring str1 (buffer);
std::wstring str2 (L"יומן חשבוניות"); //set the value to search.
std::string::size_type found = str1.find(str2); //searching for name.
if (found!=std::string::npos)
{
LPCWSTR rrr = str1.c_str();
MessageBoxW(hwnd, rrr , L"the file is:", MB_OK);
HWND w = ListView_GetHeader(hwnd);
MessageBoxW(hwnd, (LPCWSTR)w , L"text 1:", MB_OK);
hwnd is the handle of the window "יומן חשבוניות":
but it give me the error:
error: 'ListView_GetHeader' was not declared in this scope|
i include in the head of the code:
#include <Commctrl.h>
as i see on msdn page : https://msdn.microsoft.com/en-us/library/windows/desktop/bb761290(v=vs.85).aspx
how i solve it?
Upvotes: 0
Views: 139