MultiTasking

Hi,

I have created a dialog box using this code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	UNREFERENCED_PARAMETER(lParam);
	switch (message)
	{
		//----------------------------------------------

		//----------------------------------------------
	case WM_INITDIALOG:
		return (INT_PTR)TRUE;
	case WM_PAINT:
	{

		PAINTSTRUCT ps;
		HDC hdc = BeginPaint(hDlg, &ps);
		// TODO: Add any drawing code that uses hdc here...
		HBITMAP logo;
		logo = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP1));
		HDC logoB;
		logoB = CreateCompatibleDC(hdc);
		SelectObject(logoB, logo);
		BitBlt(hdc, 0, 0, 4100, 4500, logoB, 10, 10, SRCCOPY);
		DeleteDC(logoB);
	}

	case WM_COMMAND:
		if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
		{
			EndDialog(hDlg, LOWORD(wParam));
			return (INT_PTR)TRUE;
		}
		break;
	}
	return (INT_PTR)FALSE;
}


I have added the necessary requirements to the resource file also.
There is no problem in displaying the about box.But my problem is

When about box was displayed It prevents me to work with my main window. So what should I do to enable multitasking on my program so that I can work with all of my dialog boxes at the same time.

Thank you in advance
Last edited on
To keep all dialog boxes open you need modeless dialogs.

http://www.winprog.org/tutorial/modeless_dialogs.html
Very Thank you Finally made this to work with your help, It works now by modifying this
1
2
3
4
5
6
 case IDM_ABOUT:
               // DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
				 about = CreateDialog(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
				 if (about != NULL) {
					 ShowWindow(about, SW_SHOW);
				 }
Last edited on
Topic archived. No new replies allowed.