![]() |
Was tun uMsg: UInt; wParam: WParam; lParam: LParam ?
Ich habe folgenden Code zum Andocken eines Fensters (Screensnap).
Delphi-Quellcode:
Ich würde nun gerne diese Funktion auf ein beliebiges Fenster dessen Handle ich habe anweden.
function WndProc(WndHWND: HWnd; uMsg: UInt; wParam: WParam; lParam: LParam): LResult; stdcall;
const DISTANCE = 20; var MyWndPos: PWindowPos; WorkAreaRect: TRect; begin Result := 0; case uMsg of WM_WINDOWPOSCHANGING: begin // Nötige Informationen holen SystemParametersInfo(SPI_GETWORKAREA, 0, @WorkAreaRect, 0); MyWndPos := PWINDOWPOS(lParam); // Oben und Unten if (MyWndPos.y <= DISTANCE) and (MyWndPos.y >= -DISTANCE) then MyWndPos.y := 0; if (MyWndPos.y + MyWndPos.cy > (WorkAreaRect.Bottom - DISTANCE)) and (MyWndPos.y + MyWndPos.cy < (WorkAreaRect.Bottom + DISTANCE)) then MyWndPos.y := WorkAreaRect.Bottom - MyWndPos.cy; // Links und Rechts if (MyWndPos.x <= DISTANCE) and (MyWndPos.x >= -DISTANCE) then MyWndPos.x := 0; if (MyWndPos.x + MyWndPos.cx > (WorkAreaRect.Right - DISTANCE)) and (MyWndPos.x + MyWndPos.cx < (WorkAreaRect.Right + DISTANCE)) then MyWndPos.x := WorkAreaRect.Right - MyWndPos.cx; end; WM_DESTROY: begin PostQuitMessage(0); end; else Result := DefWindowProc(WndHWND, uMsg, wParam, lParam); end; end; Leider scheitere ich an den Parametern. Das Handle ist klar, aber was
Delphi-Quellcode:
tun weiß ich nicht!
uMsg: UInt; wParam: WParam; lParam: LParam
Hoffe ihr könnt mir helfen. |
Re: Was tun uMsg: UInt; wParam: WParam; lParam: LParam ?
Moin MisterNiceGuy,
uMsg ist die Meldung mit der die WndProc aufgerufen wird. In Deinem Beispiel würden die Meldungen WM_WINDOWPOSCHANGING und WM_DESTROY von der Procedure verarbeitet werden. wParam und lParam enthalten die Parameter der jeweiligen Message. Was diese jeweils genau bedeuten, musst Du bei der Message nachschlagen (z.B. im PSDK) |
Re: Was tun uMsg: UInt; wParam: WParam; lParam: LParam ?
Uff das PSDK ist insgesagt 1,4 GB groß bei 25 MB pro Segment.
Die Funktion soll definitiv durch WM_WINDOWPOSCHANGING aufgerufen werden, nur hab ich keine Ahnung was ich für WParam und LParam beim Aufruf einsetzen muss! |
Re: Was tun uMsg: UInt; wParam: WParam; lParam: LParam ?
Zitat:
|
Re: Was tun uMsg: UInt; wParam: WParam; lParam: LParam ?
Moin MisterNiceGuy,
zum einen musst Du nicht das ganze PSDK herunterladen, zum anderen kannst Du auch direkt im MSDN nachschauen (z.B. ![]() Ausserdem könnte es möglich sein, dass Du einige der erforderlichen Informationen in der Hilfe von D7 enthalten sind. Bei der PE weiss ich das allerdings nicht genau (bei D2005 PE sind sie dabei). |
Re: Was tun uMsg: UInt; wParam: WParam; lParam: LParam ?
Hat sich erledigt, ich gehe das Problem anders an. Vielen Dank für die Hilfe, alleine wäre ich nicht so weit gekommen.
|
Re: Was tun uMsg: UInt; wParam: WParam; lParam: LParam ?
Zitat:
Denkst du nicht, dass deine Lösung auch für andere interessant wäre? |
Re: Was tun uMsg: UInt; wParam: WParam; lParam: LParam ?
Ja das stimmt schon, also mein Problem ist, dass ich nicht weiß, wie ich lParam verändern kann.
|
Re: Was tun uMsg: UInt; wParam: WParam; lParam: LParam ?
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:56 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz