Jump to content

WinShowTrackRect

From EDM2
Revision as of 16:24, 9 April 2025 by Martini (talk | contribs) (Created page with "This function hides or shows the tracking rectangle. ==Syntax==  WinShowTrackRect(hwnd, fShow) ==Parameters== ;hwnd (HWND) - Input : Window handle. : Passed to the WinTrackRect function. ;fShow (BOOL) - Input : Show indicator. :;TRUE ::Show the tracking rectangle :;FALSE ::Hide the tracking rectangle. ==Returns== ;rc (BOOL) - returns :Success indicator. :;TRUE ::Successful completion :;FALSE ::Error occurred. ==Remarks== This function maintains a sho...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function hides or shows the tracking rectangle.

Syntax

 WinShowTrackRect(hwnd, fShow)

Parameters

hwnd (HWND) - Input
Window handle.
Passed to the WinTrackRect function.
fShow (BOOL) - Input
Show indicator.
TRUE
Show the tracking rectangle
FALSE
Hide the tracking rectangle.

Returns

rc (BOOL) - returns
Success indicator.
TRUE
Successful completion
FALSE
Error occurred.

Remarks

This function maintains a show count. When a hide request is made, this count is decremented; when a show request is made, the count is incremented. When the count makes a transition from 0 to -1, the rectangle is hidden; when the count makes a transition from -1 to 0, the rectangle is shown. When a rectangle is tracking, the application must call this function to hide the rectangle if there is a possibility of corrupting the tracking rectangle while drawing. The rectangle is shown afterwards. Because the structure is updated continuously, the application can examine the coordinates of the current tracking rectangle to determine whether temporary hiding is necessary. The only case where an application needs to use this function is during asynchronous drawing. If an application is drawing on one thread, and issuing WinTrackRect on another, unwanted areas of tracking rectangle may be left behind. The drawing thread is therefore responsible for calling this function whenever tracking is in progress. The application must provide for communication between the two threads to ensure that if one thread is tracking, the drawing thread issues this function. This can be done with a Template:Hp1.

Errors

Possible returns from WinGetLastError:

  • PMERR_INVALID_HWND (0x1001) An invalid window handle was specified.

Related Functions