Share via


XR_HOOKPROC (Windows Embedded CE 6.0)

1/6/2010

This function receives messages intended for the visual host window. This function is an application-defined callback function, which you can use to monitor or process any windows message that the graphics, windowing, and events subsystem (GWES) sends to the foundation window for the visual host.

The XR_HOOKPROC type defines a pointer to this callback function.

Syntax

BOOL CALLBACK HostHookProc(
    VOID* pv,
    HWND hwnd,
    UINT Msg,
    WPARAM wParam,
    LPARAM lParam,
    LRESULT* pRetVal
);

Parameters

  • pv
    [in] Custom parameter that you define in XRWindowCreateParams.pvUserParam that is passed into this hook procedure.
  • hwnd
    [in] Handle to the window that the message is sent to.
  • Msg
    [in] Specifies the message.
  • wParam
    [in] Specifies additional message information. The contents of this parameter depend on the value of the uMsg parameter.
  • lParam
    [in] Specifies additional message information. The contents of this parameter depend on the value of the uMsg parameter.
  • pRetVal
    [out] Specifies the value to return out of the host WndProc for that message.

Return Value

Returns TRUE if the hook procedure handled the intercepted message. Returns false if you want Silverlight to handle the intercepted message instead.

Remarks

Silverlight for Windows Embedded uses XR_HOOKPROC internally. HostHookProc is a placeholder for the name of an application-defined function that you implement.

You can implement this callback function to intercept and process windows messages that GWES sends to the foundation window for the visual host. The message-handling code in your hook procedure can process any windows message sent to the window before that window processes it.

For example, you can define a custom object that provides a message-handling routine and pass a handle to that object into XRWindowCreateParams.pvUserParam. Then, in the hook procedure, you can call the methods on the custom object in order to process the messages that the hook procedure intercepts.

If you do not want the visual host to process a particular message after your hook procedure intercepts it, write code to handle that message so that it always returns TRUE. Otherwise, the message-handling code for that message must return FALSE.

Silverlight defines the XR_HOOKPROC type as follows:

typedef BOOL (CALLBACK *XR_HOOKPROC)(VOID*, HWND, UINT, WPARAM, LPARAM, LRESULT*);

.NET Framework Equivalent

None.

Requirements

Header XamlRuntime.h
sysgen SYSGEN_XAML_RUNTIME
Windows Embedded CE Windows Embedded CE 6.0 R3

See Also

Reference

Silverlight for Windows Embedded Functions
XRWindowCreateParams