Einzelnen Beitrag anzeigen

Benutzerbild von turboPASCAL
turboPASCAL

Registriert seit: 8. Mai 2005
Ort: Sondershausen
4.274 Beiträge
 
Delphi 6 Personal
 
#1

[nonVCL] - Vista will mein Glasfenster nicht..

  Alt 2. Jan 2008, 17:38
Hi,

also ich komm nicht so ganz mit den "Glasfenster" klar. Ich habe nir mal
ein Testproject erstellt, wenn ich nun meine Controls wie Button o.Ä.
draufsetze ist es mit dem Glasslook & Feel hin.

Delphi-Quellcode:
function WndProc(hWnd: HWND; uMsg: UINT; wParam: wParam; lParam: LParam):
  lresult; stdcall;
var
  x, y, i: integer;
  ps: PAINTSTRUCT;
begin
  Result := 0;

  case uMsg of
    WM_CREATE:
      begin
        {Fenster zentrieren}
        x := GetSystemMetrics(SM_CXSCREEN);
        y := GetSystemMetrics(SM_CYSCREEN);
        MoveWindow(hWnd, (x div 2) - (WindowWidth div 2),
          (y div 2) - (WindowHeight div 2), WindowWidth, WindowHeight, FALSE);

        SetLength(wItems, wItemsCount);

        wItems[0] := CreateWindowEx(0, 'BUTTON', 'Test Button ...', WS_VISIBLE or WS_CHILD, 20, 20, 100, 25, hWnd, IDC_BUTTON, hInstance, nil);
        wItems[1] := CreateWindowEx(0, 'BUTTON', 'Checkbox Nr.: 1', WS_VISIBLE or WS_CHILD or BS_AUTOCHECKBOX, 20, 50, 120, 25, hWnd, 0, hInstance, nil);
        wItems[2] := CreateWindowEx(0, 'BUTTON', 'Checkbox Nr.: 2', WS_VISIBLE or WS_CHILD or BS_AUTOCHECKBOX, 20, 70, 120, 25, hWnd, 0, hInstance, nil);
        wItems[3] := CreateWindowEx(0, 'STATIC', 'Hellow World.', WS_VISIBLE or WS_CHILD, 20, 95, 120, 25, hWnd, 0, hInstance, nil);
        wItems[4] := CreateWindowEx(WS_EX_CLIENTEDGE, 'EDIT', 'Edit''s World...', WS_VISIBLE or WS_CHILD or WS_VSCROLL or ES_WANTRETURN or ES_MULTILINE or ES_LEFT, 20, 120, 280, 120, hWnd, 0, hInstance, nil);
        wItems[5] := CreateWindowEx(0, 'STATIC', '#2', WS_VISIBLE or WS_CHILD or SS_ICON or SS_CENTERIMAGE , 220, 20, 64, 64, hWnd, 0, hInstance, nil);

        b := CreateSolidBrush( COLORREF(InitWindow(hWnd)));
        DWM_EnableBlurBehind(hWnd, TRUE);

        ShowWindow(hWnd, SW_SHOWNORMAL);
        UpdateWindow(hWnd);
      end;

    {WM_PAINT:
      begin
        BeginPaint(hWnd, ps);
        FillRect(ps.hdc, ps.rcPaint, b);
        EndPaint(hWnd, ps);
      end;}


    WM_COMMAND:
      begin
        if hiword(wParam) = BN_CLICKED then
          case loword(wParam) of
            IDC_BUTTON: Windows.Beep(880, 25);
          end;
      end;

    WM_DESTROY:
      begin
        for i := 0 to High(wItems) do
          DestroyWindow(wItems[i]);

        DeleteObject(b);
        PostQuitMessage(0);
      end;

    {WM_ERASEBKGND:
      begin
        result := INTEGER(b);
      end;}


    WM_DWMCOLORIZATIONCOLORCHANGED:
      begin
        DeleteObject(b);
        b := CreateSolidBrush( COLORREF(wParam));
      end;

  else
    if {not} isVistaStyle then
      Result := DefWindowProc(hWnd, uMsg, wParam, lParam)
    else
    if @DwmDefWindowProc <> nil
      then Result := INTEGER(DwmDefWindowProc(hWnd, uMsg, wParam, lParam, p_lResult)) //?
      else Result := DefWindowProc(hWnd, uMsg, wParam, lParam);
  end;
end;
Angehängte Dateien
Dateityp: zip vista_window_558.zip (41,0 KB, 29x aufgerufen)
Matti
Meine Software-Projekte - Homepage - Grüße vom Rüsselmops -Mops Mopser
  Mit Zitat antworten Zitat