我用 CS_DROPSHADOW 样式创建了一个子窗口,但不显示阴影。
我试图打电话SystemParametersInfo(SPI_SETDROPSHADOW, 0, (PVOID) TRUE, 0);
,但它也没有帮助。
有人可以向我解释有什么问题吗?
WNDCLASSEX wcex;
HBRUSH bgBrush = CreateSolidBrush(RGB(171,181,201));
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_DBLCLKS;
wcex.lpfnWndProc = KolmusProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIconW(hInstance, MAKEINTRESOURCE(IDI_APPLICATION));
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = bgBrush;
wcex.lpszMenuName = NULL;
wcex.lpszClassName = L"Kolmus";
wcex.hIconSm = LoadIconW(hInstance, MAKEINTRESOURCE(IDI_APPLICATION));
RegisterClassEx(&wcex);
wcex.style = CS_DROPSHADOW;
wcex.lpfnWndProc = PageProc;
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszClassName = L"Page";
RegisterClassEx(&wcex);
HWND hWnd = CreateWindow(L"Kolmus", L"Kolmus", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
HWND PageWnd = CreateWindow(L"Page", L"", WS_CHILD | WS_VISIBLE, 30, 30, 200, 200, hWnd, NULL, hInstance, NULL);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (int)msg.wParam;