Click here to Skip to main content
15,895,084 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to dynamically change a window class name? Pin
ovidiucucu29-Jun-06 5:24
ovidiucucu29-Jun-06 5:24 
GeneralRe: How to dynamically change a window class name? Pin
Tara1429-Jun-06 5:45
Tara1429-Jun-06 5:45 
AnswerRe: How to dynamically change a window class name? [modified] Pin
ovidiucucu29-Jun-06 6:08
ovidiucucu29-Jun-06 6:08 
GeneralRe: How to dynamically change a window class name? Pin
Tara1429-Jun-06 7:15
Tara1429-Jun-06 7:15 
QuestionRe: How to dynamically change a window class name? Pin
yjzh29-Jun-06 16:51
yjzh29-Jun-06 16:51 
QuestionRe: How to dynamically change a window class name? Pin
yjzh29-Jun-06 15:33
yjzh29-Jun-06 15:33 
AnswerRe: How to dynamically change a window class name? [modified] Pin
ovidiucucu29-Jun-06 23:34
ovidiucucu29-Jun-06 23:34 
QuestionRe: How to dynamically change a window class name? Pin
yjzh30-Jun-06 21:04
yjzh30-Jun-06 21:04 
Confused | :confused: En, Thank you very much for your new way to solve my trouble, but if I want to create modeless dialog, how to do that?

maybe override create() is not a practical way, because it will call "CreateDlgIndirect(LPCDLGTEMPLATE lpDialogTemplate, CWnd* pParentWnd, HINSTANCE hInst)" after some steps, but this function is not a virtual one.

BOOL CMainDlg::Create(LPCTSTR lpszTemplateName, CWnd* pParentWnd)
{
//omit some original code

//call function
HINSTANCE hInst = AfxFindResourceHandle(lpszTemplateName, RT_DIALOG);
HRSRC hResource = ::FindResource(hInst, lpszTemplateName, RT_DIALOG);
HGLOBAL hTemplate = LoadResource(hInst, hResource);
BOOL bResult = CreateIndirect(hTemplate, pParentWnd, hInst);
FreeResource(hTemplate);

return bResult;
}

BOOL CWnd::CreateDlgIndirect(LPCDLGTEMPLATE lpDialogTemplate,
CWnd* pParentWnd, HINSTANCE hInst)
{
//omit some original code

// create modeless dialog
AfxHookWindowCreate(this);
hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate, pParentWnd->GetSafeHwnd(),
AfxDlgProc);

//omit some original code
}

can you tell me how to do that? thank you very much.




virtual
AnswerRe: How to dynamically change a window class name? [modified] Pin
ovidiucucu1-Jul-06 22:38
ovidiucucu1-Jul-06 22:38 
GeneralRe: How to dynamically change a window class name? Pin
yjzh3-Jul-06 18:16
yjzh3-Jul-06 18:16 
QuestionRe: How to dynamically change a window class name? Pin
yjzh3-Jul-06 19:03
yjzh3-Jul-06 19:03 
AnswerRe: How to dynamically change a window class name? Pin
ovidiucucu3-Jul-06 22:33
ovidiucucu3-Jul-06 22:33 
GeneralRe: How to dynamically change a window class name? Pin
yjzh3-Jul-06 23:06
yjzh3-Jul-06 23:06 
GeneralRe: How to dynamically change a window class name? Pin
yjzh3-Jul-06 23:07
yjzh3-Jul-06 23:07 
QuestionRe: How to dynamically change a window class name? Pin
yjzh4-Jul-06 18:10
yjzh4-Jul-06 18:10 
AnswerRe: How to dynamically change a window class name? [modified] Pin
ovidiucucu4-Jul-06 21:08
ovidiucucu4-Jul-06 21:08 
QuestionRe: How to dynamically change a window class name? Pin
yjzh4-Jul-06 23:40
yjzh4-Jul-06 23:40 
AnswerRe: How to dynamically change a window class name? Pin
ovidiucucu5-Jul-06 2:42
ovidiucucu5-Jul-06 2:42 
QuestionRe: How to dynamically change a window class name? Pin
yjzh5-Jul-06 20:31
yjzh5-Jul-06 20:31 
Questionwhat is wrong Pin
Tara1429-Jun-06 4:56
Tara1429-Jun-06 4:56 
AnswerRe: what is wrong Pin
cje29-Jun-06 5:04
cje29-Jun-06 5:04 
GeneralRe: what is wrong Pin
Tara1429-Jun-06 5:07
Tara1429-Jun-06 5:07 
AnswerRe: what is wrong Pin
Viorel.29-Jun-06 5:23
Viorel.29-Jun-06 5:23 
GeneralRe: what is wrong Pin
Tara1429-Jun-06 5:27
Tara1429-Jun-06 5:27 
AnswerRe: what is wrong Pin
Zac Howland29-Jun-06 6:48
Zac Howland29-Jun-06 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.