user-0 提问: 帮忙看看这个为什么我在win32中显示不了系统菜单

回复:
user: user-0
content: 大佬，太感谢啦

user: user-1
content: 引用 11 楼 u012792138 的回复:显示系统菜单怎么办？@？？？ 啥子咋办 系统菜单不是显示有的吗  你知道系统菜单是哪个不？ 在标题栏点右键弹出的菜单，你去试试，你添加的菜单项已经在里面了的。

user: user-0
content: 呃 大佬对不起我明白了 嗨

user: user-0
content: 显示系统菜单怎么办？@？？？

user: user-1
content: 引用 8 楼 u012792138 的回复:上面这个我想显示一个按钮可显示不出来？？？  两个问题是一个错误吗？？  HWND	hwndpop=CreateWindow(_T("aa"),_T("KK"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, 10,20,30,40,hwnd,(HMENU)1,((LPCREATESTRUCT)lParam)->hInstance,NULL);  改成  			HWND	hwndpop=CreateWindow(_T("button"),_T("KK"), 				WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, 				10,20,30,40,hwnd,(HMENU)1,((LPCREATESTRUCT)lParam)->hInstance,NULL);

user: user-1
content: case WM_SYSCOMMAND: // switch(LOWORD(wParam)) { case IDR_SYS_MENU2:     MessageBox(NULL,_T("aaa"),_T("aa)"),MB_ICONERROR);    return 0; } return 0;   这里的 return 0 改成 DefWindowProc   case WM_SYSCOMMAND: // switch(LOWORD(wParam)) { case IDR_SYS_MENU2:     MessageBox(NULL,_T("aaa"),_T("aa)"),MB_ICONERROR);    return 0; } return DefWindowProc(hwnd, message, wParam, lParam);   你不让系统处理移动，关闭这些消息，自然没有反应了。

user: user-0
content: 上面这个我想显示一个按钮可显示不出来？？？  两个问题是一个错误吗？？

user: user-0
content: #include <tchar.h> #include <windows.h> #define ID_TIME1  1 #define ID_TIME2  2 #define ID_TIME3  3 /*  Declare Windows procedure  */ LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);   /*  Make the class name into a global variable  */ TCHAR szClassName[ ] = _T("CodeBlocksWindowsApp");   int WINAPI WinMain (HINSTANCE hThisInstance,                      HINSTANCE hPrevInstance,                      LPSTR lpszArgument,                      int nCmdShow) {     HWND hwnd;               /* This is the handle for our window */     MSG messages;            /* Here messages to the application are saved */     WNDCLASSEX wincl;        /* Data structure for the windowclass */       /* The Window structure */     wincl.hInstance = hThisInstance;     wincl.lpszClassName = szClassName;     wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */     wincl.style = CS_DBLCLKS;                 /* Catch double-clicks */     wincl.cbSize = sizeof (WNDCLASSEX);       /* Use default icon and mouse-pointer */     wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);     wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);     wincl.hCursor = LoadCursor (NULL, IDC_ARROW);     wincl.lpszMenuName = NULL;                 /* No menu */     wincl.cbClsExtra = 0;                      /* No extra bytes after the window class */     wincl.cbWndExtra = 0;                      /* structure or the window instance */     /* Use Windows's default colour as the background of the window */     wincl.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH) ;       /* Register the window class, and if it fails quit the program */     if (!RegisterClassEx (&wincl))         return 0;       /* The class is registered, let's create the program*/     hwnd = CreateWindowEx (            0,                   /* Extended possibilites for variation */            szClassName,         /* Classname */            _T("Code::Blocks Template Windows App"),       /* Title Text */            WS_OVERLAPPEDWINDOW, /* default window */            CW_USEDEFAULT,       /* Windows decides the position */            CW_USEDEFAULT,       /* where the window ends up on the screen */            544,                 /* The programs width */            375,                 /* and height in pixels */            HWND_DESKTOP,        /* The window is a child-window to desktop */            NULL,                /* No menu */            hThisInstance,       /* Program Instance handler */            NULL                 /* No Window Creation data */            );       /* Make the window visible on the screen */     ShowWindow (hwnd, nCmdShow);       /* Run the message loop. It will run until GetMessage() returns 0 */     while (GetMessage (&messages, NULL, 0, 0))     {         /* Translate virtual-key messages into character messages */         TranslateMessage(&messages);         /* Send message to WindowProcedure */         DispatchMessage(&messages);     }       /* The program return-value is 0 - The value that PostQuitMessage() gave */     return messages.wParam; }     /*  This function is called by the Windows function DispatchMessage()  */   LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {//Run-Time Check Failure #3 - The variable 'hwndpop' is being used without being initialized. 	HDC hdc; 	 //hwndpop; 		PAINTSTRUCT ps; 	static	int M=0,N=0;     switch (message)                  /* handle the messages */     { 	case WM_CREATE: 	{	//SetTimer(hwnd,ID_TIME1,1000,NULL); 		//SetTimer(hwnd,ID_TIME2,60000,NULL); 		//SetTimer(hwnd,ID_TIME3,3600000,NULL); 	HWND	hwndpop=CreateWindow(_T("aa"),_T("KK"), 							WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, 							10,20,30,40,hwnd,(HMENU)1,((LPCREATESTRUCT)lParam)->hInstance,NULL); 		 		return 0;} 	/*case WM_TIMER: 			M=!M; 			 			InvalidateRect(hwnd,NULL,FALSE); 			return 0; 		 		//case ID_TIME2: 		//case ID_TIME3: 			//MessageBox(NULL,_T("hh"),_T("AA"),NULL); 			*/ 	case WM_PAINT: hdc=BeginPaint(hwnd,&ps);  //Rectangle(hdc,200,200,1000,1000); //InvalidateRect(hwnd,NULL,TRUE //UpdateWindow(hwndpop);  		//MoveToEx(hdc,0,0,NULL); 			//LineTo(hdc,120,120); 			//InvalidateRect(hwnd,NULL,TRUE);  EndPaint(hwnd,&ps); 			 		break;         case WM_DESTROY:             PostQuitMessage (0);       /* send a WM_QUIT to the message queue */             break;         default:                      /* for messages that we don't deal with */             return DefWindowProc (hwnd, message, wParam, lParam);     }       return 0; }

user: user-2
content: 给你一个范例，参照它调试一下自己的代码：  #if defined(UNICODE) && !defined(_UNICODE)     #define _UNICODE #elif defined(_UNICODE) && !defined(UNICODE)     #define UNICODE #endif  #include <tchar.h> #include <windows.h>  /*  Declare Windows procedure  */ LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);  /*  Make the class name into a global variable  */ TCHAR szClassName[ ] = _T("CodeBlocksWindowsApp");  int WINAPI WinMain (HINSTANCE hThisInstance,                      HINSTANCE hPrevInstance,                      LPSTR lpszArgument,                      int nCmdShow) {     HWND hwnd;               /* This is the handle for our window */     MSG messages;            /* Here messages to the application are saved */     WNDCLASSEX wincl;        /* Data structure for the windowclass */      /* The Window structure */     wincl.hInstance = hThisInstance;     wincl.lpszClassName = szClassName;     wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */     wincl.style = CS_DBLCLKS;                 /* Catch double-clicks */     wincl.cbSize = sizeof (WNDCLASSEX);      /* Use default icon and mouse-pointer */     wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);     wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);     wincl.hCursor = LoadCursor (NULL, IDC_ARROW);     wincl.lpszMenuName = NULL;                 /* No menu */     wincl.cbClsExtra = 0;                      /* No extra bytes after the window class */     wincl.cbWndExtra = 0;                      /* structure or the window instance */     /* Use Windows's default colour as the background of the window */     wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;      /* Register the window class, and if it fails quit the program */     if (!RegisterClassEx (&wincl))         return 0;      /* The class is registered, let's create the program*/     hwnd = CreateWindowEx (            0,                   /* Extended possibilites for variation */            szClassName,         /* Classname */            _T("Code::Blocks Template Windows App"),       /* Title Text */            WS_OVERLAPPEDWINDOW, /* default window */            CW_USEDEFAULT,       /* Windows decides the position */            CW_USEDEFAULT,       /* where the window ends up on the screen */            544,                 /* The programs width */            375,                 /* and height in pixels */            HWND_DESKTOP,        /* The window is a child-window to desktop */            NULL,                /* No menu */            hThisInstance,       /* Program Instance handler */            NULL                 /* No Window Creation data */            );      /* Make the window visible on the screen */     ShowWindow (hwnd, nCmdShow);      /* Run the message loop. It will run until GetMessage() returns 0 */     while (GetMessage (&messages, NULL, 0, 0))     {         /* Translate virtual-key messages into character messages */         TranslateMessage(&messages);         /* Send message to WindowProcedure */         DispatchMessage(&messages);     }      /* The program return-value is 0 - The value that PostQuitMessage() gave */     return messages.wParam; }   /*  This function is called by the Windows function DispatchMessage()  */  LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {     switch (message)                  /* handle the messages */     {         case WM_DESTROY:             PostQuitMessage (0);       /* send a WM_QUIT to the message queue */             break;         default:                      /* for messages that we don't deal with */             return DefWindowProc (hwnd, message, wParam, lParam);     }      return 0; }

user: user-0
content: 我想显示系统菜单 在windows程序设计.第10章里有个例子，可我运行就没有系统菜单还有就是什么都动不了只能靠任务管理器关闭？？？

user: user-0
content: 没用啊？？不是这里问题？？

user: user-3
content: 关于自己是否适合编程的很简单的测试： 在报纸或杂志上随便找一段约1000字的文章，在Word中输入一遍。输完后再参考下面答案：  A里面有10处以上文字或标点错误 B里面没有文字或标点错误并敢为此跟人打赌 C里面没有文字或标点错误并且字体和排版完全与原稿一致 D打印在半透明的纸上和原稿重叠在一起检查一模一样，且自我感觉很有成就感  A不适合编程（理由：打字准确度偏低、粗心大意） B初级程序员（理由：打字准确度很高、认真细致、自信、理解全角半角概念） C高级程序员（理由：在B的基础上理解字体和排版也是电脑打印的重要因素、但相比D还不够偏执、精益求精、结果可验证） D软件项目经理（理由：能针对项目给出令人信服的细致到极点的需求说明和典型测试用例。用户几乎挑不出毛病。专业！）  如果想从A变成B的话，到我的资源http://download.csdn.net/detail/zhao4zhong1/4084259里面下载“适合程序员的键盘练习”

user: user-4
content: WM_CREATE差break;

user: user-0
content: 而且我运行之后整个都窗口都死掉了，关都关不了只有打开任务管理器才关掉