Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than Constants, prefix the name with the module name and a period.
BM_CLICK (Constants)
.
/// <summary>
/// This message is sent by an application to simulate the user clicking a button. This message causes the button to receive a WM_LBUTTONDOWN and a WM_LBUTTONUP message, and the button's parent window to receive a BN_CLICKED message.
/// </summary>
public enum ButtonControlMessages: uint
{
BM_GETCHECK = 0x00F0,
BM_SETCHECK = 0x00F1,
BM_GETSTATE = 0x00F2,
BM_SETSTATE = 0x00F3,
BM_SETSTYLE = 0x00F4,
BM_CLICK = 0x00F5,
BM_GETIMAGE = 0x00F6,
BM_SETIMAGE = 0x00F7
}
Example
// buttonWindowHandle - handle of Button window
SendMessage(buttonWindowHandle, BM_CLICK, (IntPtr)0, (IntPtr)0);
Example VB.net
<Runtime.InteropServices.DllImport("user32.dll", SetLastError:=True, CharSet:=Runtime.InteropServices.CharSet.Auto)> _
Public Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
End Function
Public BM_CLICK As Integer = &HF5
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SendMessage(Me.Button2.Handle, BM_CLICK, 0, 0)
'The same
Button2_Click(sender, e)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
MessageBox.Show("Click")
End Sub
An IntPtr is a pointer to a memory location (unmanaged) that adapts to the platform it is running on (64-bit, etc.) UNLIKE a standard int/Integer. You should always use this type for unmanaged calls that require it, even though an int will appear to work on your development machine.
1/13/2008 4:00:13 AM - Damon Carr-72.43.165.29
An IntPtr is a pointer to a memory location (unmanaged) that adapts to the platform it is running on (64-bit, etc.) UNLIKE a standard int/Integer. You should always use this type for unmanaged calls that require it, even though an int will appear to work on your development machine.
1/13/2008 4:00:13 AM - Damon Carr-72.43.165.29
Please edit this page!
Do you have...
- helpful tips?
- corrections to the existing content?
- additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it!