Application.RegisterMessageLoop Method (Application.MessageLoopCallback)


Registers a callback for checking whether the message loop is running in hosted environments.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

[<SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)>]
static member RegisterMessageLoop : 
        callback:Application.MessageLoopCallback -> unit


Type: System.Windows.Forms.Application.MessageLoopCallback

The method to call when Windows Forms needs to check if the hosting environment is still sending messages.

This method is used when hosting Windows Forms in another environment, such as an unmanaged application. In hosted environments, the MessageLoop property will always return false if Windows Forms is not processing messages. Use this callback to tell Windows Forms if the hosting environment is still processing messages.

.NET Framework
Available since 2.0
Return to top