Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi [nonVCL] - Vista will mein Glasfenster nicht.. (https://www.delphipraxis.net/105938-%5Bnonvcl%5D-vista-will-mein-glasfenster-nicht.html)

turboPASCAL 2. Jan 2008 17:38


[nonVCL] - Vista will mein Glasfenster nicht..
 
Liste der Anhänge anzeigen (Anzahl: 1)
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. :gruebel:

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;

bigg 2. Jan 2008 19:13

Re: [nonVCL] - Vista will mein Glasfenster nicht..
 
Hast du mal die Funktion InitCommonControls aufgerufen?

turboPASCAL 3. Jan 2008 12:42

Re: [nonVCL] - Vista will mein Glasfenster nicht..
 
Zitat:

Zitat von bigg
Hast du mal die Funktion InitCommonControls aufgerufen?

Noch nicht, ist aber eine Idee. Obwolh ich nichts verwende was InitCommonControls bedingt glaube ich.

turboPASCAL 3. Jan 2008 16:18

Re: [nonVCL] - Vista will mein Glasfenster nicht..
 
Liste der Anhänge anzeigen (Anzahl: 1)
Na, dachte ich mir. Nein daran lag es nicht.
Ich hänge euch mal 'n Testfile an.

turboPASCAL 5. Jan 2008 09:56

Re: [nonVCL] - Vista will mein Glasfenster nicht..
 
Keiner eine Idee ?


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:10 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz