Click here to Skip to main content
15,793,609 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: WinCe Screen shot of windows Pin
V K 227-Apr-09 21:47
V K 227-Apr-09 21:47 
AnswerRe: WinCe Screen shot of windows Pin
Rajkumar R27-Apr-09 21:50
Rajkumar R27-Apr-09 21:50 
QuestionHow to add images in visual C++ Library Files Pin
Sakthi.Gs :-)27-Apr-09 21:04
Sakthi.Gs :-)27-Apr-09 21:04 
AnswerRe: How to add images in visual C++ Library Files Pin
KarstenK27-Apr-09 23:50
mveKarstenK27-Apr-09 23:50 
QuestionHow to get the handles of all the windows opened in wince? Pin
ujjawal kumar27-Apr-09 19:59
ujjawal kumar27-Apr-09 19:59 
AnswerRe: How to get the handles of all the windows opened in wince? Pin
Rajkumar R27-Apr-09 20:43
Rajkumar R27-Apr-09 20:43 
GeneralRe: How to get the handles of all the windows opened in wince? Pin
ujjawal kumar27-Apr-09 22:07
ujjawal kumar27-Apr-09 22:07 
GeneralRe: How to get the handles of all the windows opened in wince? Pin
Rajkumar R28-Apr-09 1:52
Rajkumar R28-Apr-09 1:52 
Well, well try, If that API was supposed to work as per your understanding there are possible risks being caught in an infinite loop or referencing a destroyed window handle.

Call Back functions of an Windows API are not that supposed to be called by you.


struct MYLISTVIEW
{
};

BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
{
#define MAX_TEXT_LEN 256
	MYLISTVIEW *plvData = (MYLISTVIEW *)lParam;
	if (plvData)
	{
		TCHAR szWndText[MAX_TEXT_LEN] = _T("");

		LONG lStyle = GetWindowLong(hwnd, GWL_STYLE);
		LONG lExStyle = GetWindowLong(hwnd, GWL_EXSTYLE);

		// filter the window handles depending on your need
		if (IsWindowVisible(hwnd) && !GetParent(hwnd) && hwnd != GetDesktopWindow() && (
			/*lExStyle & WS_EX_APPWINDOW || */
			!(lExStyle & WS_EX_NOACTIVATE || lExStyle & WS_EX_TOOLWINDOW)))
		{			
			RECT rc = {0};
			GetWindowRect(hwnd, &rc);
			if (rc.bottom - rc.top && rc.right - rc.left)
			{
				GetWindowText(hwnd, szWndText, MAX_TEXT_LEN);

                                // add the text to your view
				AddWndTextToListView(plvData, szWndText);
			}			
		}
	}
	return TRUE;	
}

MYLISTVIEW g_lvData;

void AddOpenedWindowsToListView()
{
	EnumWindows(EnumWindowsProc, (LPARAM)&g_lvData);
}

Questionsscanf: cannot convert parameter 1 'LPTSTR' to 'const char *' Pin
xzing27-Apr-09 14:37
xzing27-Apr-09 14:37 
AnswerRe: sscanf: cannot convert parameter 1 'LPTSTR' to 'const char *' Pin
Stuart Dootson27-Apr-09 14:49
professionalStuart Dootson27-Apr-09 14:49 
AnswerRe: sscanf: cannot convert parameter 1 'LPTSTR' to 'const char *' Pin
CPallini27-Apr-09 23:05
mveCPallini27-Apr-09 23:05 
QuestionDoc-View vs Dialog-based app - Menu Item updates Pin
john john mackey27-Apr-09 12:35
john john mackey27-Apr-09 12:35 
AnswerRe: Doc-View vs Dialog-based app - Menu Item updates Pin
led mike27-Apr-09 12:47
led mike27-Apr-09 12:47 
GeneralRe: Doc-View vs Dialog-based app - Menu Item updates Pin
john john mackey27-Apr-09 13:08
john john mackey27-Apr-09 13:08 
QuestionCalculating the Size of Rich Edit "bottomless" control Pin
ForNow27-Apr-09 10:00
ForNow27-Apr-09 10:00 
AnswerRe: Calculating the Size of Rich Edit "bottomless" control Pin
Stuart Dootson27-Apr-09 15:02
professionalStuart Dootson27-Apr-09 15:02 
GeneralRe: Calculating the Size of Rich Edit "bottomless" control Pin
ForNow27-Apr-09 17:37
ForNow27-Apr-09 17:37 
GeneralRe: Calculating the Size of Rich Edit "bottomless" control Pin
Stuart Dootson28-Apr-09 6:12
professionalStuart Dootson28-Apr-09 6:12 
GeneralRe: Calculating the Size of Rich Edit "bottomless" control Pin
ForNow28-Apr-09 10:10
ForNow28-Apr-09 10:10 
GeneralRe: Calculating the Size of Rich Edit "bottomless" control Pin
Stuart Dootson28-Apr-09 11:51
professionalStuart Dootson28-Apr-09 11:51 
GeneralRe: Calculating the Size of Rich Edit "bottomless" control Pin
ForNow28-Apr-09 12:17
ForNow28-Apr-09 12:17 
GeneralRe: Calculating the Size of Rich Edit "bottomless" control Pin
ForNow28-Apr-09 19:20
ForNow28-Apr-09 19:20 
GeneralRe: Calculating the Size of Rich Edit "bottomless" control Pin
Stuart Dootson28-Apr-09 19:58
professionalStuart Dootson28-Apr-09 19:58 
GeneralRe: Calculating the Size of Rich Edit "bottomless" control Pin
ForNow28-Apr-09 23:47
ForNow28-Apr-09 23:47 
QuestionWriteProcessMemory error 5 Pin
Snoepie27-Apr-09 7:48
Snoepie27-Apr-09 7:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.