L_CaptureSetHotKeyCallback

#include "l_bitmap.h"

L_LTSCR_API L_INT L_CaptureSetHotKeyCallback(pfnCaptureHotKeyCB, pUserData)

CAPTUREHOTKEYCALLBACK pfnCaptureHotKeyCB;

notification callback

L_VOID * pUserData;

pointer to more parameters for the callback

Sets the callback function that will be called to notify the application that the user has pressed the capture HotKey.

Parameter

Description

pfnCaptureHotKeyCB

Callback function notifying the application that the HotKey was pressed. Specify NULL to cancel the previously assigned callback and terminate the waiting process.

pUserData

Void pointer that you can use to pass one or more additional parameters that the callback function needs.

 

To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID ;*. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.

 

If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

None.

Comments

Call this function to cause LEADTOOLS to wait and check for the HotKey specified in a call to L_SetCaptureOption to be pressed. When this HotKey is pressed, the CaptureHotKeyCB callback will be called to notify the application that the user wishes to capture an image. By default, there is no waiting process for the capture HotKey.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_SetCaptureOption, CAPTUREHOTKEYCALLBACK

Topics:

Screen Capture C API Function Groups: Setting Information Functions

 

Implementing Screen Capture

Example

L_INT EXT_CALLBACK CaptureHotKeyCB(L_INT    nHotKey, 
L_UINT   uHotKeyModifiers, 
L_VOID * pUserData) 
{ 
   UNREFERENCED_PARAMETER(nHotKey); 
   UNREFERENCED_PARAMETER(uHotKeyModifiers); 
   UNREFERENCED_PARAMETER(pUserData); 
   MessageBox(NULL, TEXT("HotKey"), TEXT("HotKey Pressed"), MB_OK); 
   /* start a capture here */ 
   return SUCCESS; 
} 
L_INT CaptureSetHotKeyCallbackExample(L_VOID) 
{ 
   /*To call the L_CaptureSetHotKeyCallback*/ 
   L_INT nRet = L_CaptureSetHotKeyCallback(CaptureHotKeyCB, NULL); 
   return nRet; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Screen Capture C API Help