System windows forms button wndproc message m

Control. Wnd Proc(Message) Метод

Определение

Обрабатывает сообщения Windows. Processes Windows messages.

Параметры

Сообщение Message Windows для обработки. The Windows Message to process.

Примеры

В следующем примере кода показано переопределение WndProc метода для работы с сообщениями операционной системы, определенными в Message структуре. The following code example demonstrates overriding the WndProc method to handle operating system messages identified in the Message structure. Сообщение операционной системы WM_ACTIVATEAPP обрабатывается в этом примере, чтобы выяснить, когда становится активным другое приложение. The WM_ACTIVATEAPP operating system message is handled in this example to know when another application is becoming active. Сведения о доступных Message.Msg значениях, и см. в следующих разделах Message.LParam Message.WParam . See the following topics to understand the available Message.Msg, Message.LParam, and Message.WParam values. Фактические значения констант можно найти в файле заголовка Windows. h. Actual constant values can be found in the Windows.h header file.

Комментарии

Все сообщения отправляются в WndProc метод после получения фильтрации с помощью PreProcessMessage метода. All messages are sent to the WndProc method after getting filtered through the PreProcessMessage method.

Метод WndProc точно соответствует функции WindowProc Windows. The WndProc method corresponds exactly to the Windows WindowProc function. Дополнительные сведения об обработке сообщений Windows см. в разделе функция WindowProc. For more information about processing Windows messages, see the WindowProc function.

Примечания для тех, кто наследует этот метод

Наследуемые элементы управления должны вызывать метод базового класса WndProc(Message) для обработки любых сообщений, которые не обрабатываются. Inheriting controls should call the base class’s WndProc(Message) method to process any messages that they do not handle.

Native Window. Wnd Proc(Message) Метод

Определение

Вызывает процедуру окна по умолчанию, связанную с этим окном. Invokes the default window procedure associated with this window.

Параметры

Объект Message, связанный с текущим сообщением Windows. A Message that is associated with the current Windows message.

Читайте также:  Установка арч линукс рядом с виндовс 10

Примеры

В следующем примере кода показано перехват сообщений окна операционной системы в процедуре окна. The following code example demonstrates intercepting operating system window messages in a window procedure. В примере создается класс, наследующий от, NativeWindow для выполнения этого. The example creates a class that inherits from NativeWindow to accomplish this.

Класс подключается к MyNativeWindowListener процедуре окна формы, передаваемой в конструктор, и переопределяет WndProc метод для перехвата WM_ACTIVATEAPP сообщения окна. The MyNativeWindowListener class hooks into the window procedure of the form passed into the constructor, and overrides the WndProc method to intercept the WM_ACTIVATEAPP window message. Класс демонстрирует использование AssignHandle ReleaseHandle методов и для задания обрабатываемого окна NativeWindow . The class demonstrates the use of the AssignHandle and ReleaseHandle methods to identify the window handle the NativeWindow will use. Маркер назначается на основе Control.HandleCreated Control.HandleDestroyed событий и. The handle is assigned based upon the Control.HandleCreated and Control.HandleDestroyed events. Когда WM_ACTIVATEAPP получено сообщение окна, класс вызывает form1.ApplicationActivated метод. When the WM_ACTIVATEAPP window message is received, the class calls the form1.ApplicationActivated method.

Этот код является выдержкой из примера, показанного в NativeWindow обзоре класса. This code is an excerpt from the example shown in the NativeWindow class overview. Для краткости не указан некоторый код. Some code is not shown for the purpose of brevity. NativeWindowПолный листинг кода см. в разделе. See NativeWindow for the whole code listing.

Combo Box. Wnd Proc(Message) Метод

Определение

Обрабатывает сообщения Windows. Processes Windows messages.

Параметры

Сообщение Message Windows для обработки. The Windows Message to process.

Примеры

В следующем примере кода показано переопределение WndProc метода для работы с сообщениями операционной системы, определенными в Message структуре. The following code example demonstrates overriding the WndProc method to handle operating system messages identified in the Message structure. Сообщение операционной системы WM_ACTIVATEAPP обрабатывается в этом примере, чтобы выяснить, когда становится активным другое приложение. The WM_ACTIVATEAPP operating system message is handled in this example to know when another application is becoming active. /Сведения о доступных Message.Msg Message.LParam значениях, и см. в справочной документации по пакету SDK для платформы Message.WParam . Refer to the Platform SDK documentation reference located at / to understand the available Message.Msg, Message.LParam, and Message.WParam values. Фактические значения констант можно найти в файле заголовка Windows. h, который входит в комплект загрузки пакета Platform SDK (раздел Core SDK), который также доступен по адресу / . Actual constant values can be found in the Windows.h header file included in the Platform SDK (Core SDK section) download, which is also available at /.

Читайте также:  Установить nginx astra linux

Комментарии

All messages are sent to the method after getting filtered through the method.

Метод WndProc точно соответствует функции WindowProc Windows. The WndProc method corresponds exactly to the Windows WindowProc function. For more information about processing Windows messages, see the WindowProc function documentation in the Windows Platform SDK reference.

Примечания для тех, кто наследует этот метод

Наследуемые элементы управления должны вызывать метод базового класса WndProc(Message) для обработки любых сообщений, которые не обрабатываются. Inheriting controls should call the base class’s WndProc(Message) method to process any messages that they do not handle.

Menu Strip. Wnd Proc(Message) Метод

Определение

Обрабатывает сообщения Windows. Processes Windows messages.

Параметры

Сообщение Message Windows для обработки. The Windows Message to process.

Примеры

В следующем примере кода показано переопределение WndProc метода для работы с сообщениями операционной системы, определенными в Message структуре. The following code example demonstrates overriding the WndProc method to handle operating system messages identified in the Message structure. Сообщение операционной системы WM_ACTIVATEAPP обрабатывается в этом примере, чтобы выяснить, когда становится активным другое приложение. The WM_ACTIVATEAPP operating system message is handled in this example to know when another application is becoming active. /Сведения о доступных Message.Msg Message.LParam значениях, и см. в справочной документации по пакету SDK для платформы Message.WParam . Refer to the Platform SDK documentation reference located at / to understand the available Message.Msg, Message.LParam, and Message.WParam values. Фактические значения констант можно найти в файле заголовка Windows. h, который входит в комплект загрузки пакета Platform SDK (раздел Core SDK), который также доступен в документации по. Actual constant values can be found in the windows.h header file included in the Platform SDK (Core SDK section) download, which is also available on Docs.

Комментарии

Все сообщения отправляются в WndProc метод после получения фильтрации с помощью PreProcessMessage метода. All messages are sent to the WndProc method after getting filtered through the PreProcessMessage method.

Метод WndProc точно соответствует функции WindowProc Windows. The WndProc method corresponds exactly to the Windows WindowProc function. Дополнительные сведения об обработке сообщений Windows см. в разделе функция обратного вызова WindowProc. For more information about processing Windows messages, see WindowProc callback function.

Читайте также:  Работа с криптопро csp mac os

Примечания для тех, кто наследует этот метод

Наследуемые элементы управления должны вызывать метод базового класса WndProc(Message) для обработки любых сообщений, которые не обрабатываются. Inheriting controls should call the base class’s WndProc(Message) method to process any messages that they do not handle.

Message Struct

Definition

Implements a Windows message.

Examples

The following code example demonstrates overriding the WndProc method to handle operating system messages identified in the Message. The WM_ACTIVATEAPP operating system message is handled in this example to know when another application is becoming active. For information about the available Message.Msg, Message.LParam, and Message.WParam values, see the MSG Structure documentation. For information about the actual constant values, see Message Constants.

Remarks

The Message structure wraps messages that Windows sends. You can use this structure to wrap a message and assign it to the window procedure to be dispatched. You can also use this structure to get information about a message the system sends to your application or controls. For more information about Windows messages, see Messages and Message Queues.

You cannot create the Message directly. Instead, use the Create method. For the sake of efficiency, the Message uses its pool of existing Messages instead of instantiating a new one, if possible. However, if a Message is not available in the pool, a new one is instantiated.

Properties

Gets or sets the window handle of the message.

Specifies the LParam field of the message.

Gets or sets the ID number for the message.

Specifies the value that is returned to Windows in response to handling the message.

Gets or sets the WParam field of the message.

Methods

Determines whether the specified object is equal to the current object.

Returns the hash code for this instance.

Gets the LParam value and converts the value to an object.

Returns a String that represents the current Message.

Operators

Determines whether two instances of Message are equal.

Determines whether two instances of Message are not equal.

Оцените статью