Jump to content

WinDestroyCursor: Difference between revisions

From EDM2
Created page with "This function destroys the current cursor, if it belongs to the specified window. ==Syntax== WinDestroyCursor(hwnd); ==Parameters== ; hwnd (HWND) - input :Window handle t..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
This function destroys the current cursor, if it belongs to the specified window.
This function destroys the current cursor, if it belongs to the specified window.
==Syntax==
==Syntax==
  WinDestroyCursor(hwnd);
  WinDestroyCursor(hwnd)
 
==Parameters==
==Parameters==
; hwnd ([[HWND]]) - input
;hwnd ([[HWND]]) - input:Window handle to which the cursor belongs.
:Window handle to which the cursor belongs.


==Returns==
==Returns==
;rc (BOOL) - returns
;rc (BOOL) - returns:Success indicator.
:Success indicator.
::TRUE - Successful completion
:;TRUE
::FALSE - Error occurred.
::Successful completion
 
:;FALSE
::Error occurred.
==Errors==
==Errors==
Possible returns from WinGetLastError
Possible returns from WinGetLastError
;PMERR_INVALID_HWND (0x1001)
;PMERR_INVALID_HWND (0x1001):An invalid window handle was specified.
:An invalid window handle was specified.
 
==Remarks==
==Remarks==
This function has no effect if the current cursor does not belong to the specified window.
This function has no effect if the current cursor does not belong to the specified window.
Line 22: Line 21:
It is not necessary to call this function before calling the WinCreateCursor function.
It is not necessary to call this function before calling the WinCreateCursor function.


If the cursor was created with the CURSOR_FLASH option, then the TID_CURSOR timer is also destroyed.  
If the cursor was created with the CURSOR_FLASH option, then the TID_CURSOR timer is also destroyed.
 
==Example Code==
==Example Code==
This example destroys the cursor defined for the specified input window.
This example destroys the cursor defined for the specified input window.
Line 33: Line 33:


fSuccess = WinDestroyCursor(hwnd);
fSuccess = WinDestroyCursor(hwnd);
</pre>
Definition
<pre>
#define INCL_WINCURSORS /* Or use INCL_WIN, INCL_PM, Also in COMMON section */
#include <os2.h>
HWND    hwnd;  /*  Window handle to which the cursor belongs. */
BOOL    rc;    /*  Success indicator. */
rc = WinDestroyCursor(hwnd);
</pre>
</pre>



Latest revision as of 19:50, 12 April 2024

This function destroys the current cursor, if it belongs to the specified window.

Syntax

WinDestroyCursor(hwnd)

Parameters

hwnd (HWND) - input
Window handle to which the cursor belongs.

Returns

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

Errors

Possible returns from WinGetLastError

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

Remarks

This function has no effect if the current cursor does not belong to the specified window.

It is not necessary to call this function before calling the WinCreateCursor function.

If the cursor was created with the CURSOR_FLASH option, then the TID_CURSOR timer is also destroyed.

Example Code

This example destroys the cursor defined for the specified input window.

#define INCL_WINCURSORS         /* Window Cursor Functions      */
#include <os2.h>

BOOL  fSuccess;         /* success indicator                    */
HWND    hwnd;           /* cursor display window                */

fSuccess = WinDestroyCursor(hwnd);

Related Functions