Partager via


GweBypassCoredllThunk_t::EnableWindow_I (Windows Embedded CE 6.0)

1/6/2010

This method enables or disables mouse and keyboard input to the specified window or control. When input is disabled, the window does not receive input such as mouse clicks and key presses. When input is enabled, the window receives all input.

Syntax

static BOOL WINAPI EnableWindow_I(
  HWND hwndThis,
  BOOL bEnable
);

Parameters

  • hwndThis
    [in] Handle to the window to be enabled or disabled.
  • bEnable
    [in] Boolean that specifies whether to enable or disable the window. If this parameter is TRUE, the window is enabled. If the parameter is FALSE, the window is disabled.

Return Value

Nonzero indicates that the window was previously disabled. Zero indicates that the window was not previously disabled. To get extended error information, call GetLastError.

Remarks

This method is an internal version of the EnableWindow function.

If the enabled state of a window is changing, a WM_ENABLE message is sent before the GweBypassCoredllThunk_t::EnableWindow_I method returns. If a window is already disabled, all its child windows are implicitly disabled, although they are not sent a WM_ENABLE message.

A window must be enabled before it can be activated. For example, if an application is displaying a modeless dialog box and has disabled the main window of the application, the application must enable the main window before destroying the dialog box. Otherwise, another window receives the keyboard focus and is activated. If a child window is disabled, it is ignored when the system tries to determine which window should receive mouse messages.

By default, a window is enabled when it is created. To create a window that is initially disabled, an application can specify the WS_DISABLED style in the CreateWindow or CreateWindowEx function. After a window has been created, an application can use GweBypassCoredllThunk_t::EnableWindow_I to enable or disable the window.

An application can use this method to enable or disable a control in a dialog box. A disabled control cannot receive the keyboard focus, nor can a user gain access to it.

Requirements

Header gwebypasscoredllthunk.hpp
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

GweBypassCoredllThunk_t
CreateWindow
CreateWindowEx
EnableWindow
GweBypassCoredllThunk_t::IsWindowEnabled_I
WM_ENABLE