做filter,运行状态控件是灰色的,不可修改的
在这里用到了EnableWindow函数。
EnableWindow(m_hComboBox, FALSE);
EnableWindow(m_hEditIpAddr, FALSE);
EnableWindow(m_hEditIpPort, FALSE);
EnableWindow(m_hEditSdelay, FALSE);
EnableWindow(m_hEditIpAddrUDP, FALSE);
EnableWindow(m_hEditIpPortUDP, FALSE);
EnableWindow(m_hEditSdelayUDP, FALSE);
停止状态是白色的,可修改的
EnableWindow(m_hComboBox, TRUE);
EnableWindow(m_hEditIpAddr, TRUE);
EnableWindow(m_hEditIpPort, TRUE);
EnableWindow(m_hEditSdelay, TRUE);
EnableWindow(m_hEditIpAddrUDP, TRUE);
EnableWindow(m_hEditIpPortUDP, TRUE);
EnableWindow(m_hEditSdelayUDP, TRUE);
MSDN的是这样介绍的:
EnableWindow Function
The EnableWindow function 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
BOOL EnableWindow( HWND hWnd, BOOL bEnable );
Parameters
hWnd
- [in] Handle to the window to be enabled or disabled.
bEnable- [in] 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
If the window was previously disabled, the return value is nonzero.
If the window was not previously disabled, the return value is zero. To get extended error information, call GetLastError .
bEnable 是
TRUE的时候为可修改的,
FALSE的时候为不可修改的。