c 语言 怎样控制 控制窗口 出现的位置??
用vs 2017 进行编写 #include <stdio.h>#include <windows.h>
// 得到当前窗口的句柄
HWND GetHwnd(void)
{
// 用简单一点的方法
return GetForegroundWindow();
}
int main(void)
{
HWND hwnd = GetHwnd();
if(hwnd == NULL)
{
printf("找不到窗口?什么情况?\n");
exit(1);
}
RECT rect;
GetWindowRect(hwnd, &rect);
MoveWindow(hwnd, 0, 0, rect.right - rect.left, rect.bottom - rect.top, TRUE);
getchar();
return 0;
}
人造人 发表于 2018-5-19 23:46
大佬又见面了哟,嘤嘤嘤
页:
[1]