代码片断如下:
wcFileOrigin.style = CS_HREDRAW | CS_VREDRAW;
wcFileOrigin.lpfnWndProc = WndProcFile;
wcFileOrigin.cbClsExtra = 0;
wcFileOrigin.cbWndExtra = 0;
wcFileOrigin.hInstance = hInstance;
wcFileOrigin.hIcon = NULL;
wcFileOrigin.hCursor = LoadCursor(NULL, IDC_ARROW);
wcFileOrigin.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wcFileOrigin.lpszMenuName = NULL;
wcFileOrigin.lpszClassName = "FileClass";
if(!RegisterClass(&wcFileOrigin)) {
MessageBox(NULL, TEXT("窗口注册错误!"),
NULL, MB_ICONERROR);
exit(1);
}
hwndFileOrigin = CreateWindow("FileClass", "FileWindow",
WS_CHILDWINDOW | WS_TILEDWINDOW,
0, 0,
0, 0,
hwndMain, NULL, hInstance, NULL);
当ShowWindow(hwndFileOrigin, SW_SHOW)后,主窗口仍然是加亮选中状态,这个子窗口上的蓝色条仍然是未加亮的状态,而且点击此窗口后仍然无效。但是该子窗口仍可处理消息,比如LButtonDown后,也会产生预料的结果。经观察,发现只有在子窗口改变大小时才会有选中的状态,而且改变完大小后就又不是选中状态了。
哪位知道是怎么回事啊?谢谢了!