我有下面的代码: -代码块VS VS2010
BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
{
char ay[256]={0};//HWND hwnd= GetForegroundWindow();
if(GetClassName(hwnd,ay,256))
{
char x[70]={0};
GetWindowText(hwnd,x,70);
if(IsWindowVisible(hwnd))
{
// CaptureAnImage(hwNd,hwnd);
HINSTANCE hins= (HINSTANCE) GetWindowLong(hwnd,GWL_HINSTANCE);
WNDCLASSEX lpwcx;
GetClassInfoEx(hins,ay,&lpwcx);
if (MessageBox(0,
strcat(strcat(x, "\r\n"), lpwcx.lpszClassName),
"Info", 0x06L) == IDTRYAGAIN)
{
return false;
}
}
}
return true;
}
void cstm()
{
EnumWindows(EnumWindowsProc,0);
}
这运行正常的代码块(用VS 2010编译器(CL)),但VS2010给人损坏lpwcx值,我曾尝试统一以及Ascii来解决这个问题,但在 没有好结果。第一个lpwcx是正确的,但是后来他们返回没有找到的类(1411),尽管灵敏度和类名是正确的。
请帮忙。
我不能在wndclass中找到cbsize它的唯一cbwndextra和cbclsextra那里 – user522453 2010-11-27 18:50:39