Hi,
Here I placed a button and label on a form. When you click on the
button it sends a wm_lbuttondown message to the label. You receive the
mousedown event for the label.
Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As IntPtr, ByVal wMsg As Integer, _
ByVal wParam As Integer, ByVal lParam As Integer) As Integer
Private Const HTCAPTION As Integer = 2
Private Const WM_LBUTTONDOWN As Integer = &H201
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
SendMessage(Label1.Handle, WM_LBUTTONDOWN, HTCAPTION, 0)
End Sub
Private Sub Label1_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles Label1.MouseDown
MessageBox.Show("Mouse Down")
End Sub
Ken
----------------------
"Afshin" <af****@negareh.com> wrote in message
news:ee**************@TK2MSFTNGP10.phx.gbl:
in using API calls I have another problem, I can not find "hwnd" and
"Handle" property is an object deferent. I am using ".Handle.ToInt32" but
it
seems it is not working yet.
SendMessage(Me.lblCaption.Handle.ToInt32, WM_NCLBUTTONDOWN, HTCAPTION,
0)
Af,
"Afshin Eftekhar" <HYPERLINK
"mailto:af****@negareh.com"af****@negareh.com> wrote in message
news:ui**************@TK2MSFTNGP11.phx.gbl...
when I was working with VB 6.0 I used to use API function "SendMessage"
to
sending windows messages to forms and controls. Now In VB.net it seems
that
VB doean't support API functions as usual and the function was
replaced
with
"Message" object. in message object there is "lparam" and "wparam"
arguments
which are declared as "intptr" datatype. intptr is some kind of
pointer.
So,
I can not use API viewer constants like "HTCAPTION" in that case.
I don't understand how can I get the correct arguments and how can I
use
"message" object instead of "SendMessage" function?
is there somebody who can help?
thanks
Afshin
--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (
http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.1.2 - Release Date: 6/7/2004