• Advertisement
Sign in to follow this  

DialogBox not redrawing

This topic is 4612 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to get a modal dialog box so I can prompt the user for some options before my program starts. The problem I'm having is that the dialog box is not drawing/refreshing. Here is my dialogproc and call to DialogBox
INT_PTR CALLBACK DialogProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
	switch(Msg)
        {
        case WM_INITDIALOG:
                return TRUE;

        case WM_COMMAND:
                switch(wParam)
                {
                case IDOK:
                        EndDialog(hWndDlg, 0);
                        return TRUE;
                }
                break;
        }
		
	return FALSE;
}

DialogBox(hInst, MAKEINTRESOURCE( IDD_DIALOG1 ), hWnd, DialogProc);
Any tips or ideas on what i'm doing wrong? Thanks for the help to come.

Share this post


Link to post
Share on other sites
Advertisement
Could be many things. See DialogBox on MSDN. The best options are to check the return codes and call GetLastError() to see what went wrong.

Greetz,

Illco

Share this post


Link to post
Share on other sites
Problem is that no error code is returning. The dialog box will appear, or will appear with only its components, but the background won't draw, or if I move it the dialog doesn't get repainted. I can also get parts of the dialog to draw if I move another window over it,

Here's some pictures of what I'm talking about.





Share this post


Link to post
Share on other sites
It looks like the problem doesnt live in that part of your code. Could you post more? Are you cleaning up your GDI objects?

Share this post


Link to post
Share on other sites
Problem solved. I deleted everything and started again and it's working this time. I'm guessing my problem was in my resource.h file or .rc file.

Thanks for the help guys.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement