Check box not working

Hi,
I have created a dialog box with a checkBox.Everything works fine and the check box was displayed as well. But I have created a void function and added that to my check box and has been called inside my check box. But it is not working.(complies successfully)

So I did set some break points and executed my code.When I ran the code my executable skips the function call [ ImageDisp();]

Here is my code snippet:
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
36
37
38
39
40
41
bool checked;
INT_PTR CALLBACK PictureViewer(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	UNREFERENCED_PARAMETER(lParam);
	switch (message)
	{
		//----------------------------------------------

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

	case WM_COMMAND:
		if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
		{
			EndDialog(hDlg, LOWORD(wParam));
			return (INT_PTR)TRUE;
		}
		break;
	case IDOK:
		checked = IsDlgButtonChecked(hDlg, 1);
		if (checked) {
			ImageDisp();
			}
	case WM_CTLCOLORDLG:
	{
		return(LONG)DlgBackground;
	}
	case WM_CTLCOLORSTATIC:
	{
		//did something to change the background colour
	}
	case WM_PAINT:
	{
		// did something to display a bitmap

	}

	}
	return (INT_PTR)FALSE;
}

Last edited on
One quick comment (not a solution).

After line 24 there should be a break; or a return something; - unless you actually want control to fall through to the next case.

Also in the vein of Chervil's reply, don't know if this is your problem, but don't ever put blank WM_PAINT handlers in your Window Procedures as you have above or you'll have more grief than you can imagine. To be truthful, I'm not even sure if Dialog Procedures get WM_PAINT messages. I seldom use Dialog Procedures.
Sorry Everyone I forget to send a message that my problem has solved.
please no need to worry.
Thank you for your valuable comments kindly excuse me
Topic archived. No new replies allowed.