AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Set/Get-Capture / ReleaseCapture

Ein Thema von Pseudemys Nelsoni · begonnen am 12. Jun 2004 · letzter Beitrag vom 12. Jun 2004
Antwort Antwort
Benutzerbild von Pseudemys Nelsoni
Pseudemys Nelsoni

Registriert seit: 24. Dez 2002
Ort: Hamburg-Harburg
3.551 Beiträge
 
#1

Set/Get-Capture / ReleaseCapture

  Alt 12. Jun 2004, 14:52
moin,

kann mir jemand erklären wozu diese funktionen sind? aus der hilfe des sdk werd ich nicht schlau
Mario
MSN: cyanide@ccode.de
  Mit Zitat antworten Zitat
Tubos

Registriert seit: 25. Feb 2004
Ort: Yspertal (Niederösterreich)
1.014 Beiträge
 
Delphi 7 Personal
 
#2

Re: Set/Get-Capture / ReleaseCapture

  Alt 12. Jun 2004, 15:03
Ich weiß nicht wo du geschaut hast, aber vielleicht hilft dir dieser Ausschnitt aus der Visual C++ - Hilfe weiter.
Ich hoffe, die C++-Syntay macht dir nichts aus.

SetCapture
The SetCapture function sets the mouse capture to the specified window belonging to the current thread. Once a window has captured the mouse, all mouse input is directed to that window, regardless of whether the cursor is within the borders of that window. Only one window at a time can capture the mouse.

If the mouse cursor is over a window created by another thread, the system will direct mouse input to the specified window only if a mouse button is down.

HWND SetCapture(
HWND hWnd // handle of window to receive mouse capture
);

Parameters
hWnd
Handle to the window in the current thread that is to capture the mouse.
Return Values
The return value is the handle of the window that had previously captured the mouse. If there is no such window, the return value is NULL.

Remarks
Only the foreground window can capture the mouse. When a background window attempts to do so, the window receives messages only for mouse events that occur when the cursor hot spot is within the visible portion of the window. Also, even if the foreground window has captured the mouse, the user can still click another window, bringing it to the foreground.

When the window no longer requires all mouse input, the thread that created the window should call the ReleaseCapture function to release the mouse.

This function cannot be used to capture mouse input meant for another process.

Windows 95: Calling SetCapture causes the window that is losing the mouse capture to receive a WM_CAPTURECHANGED message.


GetCapture
The GetCapture function retrieves the handle of the window (if any) that has captured the mouse. Only one window at a time can capture the mouse; this window receives mouse input whether or not the cursor is within its borders.

HWND GetCapture(VOID)

Parameters
This function has no parameters.

Return Values
The return value is the handle of the capture window associated with the current thread. If no window in the thread has captured the mouse, the return value is NULL.

Remarks
A NULL return value does not mean no other thread or process in the system has captured the mouse; it just means the current thread has not captured the mouse.


ReleaseCapture
The ReleaseCapture function releases the mouse capture from a window in the current thread and restores normal mouse input processing. A window that has captured the mouse receives all mouse input, regardless of the position of the cursor, except when a mouse button is clicked while the cursor hot spot is in the window of another thread.

BOOL ReleaseCapture(VOID)

Parameters
This function has no parameters.

Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, callGetLastError.

Remarks
An application calls this function after calling the SetCapture function.

Windows 95: Calling ReleaseCapture causes the window that is losing the mouse capture to receive a WM_CAPTURECHANGED message.


================================================== =========================
Ich bin aus Zufall beim C-Programmieren mal auf die Funktionen gestoßen und habe die Beschreibungen eigentlich recht gut verstanden.
Vielleicht hilft dir das ja auch weiter.

Grüße
Tubos
Lukas
  Mit Zitat antworten Zitat
Benutzerbild von Pseudemys Nelsoni
Pseudemys Nelsoni

Registriert seit: 24. Dez 2002
Ort: Hamburg-Harburg
3.551 Beiträge
 
#3

Re: Set/Get-Capture / ReleaseCapture

  Alt 12. Jun 2004, 15:12
hallo tubos, jo genau die habe ich auch gelesen <g>

ok ich gebe zu, mag sein das sie gut erklärt sind, aber wäre gut wenn jemand mir das mit kurzen(deutschen) worten beschreiben könnte *g*
Mario
MSN: cyanide@ccode.de
  Mit Zitat antworten Zitat
Tubos

Registriert seit: 25. Feb 2004
Ort: Yspertal (Niederösterreich)
1.014 Beiträge
 
Delphi 7 Personal
 
#4

Re: Set/Get-Capture / ReleaseCapture

  Alt 12. Jun 2004, 15:19
*g*
ok

Kurz zusammengefasst:

SetCapture: Alle Mauseingaben werden an ein bestimmtes Fenster gesendet, auch wenn sich der Cursor ausserhalb des Fensters befindet.

ReleaseCapture: Mauseingaben werden wieder normal verarbeitet.

GetCapture: Das Fenster herausfinden, das gerade die Mausereignisse abfangt.
Lukas
  Mit Zitat antworten Zitat
Benutzerbild von Pseudemys Nelsoni
Pseudemys Nelsoni

Registriert seit: 24. Dez 2002
Ort: Hamburg-Harburg
3.551 Beiträge
 
#5

Re: Set/Get-Capture / ReleaseCapture

  Alt 12. Jun 2004, 15:21
danke
Mario
MSN: cyanide@ccode.de
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:09 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