Glass Effekt
-
Hoi,
Ich wollte mir mal den Aero Glass Effect ansehen, aber irgendwie wird bei mir nicht mal ein Fenster erstellt, kann mir jemand sagen worans liegt?
#undef UNICODE #undef _UNICODE #include <windows.h> #include <dwmapi.h> const char* className = "clsn"; LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCdmLine, int nCmdShow) { WNDCLASSEX wcex; memset(&wcex, 0, sizeof(WNDCLASSEX)); wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.lpfnWndProc = WndProc; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; wcex.hInstance = hInstance; wcex.hIcon = LoadIcon (NULL, IDI_WINLOGO); wcex.hCursor = LoadCursor (NULL, IDC_ARROW); wcex.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); wcex.lpszMenuName = 0; wcex.lpszClassName = className; RegisterClassEx(&wcex); HWND hWnd = CreateWindow(className, "", WS_SYSMENU | WS_THICKFRAME, 0, 0, 200, 100, 0, 0, hInstance, 0); ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); MARGINS margin = {-1, -1, -1, -1}; DwmExtendFrameIntoClientArea(hWnd, &margin); MSG msg; while(GetMessage(&msg, 0, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; } LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_PAINT: { HDC hDC = GetDC(hWnd); PAINTSTRUCT ps; hDC = BeginPaint(hWnd, &ps); RECT crect; HBRUSH hbr; GetClientRect(hWnd,&crect); hbr = CreateSolidBrush(RGB(0, 0, 0)); FillRect(hDC, &crect, hbr); EndPaint(hWnd, &ps); } case WM_DESTROY: PostQuitMessage(0); return 0; } return DefWindowProc(hWnd, msg, wParam, lParam); }Grüßle
-
Problem gelöst, habe vergessen die Größe von WNDCLASSEX zu setzen.
Kann mir jemand sagen wie ich als Icon ein leeres Icon setzen kann?
-
Und wie kann ich normale Buttons/Eingabefelder/... auf so einen Glas-Bereich zeichnen?
-
Kriegt man hier eigentlich auch antworten oder zumindest hilfreiche Hinweise?

-
http://beta.codeproject.com/KB/buttons/glassbutton.aspx
http://www.codeproject.com/KB/vista/AeroGlassLegacyWindowsApp.aspx
-
Ist ja nett gemeint, aber das ist alles MFC, den will ich nicht benutzen.
-
http://www.gidf.de/
http://www.codeproject.com/KB/vista/VGGlassIntro.aspx
http://www.autoitscript.com/forum/index.php?showtopic=105123
-
Blubb?
www.lmgtfy.com wenn schon