cfiledialog没有定义1st1标识符
在CFiledialog中重载OnInitDialog希望获取Listctrl控件来设置其显示方式为大图标。
但是提示说没有定义这个1st1标识符
BOOL CMyFileSel::OnInitDialog(){ CFileDialog::OnInitDialog(); CWnd* pWnd = GetDlgItem(lst1); if(pWnd) BOOL flag = pWnd->ModifyStyle(LVS_TYPEMASK, LVS_ICON & LVS_TYPEMASK); return TRUE;}///////////////////////////////////////////////////////// for CFileDialog down load // in debug version there is an error : ASSERT(m_p...==NULL)UINT CALLBACK DNHookProc(HWND hDlg,UINT uMsg,WPARAM wPar,LPARAM lPar){ // hdlg is a child HWND hWndParent; CWinApp *pApp=AfxGetApp(); HICON hIcon; HWND hw; // SHELLDll_defView HWND hcw;// SysListView32 DWORD dwStyle;// if (hDlg == NULL) return 0;// from "_AfxCommDlgProc()" of the file "dlgcomm.cpp" _AFX_THREAD_STATE* pThreadState = AfxGetThreadState(); if (pThreadState->m_pAlternateWndInit != NULL)// not pThreadState->m_pAlternateWndInit->SubclassWindow(hWnd); pThreadState->m_pAlternateWndInit = NULL;// hWndParent=GetParent(hDlg);// needed switch (uMsg) { case WM_INITDIALOG: hIcon=pApp->LoadIcon(IDI_ICONDN); SendMessage(hWndParent,WM_SETICON,(WPARAM)0,(LPARAM)hIcon);// Note that LoadIcon does not require a subsequent DestroyIcon in Win32 DestroyIcon(hIcon); break; case WM_NOTIFY: LPOFNOTIFY lpon=(LPOFNOTIFY)lPar; UINT Notify=lpon->hdr.code; if (Notify==CDN_TYPECHANGE || Notify==CDN_SELCHANGE ) { // after window shown hw=GetDlgItem(hWndParent,0x0461);// SHELLDll_defView hcw=GetDlgItem(hw,1);// SysListView32 dwStyle=GetWindowLong(hcw,GWL_STYLE);// change multi-selection of ListView if (lpon->lpOFN->nFilterIndex==4) // "dll" { dwStyle &= ~LVS_SINGLESEL;// Multi } else { dwStyle |= LVS_SINGLESEL;// Single } SetWindowLong(hcw,GWL_STYLE,dwStyle); } if (Notify==CDN_FOLDERCHANGE) { HWND hLv=GetDlgItem(hWndParent,0x0461);//lst1 if(hLv) SendMessage(hLv,WM_COMMAND,0x7029,0);//ODM_WIEW_ICONS } break; } return 0;}