I had created buttons on a dialog using resource editor(using Visual C++,X64) . On the button click event i have to show another window which is exactly of the same size and at same place (For further details i want to tell you that i have two buttons "next" and "previous" . on clicking them i have preview of "Image" and a "File" respectively). My dialog uses the handle of parent which comes from GetWindow function. See this please -
SomeClassOrFounctionNoMatterWhat::GetWindow(HWND *phwnd) { HRESULT hr = E_INVALIDARG; if (phwnd) { *phwnd = m_hwndParent; //m_hwndParent is the parent handle now hr = S_OK; } return hr; }
So i mean the parent handle is m_hwndParent and using this handle i have created Dialog using this-
m_hwndPreview = CreateDialogParam( g_hInst,MAKEINTRESOURCE(IDD_MAINDIALOG), m_hwndParent,(DLGPROC)DialogProc, (LPARAM)this);
and m_hwndPreview contains the button which i have created on the dialog "IDD_MAINDIALOG".
and on button click event i am displaying the a file contents like this-
m_hwndPreview3 = CreateWindowExW(0, MSFTEDIT_CLASS, NULL, //This window is to display the html file. WS_CHILD | WS_VISIBLE | WS_VSCROLL| ES_MULTILINE | ES_READONLY | WS_EX_TOPMOST , m_rcParent.left, m_rcParent.top, RECTWIDTH(m_rcParent), RECTHEIGHT(m_rcParent),m_hwndPreview, NULL, NULL,NULL); // similarly m_hwndPreview2 for image preview
See I am using m_hwndPreview as its parent which contains the buttons. I am doing so because i want to have buttons on my every window in order to display different contents by clicking on them.
So my problem is the buttons are created succesfully and are working properly but when i click any button it takes me on different window for the display of the file or Image. But when it takes me on different window the button disappears on the first sight and they appears only when i move mouse over them.
**What should i do in order to have the button appearing on every window without moving mouse over them ?**