can somebody tell me what is wrong with this code
Code:
#include "stdafx.h"

void popup();

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
	switch(msg){
 case WM_DESTROY:{
	 popup();
	 break;
 }
 case WM_CLOSE:{
	 popup();
	 break;
}
}
	MessageBox(NULL,"josh you idiot i told you not to open this","you dumb kid!"
		,MB_OKCANCEL);
	switch(msg){
	case WM_DESTROY:{
		popup();
		break;
					}
	case WM_CLOSE:{
		popup();
		break;
				  }
	case MB_OK:{
		popup();
		break;
			   }
	case MB_CANCEL:{
		popup();
		break;
				   }
	default:{
		
			}
	}


	return 0;
}

void popup(){
	MessageBox(NULL,"sorry that didnt work either","nice try",MB_OKCANCEL);
	switch(msg){
	case WM_DESTROY:{
		popup();
		break;
					}
	case WM_CLOSE:{
	popup();
	break;
				  }
	case MB_OK:{
		popup();
		break;
			   }
	case MB_CANCEL:{
		popup();
		break;
				   }
	default:{
	
			}
	}
}
the compiler gives me this error but i dont understand

Compiling...
dontopen.cpp
C:\Programs\dontopen\dontopen.cpp(13) : error C2065: 'msg' : undeclared identifier
C:\Programs\dontopen\dontopen.cpp(38) : error C2065: 'MB_CANCEL' : undeclared identifier
C:\Programs\dontopen\dontopen.cpp(38) : error C2051: case expression not constant
C:\Programs\dontopen\dontopen.cpp(66) : error C2051: case expression not constant
Error executing cl.exe.