下面是代码
#include <windows.h>#include "resource.h"int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
HWND hwnd; RECT rect;
int cx,cy; int REP=MessageBox(NULL,TEXT("是男人点一下“确定”试试"),
TEXT("提示!by Fleaves"),MB_OKCANCEL|MB_ICONWARNING);
if (IDOK==REP)
{
while(TRUE)
{
hwnd=GetForegroundWindow();
GetWindowRect(hwnd,&rect);
cx=rect.left;
cy=rect.top; MoveWindow(hwnd,rand()%50,rand()%50,rect.right-rect.left,rect.bottom-rect.top,TRUE); } return 0;
} else if(IDCANCEL==REP)
{
MessageBox(NULL,TEXT("哥知道你不是男人,原谅你了!O(∩_∩)O~"),TEXT("哈哈~"),MB_OK); return 0;
}}
#include <windows.h>#include "resource.h"int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
HWND hwnd; RECT rect;
int cx,cy; int REP=MessageBox(NULL,TEXT("是男人点一下“确定”试试"),
TEXT("提示!by Fleaves"),MB_OKCANCEL|MB_ICONWARNING);
if (IDOK==REP)
{
while(TRUE)
{
hwnd=GetForegroundWindow();
GetWindowRect(hwnd,&rect);
cx=rect.left;
cy=rect.top; MoveWindow(hwnd,rand()%50,rand()%50,rect.right-rect.left,rect.bottom-rect.top,TRUE); } return 0;
} else if(IDCANCEL==REP)
{
MessageBox(NULL,TEXT("哥知道你不是男人,原谅你了!O(∩_∩)O~"),TEXT("哈哈~"),MB_OK); return 0;
}}
额……你在MoveWindow的时候还可以MessageBeep一下!嘿嘿
cx=rect.left;cy=rect.top;MoveWindow(hwnd,rand()%50,rand()%50,rect.right-rect.left,rect.bottom-rect.top,TRUE);
==========
才认真看,这个?比较邪恶!
这个资源头文件怎么创建呀
http://www.jiemengwu.com/ 解梦屋 http://www.phpzy.com/php/ 绿色php资源