Autor Beitrag
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: So 19.06.05 10:19 
Hi, ich bastel mir grade ein nonVCL Programm zusammen und da möchte ich gerne einen BevelOuter um die Form zeichen und nun hab ich in der WndProc dies gemacht:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
case uMsg OF
  [...]
  WM_PAINT:
    begin
      dc := GetWindowDC(hWnd);
      GetWindowRect(hWnd, R);
      DrawEdge(dc, R, EDGE_RAISED, BF_RECT or BF_MONO);
      ReleaseDC(hWnd, dc);
    end;
  [...]
else
    Result := DefWindowProc(hWnd, uMsg, wParam, lParam);
end;


Er malt zwar einen rahmen, aber der sitzt nicht an der Richtigen Stelle und verschiebt sich ,wenn ich meine form bewege.

mfg matze

_________________
si tacuisses, philosophus mansisses.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 19.06.05 11:05 
1. WM_PAINT liefert Dir ein DC zum draufmalen mit.
2. Du brauchst das ClientRect, nicht das ParentRect.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
matze.de Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: So 19.06.05 17:04 
user profile iconBenBE hat folgendes geschrieben:
1. WM_PAINT liefert Dir ein DC zum draufmalen mit.
2. Du brauchst das ClientRect, nicht das ParentRect.


1) Hast du dich vertan, das DC is nur bei WM_PRINT drinne.
2) Danke, damit hats geklappt!

Habs nun raus:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
    WM_PAINT:
      begin
        result := DefWindowProc(hWnd, uMsg, wParam, lParam);
        dc := GetWindowDC(hWnd);
        GetClientRect(hWnd, R);
        DrawEdge(dc, R, EDGE_RAISED, BF_RECT or BF_MONO);
        ReleaseDC(hWnd, dc);
      end;


mfg matze

_________________
si tacuisses, philosophus mansisses.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 19.06.05 21:22 
1. möcht ich mich mit Dir nicht streiten, aber das PSDK und der VCL-Source sind da anderer Meinung:

ausblenden Messages.pas
 
1542:
1543:
1544:
1545:
1546:
1547:
{ ... }
  TWMPaint = packed record
    Msg: Cardinal;
    DC: HDC;
    Unused: Longint;
    Result: Longint;
  end;


Hat schon so seine Richtigkeit ;-) Aber das nur BTW ;-)

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
matze.de Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: Mo 20.06.05 14:51 
Ok, ich möcht mich mit dir auch nit streiten, muss ich aber auch ned ich hatte nur im MSDN nachgeschaut und da steht nix von dem mitgeliefertem DC :)

mfg matze

_________________
si tacuisses, philosophus mansisses.