LBitmapWindow::SetCursor (original) (raw)
Summary
Sets the cursor for the specified tool type.
Syntax
#include "ltwrappr.h"
virtual HCURSOR LBitmapWindow::SetCursor(hCursor, uToolType = TOOL_USERMODE)
Parameters
HCURSOR hCursor
Handle to the cursor to be used for the specified tool type. This HCURSOR must remain valid until it is no longer needed. No copy is made. Specify NULL to reset the cursor for all tool types to the default cursors.
L_UINT uToolType
Flag that indicates the tool type for which the new cursor will be used. Possible values are:
Value | Meaning |
---|---|
TOOL_PANIMAGE | Set the cursor for the Pan tool. |
TOOL_ZOOMRECT | Set the cursor for the Zoom To Rect tool. |
TOOL_ZOOM_ON_MOUSECLICK | Set the cursor for the Zoom On Mouse Click tool. |
TOOL_REGION | Set the cursor for the Region tool. |
0 | Set the cursor for the window. |
Returns
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Comments
Specify NULL to reset the cursor for all tool types to the default cursors.
Required DLLs and Libraries
- LTKRN
- LTWVC
- For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.
Platforms
Win32, x64.
See Also
Example
class MyTestBitmapWindow : public LBitmapWindow {
protected:
virtual L_BOOL OnSetCursor(HWND /*hWnd*/, L_UINT /*nHitTest*/, L_UINT /*message*/)
{
return L_TRUE;
}
};
L_INT LBitmapWindow__SetCursorExample(HWND hWndParent)
{
L_INT nRet;
MyTestBitmapWindow LeadBitmapWnd ;
nRet = LeadBitmapWnd.Load(MAKE_IMAGE_PATH(TEXT("IMAGE1.CMP")));
if(nRet !=SUCCESS)
return nRet;
if (LeadBitmapWnd.CreateWnd(hWndParent, TRUE, 0, 0, 100, 100) == NULL)
return FAILURE;
LeadBitmapWnd.EnableCallBack(L_TRUE);
HCURSOR hCursor;
hCursor = LeadBitmapWnd.SetCursor(LoadCursor(NULL, IDC_ARROW), TOOL_MAGGLASS);
return SUCCESS;
}
LEADTOOLS Raster Imaging C++ Class Library Help