#include<stdio.h>
#include<windows.h>
int main(int argc,char*argv)
{
RECT rect;
HWND hwnd=NULL,oldhwnd=NULL;
int x,y,width,height;
int i;
for(i=0;i<50;i++)
{
hwnd=GetForegroundWindow;
if(hwnd!=oldhwnd)
{
GetWindowRect(hwnd,&rect);
x=rect.left;
y=rect.top;
width=rect.right-x;
height=rect.bottom-y;
oldhwnd=hwnd;
}
MoveWindow(hwnd,x-10,y,width,height,TRUE);
Sleep(5);
MoveWindow(hwnd,x-10,y-10,width,height,TRUE);
Sleep(5);
MoveWindow(hwnd,x,y-10,width,height,TRUE);
Sleep(5);
MoveWindow(hwnd,x,y,width,height,TRUE);
Sleep(5);
}
return 0;
}
:\Users\Administrator\Desktop\444\345\doudong.cpp(15) : error C2440: '=' : cannot convert from 'struct HWND__ *(__stdcall *)(void)' to 'struct HWND__ *'
There is no context in which this conversion is possible
執行 cl.exe 時出錯.
345.exe - 1 error(s), 0 warning(s)
uj5u.com熱心網友回復:
引數型別對不上啊 hwnd轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/90295.html
標籤:C語言
上一篇:C語言求答案
下一篇:typeinfo for xxxxx 未定義的參考 collect2: error: ld returned 1 exit status
