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

C / C++ / MFC

 
QuestionDate picker control is not working Pin
Pryabu23-Sep-09 23:56
Pryabu23-Sep-09 23:56 
AnswerRe: Date picker control is not working Pin
«_Superman_»24-Sep-09 0:59
professional«_Superman_»24-Sep-09 0:59 
GeneralRe: Date picker control is not working Pin
David Crow24-Sep-09 3:11
David Crow24-Sep-09 3:11 
QuestionException throws debugging mode Pin
Game-point23-Sep-09 23:55
Game-point23-Sep-09 23:55 
AnswerRe: Exception throws debugging mode Pin
CPallini24-Sep-09 0:19
mveCPallini24-Sep-09 0:19 
GeneralRe: Exception throws debugging mode Pin
Game-point24-Sep-09 0:27
Game-point24-Sep-09 0:27 
QuestionRe: Exception throws debugging mode Pin
David Crow24-Sep-09 3:18
David Crow24-Sep-09 3:18 
QuestionStrange EnumChildWindows issue Pin
Maxwell Chen23-Sep-09 23:52
Maxwell Chen23-Sep-09 23:52 
When I declare a LVFINDINFO object in the function body, EnumChildWindows fails to locate the control of SysListView32 type (a Windows class type). When I remove the LVFINDINFO object from the body, it works well.

The code snippet is as the below.
void CMainDlg::OnBnClickedGetDolby()
{
	// Kill any running window if any.
	KillRunningApplet(_T("Sound"));

	// Launch it.
	if(!LaunchCplApplet(_T("mmsys.cpl"), 0, 0)) {
		OutputDebugString(_T("LaunchCplApplet fails. \n"));
		return;
	}

	// Make sure the applet pops up.
	CWnd* pWnd = NULL;
	int i = 0;
	while(!pWnd) {
		pWnd = FindWindow(NULL, _T("Sound"));
		if(pWnd) {
			OutputDebugString(_T("Found Sound window. \n"));
			break;
		}
		Sleep(10);
		i++;
		if(i > 1000) {
			OutputDebugString(_T("Sound window is not found. \n"));
			return;
		}
	}

	// ---
	m_pListView = NULL;
	EnumChildWindows(pWnd->m_hWnd, DoSomethingHelper, (LPARAM)this);

	if(m_pListView) {
		OutputDebugString(_T("Got SysListView32"));
	}
	else {
		OutputDebugString(_T("SysListView32 is not found."));
		return;
	}
	m_pListView->SendMessage(WM_KEYDOWN, VK_DOWN, 0);

	CListView* pView = (CListView*)m_pListView;
	CListCtrl& Ctrl = pView->GetListCtrl();

	LVFINDINFO info;  // <--- This line fails SysListView32.
	int iIndex = 0;

	info.flags = LVFI_PARTIAL | LVFI_STRING;
	info.psz = _T("Speaker");
/*

	while ((iIndex = Ctrl.FindItem(&info)) != -1) {
		OutputDebugString(_T("Speaker-like entry is found."));
		CString s = Ctrl.GetItemText(iIndex, 0);
		OutputDebugString(s);
	}
*/

}

BOOL CALLBACK DoSomethingHelper(HWND hwnd, LPARAM lParam)
{
	TCHAR sClassName[MAX_PATH] = {0};
	GetClassName(hwnd, sClassName, MAX_PATH);
	if(wcscmp(sClassName, _T("SysListView32")) == 0) {
		CMainDlg* pMain = (CMainDlg*)lParam;
		pMain->m_pListView = CWnd::FromHandle(hwnd);
	}
	OutputDebugString(sClassName);
	return TRUE;
}


  Maxwell Chen

AnswerRe: Strange EnumChildWindows issue Pin
Maxwell Chen24-Sep-09 0:02
Maxwell Chen24-Sep-09 0:02 
AnswerRe: Strange EnumChildWindows issue Pin
CPallini24-Sep-09 0:13
mveCPallini24-Sep-09 0:13 
GeneralRe: Strange EnumChildWindows issue Pin
Maxwell Chen24-Sep-09 0:27
Maxwell Chen24-Sep-09 0:27 
QuestionpMSG-&gt;wParam == VK_Delete is called also with the Point key (Period) Pin
Kamis41023-Sep-09 23:43
Kamis41023-Sep-09 23:43 
AnswerRe: pMSG-&gt;wParam == VK_Delete is called also with the Point key (Period) Pin
Kamis41024-Sep-09 0:23
Kamis41024-Sep-09 0:23 
GeneralRe: pMSG-&gt;wParam == VK_Delete is called also with the Point key (Period) Pin
«_Superman_»24-Sep-09 1:36
professional«_Superman_»24-Sep-09 1:36 
GeneralRe: pMSG-&gt;wParam == VK_Delete is called also with the Point key (Period) Pin
Kamis41024-Sep-09 2:11
Kamis41024-Sep-09 2:11 
GeneralRe: pMSG-&gt;wParam == VK_Delete is called also with the Point key (Period) Pin
«_Superman_»24-Sep-09 2:17
professional«_Superman_»24-Sep-09 2:17 
GeneralRe: pMSG-&gt;wParam == VK_Delete is called also with the Point key (Period) Pin
Kamis41024-Sep-09 2:25
Kamis41024-Sep-09 2:25 
AnswerRe: pMSG-&gt;wParam == VK_Delete is called also with the Point key (Period) Pin
Rajesh R Subramanian24-Sep-09 5:18
professionalRajesh R Subramanian24-Sep-09 5:18 
GeneralRe: pMSG-&gt;wParam == VK_Delete is called also with the Point key (Period) Pin
Kamis41024-Sep-09 21:56
Kamis41024-Sep-09 21:56 
QuestionChanging button text Pin
larsho23-Sep-09 23:39
larsho23-Sep-09 23:39 
AnswerRe: Changing button text Pin
Nuri Ismail23-Sep-09 23:46
Nuri Ismail23-Sep-09 23:46 
AnswerRe: Changing button text Pin
CPallini23-Sep-09 23:53
mveCPallini23-Sep-09 23:53 
GeneralRe: Changing button text Pin
larsho24-Sep-09 2:24
larsho24-Sep-09 2:24 
AnswerRe: Changing button text Pin
David Crow24-Sep-09 3:30
David Crow24-Sep-09 3:30 
GeneralRe: Changing button text Pin
larsho25-Sep-09 2:42
larsho25-Sep-09 2:42 

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.