hWnd
Window handle value returned from CreateWindow or CreateWindowEX.
L
Logs messages to the SoftICE Command window.
begin-msg
Single Windows message or lower message number in a range of Windows messages. If you do not specify a range with an end-msg, only the begin-msg will cause a break.
Note: For both begin-msg and end-msg, the message numbers can be specified either in hexadecimal or by using the actual ASCII names of the messages, for example, WM_QUIT.
end-msg
Higher message number in a range of Windows messages.
IF expression
Conditional expression: the expression must evaluate to TRUE (non-zero) for the breakpoint to trigger.
DO command
Breakpoint action: A series of SoftICE commands can execute when the breakpoint triggers.
Note: You can combine breakpoint count functions (BPCOUNT, BPMISS, BPTOTAL, BPLOG, and BPINDEX) with conditional expressions to monitor and control breakpoints based on the number of times a particular breakpoint has or has not triggered. See the chapter on “Using Breakpoints,” in the Using SoftICE document.
Use
The BMSG command is used to set breakpoints on a window’s message handler that will trigger when it receives messages that either match a specified message type, or fall within an indicated range of message types.
If you do not specify a message range, the breakpoint applies to ALL Windows messages.
If you specify the L parameter, SoftICE logs the messages into the Command window instead of popping up when the message occurs.
When SoftICE does pop up on a BMSG breakpoint, the instruction pointer (CS:[E]IP) is set to the first instruction of the message handling procedure. Each time SoftICE breaks, the current message displays in the following format:
Note: These are the parameters that are passed to the message procedure. All numbers are hexadecimal. The message-name is the Windows defined name for the message.
To display valid Windows messages, enter the WMSG command with no parameters. To obtain valid window handles, use the HWND command.
You can set multiple BMSG breakpoints on one window-handle, but the message ranges for the breakpoints might not overlap.
Example
This command sets a breakpoint on the message handler for the Window that has the handle 9BC. The breakpoint triggers and SoftICE pops up when the message handler receives messages with a type within the range WM_MOUSEFIRST to WM_MOUSELAST, inclusive. This range includes all of the Windows mouse messages.
:BMSG 9BC wm_mousefirst wm_mouselast
The next command places a breakpoint on the message handler for the Window with the handle F4C. The L parameter causes SoftICE to log the breakpoint information to the SoftICE Command window when the breakpoint is triggered, instead of popping up. The message range on which the breakpoint triggers includes any message with a type value less than or equal to WM_CREATE. You can view the output from this breakpoint being triggered by popping into SoftICE and scrolling through the command buffer.