Application.RegisterMessageLoop Method (Application.MessageLoopCallback)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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)]
public static void RegisterMessageLoop(
	Application.MessageLoopCallback callback
)

Parameters

callback
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
Show: