Button Handler

Hi,

I have this simple program where I want to click a button, it will run my other program. Below is the part of the code that I'm having problem. You can see that I put "int cscan(int ok, char* A);" at button 3. When run, it does not show any error but when I click the button, nothing happens. Can anyone help me? I need to submit this project soon. Thank you.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  case WM_CREATE:
	{       CreateWindow(TEXT("static"), TEXT("ANTIVIRUS"), 
                            WS_VISIBLE | WS_CHILD , 
                            85, 20, 100, 25, 
                            hwnd, (HMENU) 1, NULL, NULL);
                
                CreateWindow(TEXT("static"), TEXT("Scan Options:"), 
                            WS_VISIBLE | WS_CHILD , 
                            85, 70, 100, 25, 
                            hwnd, (HMENU) 2, NULL, NULL);
                
                CreateWindow(TEXT("button"), TEXT("Local Disk (D:)"),    
		             WS_VISIBLE | WS_CHILD ,
		             75, 100, 110, 25,        
		             hwnd, (HMENU) 3, NULL, NULL);
                break;
        }
  case WM_COMMAND:
        {
	   if (LOWORD(wParam) == 3) {
               int cscan(int ok, char* A);            //this part 

           break;
        }
Line 21 is a function declaration. Lines 2, 7, and 12, by contrast are function calls. Do you see the difference?
Yes, I see the difference. If line 21 is a function declaration, how can I call the function to run when I click button 3?

Thank u.
I have solve my problem. I just add the function call under the function declaration. I thought just put function declaration is enough. Thank u. :)

1
2
3
4
5
6
7
case WM_COMMAND:
        {
	   if (LOWORD(wParam) == 3) {
               int cscan();            //function declaration
               int file = cscan ();           //function call
           break;
        }
Topic archived. No new replies allowed.