程序员语句表白简短代码_程序员表白代码c语言
(资料图片)
1、#define IdYes 1002#define IdNo 1003#define IdStatic 1004#define IdTimer 1005#define Width 640#define Height 480#define Tick 2000#include
2、太太太好了!"),TEXT("宝贝"),MB_ICONEXCLAMATION|MB_OK);SendMessage(hwnd,WM_CLOSE,0,0);break;case IdNo:MessageBox(hwnd,TEXT("回答错误哦。
3、我很生气呢!"),TEXT("宝贝"),MB_ICONEXCLAMATION|MB_OK);break;}break;case WM_SIZE:case WM_MOVE: SetWindowPos(hwnd,HWND_TOPMOST,x,y,Width,Height,SWP_SHOWWINDOW);break; case WM_DESTROY:PostQuitMessage(0);break;case WM_CLOSE:if(quit){KillTimer(hwnd,IdTimer);DestroyWindow(hwnd);} break; case WM_CREATE:CreateWindow(TEXT("Static"),TEXT("请回答:做我女朋友好吗?"),WS_CHILD|WS_VISIBLE|SS_CENTER,200,200,240,20,hwnd,(HMENU)IdStatic,hinst,NULL);hyes=CreateWindow(TEXT("Button"),TEXT("好"),WS_CHILD|WS_VISIBLE|BS_CENTER,270,230,45,20,hwnd,(HMENU)IdYes,hinst,NULL);hno=CreateWindow(TEXT("Button"),TEXT("不好"),WS_CHILD|WS_VISIBLE|BS_CENTER,325,230,45,20,hwnd,(HMENU)IdNo,hinst,NULL);SetTimer(hwnd,IdTimer,Tick,NULL);break;default:return DefWindowProc(hwnd,Message,wParam,lParam);}return 0;}int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow){WNDCLASSEX wc;HWND hwnd;MSG msg;hinst=hInstance;srand(time(NULL));memset(&wc,0,sizeof(wc));***.cbsize=sizeof(WNDCLASSEX);***.lpfnwndproc=WndProc;***.hinstance=hInstance;***.hcursor=LoadCursor(NULL,IDC_ARROW);***.hbrbackground=(HBRUSH)(COLOR_WINDOW+1);***.lpszclassname=TEXT("WindowClass");***.hicon=LoadIcon(NULL,IDI_APPLICATION);***.hiconsm=LoadIcon(NULL,IDI_APPLICATION);if(!RegisterClassEx(&wc)) {MessageBox(NULL,TEXT("窗口注册失败!"),TEXT("错误"),MB_ICONEXCLAMATION|MB_OK);return 0;}GetWindowRect(GetDesktopWindow(),&rdesk);x=(***.right-Width)/2;y=(***.bottom-Height)/2,hwnd = CreateWindowEx(WS_EX_TOPMOST,TEXT("WindowClass"),TEXT("I Love You"),WS_THICKFRAME|WS_VISIBLE,x,y,Width,Height,NULL,NULL,hInstance,NULL);if(NULL==hwnd){MessageBox(NULL,TEXT("窗口创建失败!"),TEXT("错误!"),MB_ICONEXCLAMATION|MB_OK);return 0;}while(GetMessage(&msg,NULL,0,0)>0) {TranslateMessage(&msg);DispatchMessage(&msg);}return ***.wparam;}截图。
本文到此分享完毕,希望对大家有所帮助。
关键词: