C语言版表白神器是一款非常有趣的电脑表白软件,本款C语言表白程序使用方法简单易懂,用户可通过它来轻松生成浪漫的红色爱心,从而让你的表白充满创新。C语言版表白神器可以帮你生成超级炫酷的表白爱心哦只需简单几步,就能将你想对他/她说的话用爱心表达出来转发到朋友圈,就是这么炫酷,开启炫酷装逼模式吧!
1、首先在手机上找到并打开微信的软件图标,点击小程序。
2、在搜索栏中搜索二维码,然后点击进入生成二维码小程序。
3、在新建二维码里点击文本,输入自己想要表白的话,然后点击生成二维码。
4、最后下载二维码即可。
#define IdYes 1002
#define IdNo 1003
#define IdStatic 1004
#define IdTimer 1005
#define Width 640
#define Height 480
#define Tick 2000
#include<windowsh>
int x,y;
RECT rdesk;
HINSTANCE hinst;
HWND hyes,hno;
BOOL quit=FALSE;
LRESULT CALLBACK WndProc(HWND hwnd,UINT Message,WPARAM wParam,LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rclient;
HBRUSH hbrbkgnd;
static COLORREF c;
static BYTE r,g,b;
switch(Message)
{
case WM_TIMER:
if(IdTimer==LOWORD(wParam))
{
r=(BYTE)(rand()%256);
g=(BYTE)(rand()%256);
b=(BYTE)(rand()%256);
c=RGB(r,g,b);
InvalidateRect(hwnd,NULL,TRUE);
UpdateWindow(hwnd);
}
break;
case WM_PAINT:
hdc=BeginPaint(hwnd,&ps);
hbrbkgnd=CreateSolidBrush(c);
SelectObject(hdc,hbrbkgnd);
GetClientRect(hwnd,&rclient);
FillRect(hdc,&rclient,hbrbkgnd);
DeleteObject(hbrbkgnd);
EndPaint(hwnd,&ps);
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IdYes:
quit=TRUE;
MessageBox(hwnd,TEXT("回答正确,太太太好了!"),TEXT("宝贝"),MB_ICONEXCLAMATION|MB_OK);
SendMessage(hwnd,WM_CLOSE,0,0);
break;
case IdNo:
MessageBox(hwnd,TEXT("回答错误哦,我很生气呢!"),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));
wccbSize=sizeof(WNDCLASSEX);
wclpfnWndProc=WndProc;
wchInstance=hInstance;
wchCursor=LoadCursor(NULL,IDC_ARROW);
wchbrBackground=(HBRUSH)(COLOR_WINDOW+1);
wclpszClassName=TEXT("WindowClass");
wchIcon=LoadIcon(NULL,IDI_APPLICATION);
wchIconSm=LoadIcon(NULL,IDI_APPLICATION);
if(!RegisterClassEx(&wc))
{
MessageBox(NULL,TEXT("窗口注册失败!"),TEXT("错误"),MB_ICONEXCLAMATION|MB_OK);
return 0;
}
GetWindowRect(GetDesktopWindow(),&rdesk);
x=(rdeskright-Width)/2;
y=(rdeskbottom-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 msgwParam;
}
截图
程序员的表白代码
第一条语言:Java代码翻译:直到死之前,每天爱你多一点代码:while(lifeend){love++;}
第二条语言:C语言代码翻译:IcannotsayHellototheWorldwithoutu代码:#incldestdiohintmain(){printf(HelloWorldn);retrn0;}//IcannotsayHellototheWorldwithoutu
第三条语言:python代码翻译:山无陵,江水为竭,冬雷震震,夏雨雪,天地合,乃敢与君绝!代码:if(mountainarris==None):if(riverwater==None):if(winterthunder==True):if(summersnow==True):if(skyheight==groundheight):iwithyou=Falseelse:iwithyou=True
第四条语言:Erlang代码代码翻译:深圳相遇,至死不渝代码:-module(you_and_me)-export([start/1])-record(person,{name,address,status})start(Name)-one_world(Name)one_world(Name)keep_to_love_you(Person)say_goodbye(Person)-io:format(~p:seeyounextworld!~n,[Person#personname])see_you_next_world(Name)-one_world(Name)
第五条语言:Java语言代码翻译:爱你到天荒地老代码:while(!worlddestroy){Systemoutprintln(iloveyou);}
浪漫表白效果:
开发环境:Visual Studio 2019 + EasyX图形库插件即可
源码展示:
以上就是我们表白程序的源码了!最后祝大家都能和喜欢的人在一起哦~
我的C/C++编程学习基地,点击正在跳转「链接」即可加入,欢迎有问题的小伙伴一起进来学习交流嗷~
欢迎分享,转载请注明来源:表白网
评论列表(0条)