首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

GetWindowRect(hwnd,&rect); 的结果异常,得到的rect结果是-38000 -38000 -37920 -37920

2012-04-02 
GetWindowRect(hwnd,&rect) 的结果错误,得到的rect结果是-38000 -38000 -37920 -37920具体代码#include

GetWindowRect(hwnd,&rect); 的结果错误,得到的rect结果是-38000 -38000 -37920 -37920
具体代码
#include "stdafx.h"
#include<windows.h>

#include<iostream>
using namespace std;

void main()
{
hwnd=FindWindowW(NULL,_T("Skype? ")); 
int i=110;
MoveWindow(hwnd,100+i,100,120,180,1);

int x=350;
int y=200;
int cx=400;
int cy=400;
SetWindowPos(hwnd,HWND_TOPMOST,x,y,cx,cy,SWP_SHOWWINDOW);

RECT rect,rect1; 
GetWindowRect(hwnd,&rect);
GetClientRect(hwnd,&rect1);
SetWindowPos(hwnd,HWND_TOPMOST,x,y,cx,cy,SWP_SHOWWINDOW);
cout<<rect.top<<" "<<rect.left<<" "<<rect.bottom<<" "<<rect.right<<endl;
}
前面MOVEWINDOW和SETWINDOW都起作用了,但是
1.SET WINdow的位置坐标是按照屏幕像素?感觉不像.如果不是怎么能变成是移动到固定屏幕位置。
2.最后4个输出结果是-38000 -38000 -37920 -37920不对,请指教,谢谢

[解决办法]
位置不对是窗口最小化了

热点排行