Click here to Skip to main content
15,887,350 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: WinCe Screen shot of windows Pin
V K 227-Apr-09 20:47
V K 227-Apr-09 20:47 
AnswerRe: WinCe Screen shot of windows Pin
Rajkumar R27-Apr-09 20:50
Rajkumar R27-Apr-09 20:50 
QuestionHow to add images in visual C++ Library Files Pin
Sakthi.Gs :-)27-Apr-09 20:04
Sakthi.Gs :-)27-Apr-09 20:04 
AnswerRe: How to add images in visual C++ Library Files Pin
KarstenK27-Apr-09 22:50
mveKarstenK27-Apr-09 22:50 
QuestionHow to get the handles of all the windows opened in wince? Pin
ujjawal kumar27-Apr-09 18:59
ujjawal kumar27-Apr-09 18:59 
AnswerRe: How to get the handles of all the windows opened in wince? Pin
Rajkumar R27-Apr-09 19:43
Rajkumar R27-Apr-09 19:43 
GeneralRe: How to get the handles of all the windows opened in wince? Pin
ujjawal kumar27-Apr-09 21:07
ujjawal kumar27-Apr-09 21:07 
GeneralRe: How to get the handles of all the windows opened in wince? Pin
Rajkumar R28-Apr-09 0:52
Rajkumar R28-Apr-09 0: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 13:37
xzing27-Apr-09 13:37 
AnswerRe: sscanf: cannot convert parameter 1 'LPTSTR' to 'const char *' Pin
Stuart Dootson27-Apr-09 13:49
professionalStuart Dootson27-Apr-09 13:49 
AnswerRe: sscanf: cannot convert parameter 1 'LPTSTR' to 'const char *' Pin
CPallini27-Apr-09 22:05
mveCPallini27-Apr-09 22:05 
QuestionDoc-View vs Dialog-based app - Menu Item updates Pin
john john mackey27-Apr-09 11:35
john john mackey27-Apr-09 11:35 
AnswerRe: Doc-View vs Dialog-based app - Menu Item updates Pin
led mike27-Apr-09 11:47
led mike27-Apr-09 11:47 
GeneralRe: Doc-View vs Dialog-based app - Menu Item updates Pin
john john mackey27-Apr-09 12:08
john john mackey27-Apr-09 12:08 
QuestionCalculating the Size of Rich Edit "bottomless" control Pin
ForNow27-Apr-09 9:00
ForNow27-Apr-09 9:00 
AnswerRe: Calculating the Size of Rich Edit "bottomless" control Pin
Stuart Dootson27-Apr-09 14:02
professionalStuart Dootson27-Apr-09 14:02 
GeneralRe: Calculating the Size of Rich Edit "bottomless" control Pin
ForNow27-Apr-09 16:37
ForNow27-Apr-09 16:37 
GeneralRe: Calculating the Size of Rich Edit "bottomless" control Pin
Stuart Dootson28-Apr-09 5:12
professionalStuart Dootson28-Apr-09 5:12 
GeneralRe: Calculating the Size of Rich Edit "bottomless" control Pin
ForNow28-Apr-09 9:10
ForNow28-Apr-09 9:10 
GeneralRe: Calculating the Size of Rich Edit "bottomless" control Pin
Stuart Dootson28-Apr-09 10:51
professionalStuart Dootson28-Apr-09 10:51 
GeneralRe: Calculating the Size of Rich Edit "bottomless" control Pin
ForNow28-Apr-09 11:17
ForNow28-Apr-09 11:17 
GeneralRe: Calculating the Size of Rich Edit "bottomless" control Pin
ForNow28-Apr-09 18:20
ForNow28-Apr-09 18:20 
GeneralRe: Calculating the Size of Rich Edit "bottomless" control Pin
Stuart Dootson28-Apr-09 18:58
professionalStuart Dootson28-Apr-09 18:58 
GeneralRe: Calculating the Size of Rich Edit "bottomless" control Pin
ForNow28-Apr-09 22:47
ForNow28-Apr-09 22:47 
QuestionWriteProcessMemory error 5 Pin
Snoepie27-Apr-09 6:48
Snoepie27-Apr-09 6: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.