can anyone display some source code or give an explanation as to how to use enumwindows properly in MFC?
i've tried to use the function but it only displays one window which is the program that is running the function itself..
here are the steps that i've used to attempt to run the function
::EnumWindows(EnumWindowsProc,(LPARAM)this);
static BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam);
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam)
{
HWND grrr;
grrr = GetDlgItem(hwnd,IDC_LIST1);
char szWindowTitle[100];
GetWindowText(hwnd,szWindowTitle,100);
SendMessage(grrr, LB_ADDSTRING,0,(LPARAM) szWindowTitle);
return TRUE;
}
thanks for any help that you can offer
i've tried to use the function but it only displays one window which is the program that is running the function itself..
here are the steps that i've used to attempt to run the function
::EnumWindows(EnumWindowsProc,(LPARAM)this);
static BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam);
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam)
{
HWND grrr;
grrr = GetDlgItem(hwnd,IDC_LIST1);
char szWindowTitle[100];
GetWindowText(hwnd,szWindowTitle,100);
SendMessage(grrr, LB_ADDSTRING,0,(LPARAM) szWindowTitle);
return TRUE;
}
thanks for any help that you can offer