11.txt

来自「电子书籍,里面有丰富的文章和精神的营养,」· 文本 代码 · 共 65 行

TXT
65
字号
 #include <windows.h>
 LRESULT CALLBACK WindowFunc(HWND,UINT,WPARAM,LPARAM,LPARAM);
 char szWinName[]="MyWin"; /*name of window class*/
 int WINAPI WinMain(HINSTANCE hThisInst,HINSTANCE hPrevInst,
		    LPSTR lpszArgs,int nWinMode)
 {
  HWND hwnd;
  MSG msg;
  WNDCLASS wcl;
  /* Define a window class.*/
  wcl.hInstance=hThisInst;
  wcl.lpszClassName=szWinName;
  wcl.lpfnWndProc=WindowFunc;
  wcl.style=0;

  wcl.hIcon=LoadIcon(NULL,IDI_APPLICATION);
  wcl.hCursor=LoadCursor(NULL,IDC_ARROW);
  wcl.lpszMenuName=NULL;

  wcl.cbClsExtra=0;
  wcl.cbWndExtra=0;

  wcl.hbrBackground=(HBRUSH) GetStockObject(WHITE_BRUSH);

  if(!RegisterClass (&wcl)) return 0;
  
  hwnd=CreateWindow(
	  szWinName,
	  "Windows 95 Skeleton",
	  WS_OVERLAPPEDWINDOW,
	  CW-USEDEFAULT,
      CW-USEDEFAULT,
	  CW-USEDEFAULT,
	  CW-USEDEFAULT,
	  HWND_DESKTOP,
	  NULL,
	  hThisInst,
	  NULL
	};

  ShowWindow(hwnd,nWinMode);
  UpdateWindow(hwnd);

  while(GetMessage(&msg,NULL,0,0))
  {
	  TranslateMessage(&msg);
	  DispatchMessage(&msg);
  }
  return msg.wParam;
 }

 LRESULT CALLBACK WindowFuc(HWND hwnd,UINT message,
	                        WPARAM wParam,LPARAM lParam)
 {
	 switch(message)
	 {
	 case WM_DESTORY:
		 PostQuitMessage(0);
		 break;
	 default:
		 return DefWindowProc(hwnd,message,wParam,lParam);
	 }
	 return 0;
 }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?