WinQuerySysPointer: Difference between revisions
No edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
This function returns the system-pointer handle. | This function returns the system-pointer handle. | ||
==Syntax== | ==Syntax== | ||
WinQuerySysPointer(hwndDeskTop, lIdentifier, fCopy) | WinQuerySysPointer(hwndDeskTop, lIdentifier, fCopy) | ||
==Parameters== | ==Parameters== | ||
;hwndDeskTop (HWND) - input | ;hwndDeskTop (HWND) - input:Desktop-window handle. | ||
:Desktop-window handle. | ;lIdentifier (LONG) - input:System-pointer identifier. | ||
::SPTR_ARROW - Arrow pointer | |||
;lIdentifier (LONG) - input | ::SPTR_TEXT - Text I-beam pointer | ||
:System-pointer identifier. | ::SPTR_WAIT - Hourglass pointer | ||
::SPTR_SIZE - Size pointer | |||
: | ::SPTR_MOVE - Move pointer | ||
::SPTR_SIZENWSE - Downward-sloping, double-headed arrow pointer | |||
: | ::SPTR_SIZENESW - Upward-sloping, double-headed arrow pointer | ||
::SPTR_SIZEWE - Horizontal, double-headed arrow pointer | |||
: | ::SPTR_SIZENS - Vertical, double-headed arrow pointer | ||
::SPTR_APPICON - Standard application icon pointer | |||
: | ::SPTR_ICONINFORMATION - Information icon pointer | ||
::SPTR_ICONQUESTION - Question mark icon pointer | |||
: | ::SPTR_ICONERROR - Exclamation mark icon pointer | ||
::SPTR_ICONWARNING - Warning icon pointer | |||
: | ::SPTR_ILLEGAL - Illegal operation icon pointer | ||
::SPTR_FILE - Single file icon pointer | |||
: | ::SPTR_MULTFILE - Multiple files icon pointer | ||
::SPTR_FOLDER - Folder icon pointer | |||
: | ::SPTR_PROGRAM - Application program icon pointer | ||
;fCopy (BOOL) - input:Copy indicator. | |||
: | ::TRUE - Create a copy of the default system pointer and return its handle. Specify this value if the system pointer is to be modified. The application should destroy the copy of the pointer created. This can be done by using the WinDestroyPointer function. | ||
::FALSE - Return the handle of the current system pointer. | |||
: | |||
: | |||
: | |||
: | |||
: | |||
: | |||
: | |||
: | |||
: | |||
: | |||
;fCopy (BOOL) - input | |||
:Copy indicator. | |||
: | |||
: | |||
==Returns== | ==Returns== | ||
;hptrPointer (HPOINTER) - returns | ;hptrPointer (HPOINTER) - returns:Pointer handle. | ||
:Pointer handle. | |||
==Errors== | ==Errors== | ||
Possible returns from WinGetLastError | Possible returns from WinGetLastError | ||
;PMERR_PARAMETER_OUT_OF_RANGE (0x1003) | ;PMERR_INVALID_HWND (0x1001):An invalid window handle was specified. | ||
:The value of a parameter was not within the defined valid range for that parameter. | ;PMERR_PARAMETER_OUT_OF_RANGE (0x1003):The value of a parameter was not within the defined valid range for that parameter. | ||
==Remarks== | ==Remarks== | ||
Take care when using the pointer bit-map handles returned by the WinQueryPointerInfo function in the POINTERINFO structure. If the handle is a system-pointer handle, or is returned by the WinQueryPointerInfo function, it is possible that another application is also accessing the bit-map handle. If this is so, selecting the bit map into a presentation space may fail. Only the active thread may use the bit-map handle returned by either the WinQuerySysPointer function, when fCopy is FALSE, or by the WinQueryPointerInfo function. | Take care when using the pointer bit-map handles returned by the WinQueryPointerInfo function in the POINTERINFO structure. If the handle is a system-pointer handle, or is returned by the WinQueryPointerInfo function, it is possible that another application is also accessing the bit-map handle. If this is so, selecting the bit map into a presentation space may fail. Only the active thread may use the bit-map handle returned by either the WinQuerySysPointer function, when fCopy is FALSE, or by the WinQueryPointerInfo function. | ||
Note: This rule is not enforced by the system; therefore, ensure that the program handles selection failures correctly. | |||
==Sample Code== | ==Sample Code== | ||
This example calls WinQuerySysPointer to get a handle to the system pointer, and then loads an application-defined pointer. After it has finished using the application-defined pointer, it restores the system pointer. | |||
<PRE> | <PRE> | ||
#define INCL_WINPOINTERS | #define INCL_WINPOINTERS | ||
#include <os2.h> | #include <os2.h> | ||
#define IDP_CROSSHAIR 900 | #define IDP_CROSSHAIR 900 | ||
Line 112: | Line 65: | ||
WinSetPointer(HWND_DESKTOP, hptrDefault); | WinSetPointer(HWND_DESKTOP, hptrDefault); | ||
</PRE> | </PRE> | ||
==Related Functions== | ==Related Functions== | ||
*WinCreatePointer | *WinCreatePointer | ||
*WinCreatePointerIndirect | *WinCreatePointerIndirect | ||
*WinDestroyPointer | *WinDestroyPointer | ||
*WinDrawPointer | *WinDrawPointer | ||
*WinLoadPointer | *WinLoadPointer | ||
*WinQueryPointer | *WinQueryPointer | ||
*WinQueryPointerInfo | *WinQueryPointerInfo | ||
*WinQueryPointerPos | *WinQueryPointerPos | ||
*WinQuerySysPointer | *WinQuerySysPointer | ||
*WinQuerySysPointerData | *WinQuerySysPointerData | ||
*WinSetPointer | *WinSetPointer | ||
*WinSetPointerPos | *WinSetPointerPos | ||
*WinSetSysPointerData | *WinSetSysPointerData | ||
*WinShowPointer | *WinShowPointer | ||
[[Category:Win]] | [[Category:Win]] |
Revision as of 01:23, 27 April 2024
This function returns the system-pointer handle.
Syntax
WinQuerySysPointer(hwndDeskTop, lIdentifier, fCopy)
Parameters
- hwndDeskTop (HWND) - input
- Desktop-window handle.
- lIdentifier (LONG) - input
- System-pointer identifier.
- SPTR_ARROW - Arrow pointer
- SPTR_TEXT - Text I-beam pointer
- SPTR_WAIT - Hourglass pointer
- SPTR_SIZE - Size pointer
- SPTR_MOVE - Move pointer
- SPTR_SIZENWSE - Downward-sloping, double-headed arrow pointer
- SPTR_SIZENESW - Upward-sloping, double-headed arrow pointer
- SPTR_SIZEWE - Horizontal, double-headed arrow pointer
- SPTR_SIZENS - Vertical, double-headed arrow pointer
- SPTR_APPICON - Standard application icon pointer
- SPTR_ICONINFORMATION - Information icon pointer
- SPTR_ICONQUESTION - Question mark icon pointer
- SPTR_ICONERROR - Exclamation mark icon pointer
- SPTR_ICONWARNING - Warning icon pointer
- SPTR_ILLEGAL - Illegal operation icon pointer
- SPTR_FILE - Single file icon pointer
- SPTR_MULTFILE - Multiple files icon pointer
- SPTR_FOLDER - Folder icon pointer
- SPTR_PROGRAM - Application program icon pointer
- fCopy (BOOL) - input
- Copy indicator.
- TRUE - Create a copy of the default system pointer and return its handle. Specify this value if the system pointer is to be modified. The application should destroy the copy of the pointer created. This can be done by using the WinDestroyPointer function.
- FALSE - Return the handle of the current system pointer.
Returns
- hptrPointer (HPOINTER) - returns
- Pointer handle.
Errors
Possible returns from WinGetLastError
- PMERR_INVALID_HWND (0x1001)
- An invalid window handle was specified.
- PMERR_PARAMETER_OUT_OF_RANGE (0x1003)
- The value of a parameter was not within the defined valid range for that parameter.
Remarks
Take care when using the pointer bit-map handles returned by the WinQueryPointerInfo function in the POINTERINFO structure. If the handle is a system-pointer handle, or is returned by the WinQueryPointerInfo function, it is possible that another application is also accessing the bit-map handle. If this is so, selecting the bit map into a presentation space may fail. Only the active thread may use the bit-map handle returned by either the WinQuerySysPointer function, when fCopy is FALSE, or by the WinQueryPointerInfo function.
Note: This rule is not enforced by the system; therefore, ensure that the program handles selection failures correctly.
Sample Code
This example calls WinQuerySysPointer to get a handle to the system pointer, and then loads an application-defined pointer. After it has finished using the application-defined pointer, it restores the system pointer.
#define INCL_WINPOINTERS #include <os2.h> #define IDP_CROSSHAIR 900 HWND hptrDefault, hptrCrossHair; /* get the system pointer */ hptrDefault = WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE); /* load an application-defined pointer */ hptrCrossHair = WinLoadPointer(HWND_DESKTOP, (ULONG)0, IDP_CROSSHAIR); /* change the pointer to the application pointer */ WinSetPointer(HWND_DESKTOP, hptrCrossHair); /* restore the system pointer */ WinSetPointer(HWND_DESKTOP, hptrDefault);
Related Functions
- WinCreatePointer
- WinCreatePointerIndirect
- WinDestroyPointer
- WinDrawPointer
- WinLoadPointer
- WinQueryPointer
- WinQueryPointerInfo
- WinQueryPointerPos
- WinQuerySysPointer
- WinQuerySysPointerData
- WinSetPointer
- WinSetPointerPos
- WinSetSysPointerData
- WinShowPointer