下面是代码
#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;

}}

解决方案 »

  1.   

    接分……
    额……你在MoveWindow的时候还可以MessageBeep一下!嘿嘿
      

  2.   

    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);
    ==========
    才认真看,这个?比较邪恶!
      

  3.   

    点击运行后按住Shift+F5就关了嘛。啊哈,吓我一跳。
      

  4.   

    #include "resource.h"
    这个资源头文件怎么创建呀
      

  5.   

    抖得不够强,不过还有很有意思的,吓了我一下-----------------------------------
    http://www.jiemengwu.com/ 解梦屋 http://www.phpzy.com/php/ 绿色php资源