我使用CS_DROPSHADOW風格創建子窗口,但不顯示陰影。
我試圖撥打SystemParametersInfo(SPI_SETDROPSHADOW, 0, (PVOID) TRUE, 0);
,但它也沒有幫助。
有人可以向我解釋什麼是錯的?CS_DROPSHADOW窗口風格不起作用
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;
您根本無法在子窗口上獲得投影,請勿嘗試。 – 2013-02-11 13:46:44
可以創建一個不是子窗口的窗口,並且它的位置將根據另一個窗口來確定? (作爲子窗口,其位置關於父母確定)。 – user1544067 2013-02-11 14:46:54