G
Guest
Can anyone tell me why makewparam gives the build error 'makewparam is not
declared'? Do I have to create a reference?
declared'? Do I have to create a reference?
Stoitcho Goutsev (100) said:Louise,
MAKEWPARAM was a c/c++ macro it is not an API function. Unless you use c++
there is no preprocessor thus, macros.
--
HTH
Stoitcho Goutsev (100) [C# MVP]
Louise said:Can anyone tell me why makewparam gives the build error 'makewparam is not
declared'? Do I have to create a reference?
Louise said:I'm using VB .NET. Do you know of a function or method
I could use instead to create wparam and lparam?
Louise said:Hi Stoitcho,
Thankyou for the reply - even though its not the answer I hoped for. I'm
using VB .NET. Do you know of a function or method I could use instead to
create wparam and lparam?
Louise
Stoitcho Goutsev (100) said:Louise,
MAKEWPARAM was a c/c++ macro it is not an API function. Unless you use
c++
there is no preprocessor thus, macros.
--
HTH
Stoitcho Goutsev (100) [C# MVP]
Louise said:Can anyone tell me why makewparam gives the build error 'makewparam is
not
declared'? Do I have to create a reference?
Stoitcho Goutsev (100) said:Hi Louise,
Does mywindow receive the messages? Because it might receive the messages
but does some checking (for example the real position of the mouse cursor or
call GetAsyncKeyState to check the mouse buttons) and then ignore the
messages. Use Spy++ tool to check if the messages are delievered to the
target
--
HTH
Stoitcho Goutsev (100) [C# MVP]
Louise said:Hello guys,
Thank you very much for your help. I think I am now creating my parameters
correctly, but this only takes me on to my next problem. I'm using these
parameters to send messages to a selected window. The messages to the
window
seem to work ok but messages to the client area have no effect. e.g.
reslt = MoveWindow(mywindow.handle, 200, 150, 175, 300, 1)
works. But
reslt = PostMessage(mywindow.handle, WM_RBUTTONDOWN, 100, 100)
reslt = PostMessage(mywindow.handle, WM_RBUTTONUP, 100, 100)
doesnt. any ideas about why that might be?
Thanks again,
Louise.
Louise said:Hi Stoitcho,
Wow, what a great tool.
My postmessage attempt doesnt seem to reach the window
reslt = PostMessage(myslave.handle, WM_RBUTTONDOWN, 100, 100)
reslt = PostMessage(myslave.handle, WM_RBUTTONUP, 100, 100)
there are no messages listed. But the send message commands
reslt = SendMessage(myslave.handle, WM_RBUTTONDOWN, 100, 100)
reslt = SendMessage(myslave.handle, WM_RBUTTONUP, 100, 100)
each produce a WM_NULL R and a WM_NULL S log record. I'm sending these
messages to notepad. Is this some sort of security device that I have to
switch off? I'm using XP SP3 and I also have Zonealarm Pro running.
Lou.
Stoitcho Goutsev (100) said:Hi Louise,
Does mywindow receive the messages? Because it might receive the messages
but does some checking (for example the real position of the mouse cursor
or
call GetAsyncKeyState to check the mouse buttons) and then ignore the
messages. Use Spy++ tool to check if the messages are delievered to the
target
--
HTH
Stoitcho Goutsev (100) [C# MVP]
Louise said:Hello guys,
Thank you very much for your help. I think I am now creating my
parameters
correctly, but this only takes me on to my next problem. I'm using
these
parameters to send messages to a selected window. The messages to the
window
seem to work ok but messages to the client area have no effect. e.g.
reslt = MoveWindow(mywindow.handle, 200, 150, 175, 300, 1)
works. But
reslt = PostMessage(mywindow.handle, WM_RBUTTONDOWN, 100, 100)
reslt = PostMessage(mywindow.handle, WM_RBUTTONUP, 100, 100)
doesnt. any ideas about why that might be?
Thanks again,
Louise.
:
Can anyone tell me why makewparam gives the build error 'makewparam is
not
declared'? Do I have to create a reference?
Stoitcho Goutsev (100) said:Hi Louise,
No there is not security for that, beside the security permisions that your
application needs to have in order to use PInvoke. As long as you can use
MoveWindow API that is a sign that you have enough security permisions.
My guess is that your WM_RBUTTONXXX has wrong numbers
They need to be
WM_MBUTTONDOWN = 0x0207
WM_MBUTTONUP = 0x0208
WM_NULL is 0x0000. I don't know how you declare those constants, but check
their value. Otherwise it doesn't make sense to me. Spy++ must've caught
posted messages on the notpad side.
--
HTH
Stoitcho Goutsev (100) [C# MVP]
Louise said:Hi Stoitcho,
Wow, what a great tool.
My postmessage attempt doesnt seem to reach the window
reslt = PostMessage(myslave.handle, WM_RBUTTONDOWN, 100, 100)
reslt = PostMessage(myslave.handle, WM_RBUTTONUP, 100, 100)
there are no messages listed. But the send message commands
reslt = SendMessage(myslave.handle, WM_RBUTTONDOWN, 100, 100)
reslt = SendMessage(myslave.handle, WM_RBUTTONUP, 100, 100)
each produce a WM_NULL R and a WM_NULL S log record. I'm sending these
messages to notepad. Is this some sort of security device that I have to
switch off? I'm using XP SP3 and I also have Zonealarm Pro running.
Lou.
Stoitcho Goutsev (100) said:Hi Louise,
Does mywindow receive the messages? Because it might receive the messages
but does some checking (for example the real position of the mouse cursor
or
call GetAsyncKeyState to check the mouse buttons) and then ignore the
messages. Use Spy++ tool to check if the messages are delievered to the
target
--
HTH
Stoitcho Goutsev (100) [C# MVP]
Hello guys,
Thank you very much for your help. I think I am now creating my
parameters
correctly, but this only takes me on to my next problem. I'm using
these
parameters to send messages to a selected window. The messages to the
window
seem to work ok but messages to the client area have no effect. e.g.
reslt = MoveWindow(mywindow.handle, 200, 150, 175, 300, 1)
works. But
reslt = PostMessage(mywindow.handle, WM_RBUTTONDOWN, 100, 100)
reslt = PostMessage(mywindow.handle, WM_RBUTTONUP, 100, 100)
doesnt. any ideas about why that might be?
Thanks again,
Louise.
:
Can anyone tell me why makewparam gives the build error 'makewparam is
not
declared'? Do I have to create a reference?
Louise said:Hi Stoitcho,
Sorry to keep on with this but its become one of those problems that has
taken over every minute of my thoughts. Still getting no response from the
target window - after anther fruitless evening.
My form declarations include:
Private Function MAKEPARAM(ByVal LoWord As Int32, ByVal HiWord As Int32)
As
Long
Return LoWord + (HiWord * 65536)
End Function
Const WM_RBUTTONDOWN = &H207
Const WM_RBUTTONUP = &H208
and I have a button_click event with:
reslt = SendMessage(mywindow.handle, WM_RBUTTONDOWN, MAKEPARAM(0, 0),
MAKEPARAM(10, 20))
reslt = SendMessage(mywindow.handle, WM_RBUTTONUP, MAKEPARAM(0, 0),
MAKEPARAM(10, 20))
the output from the spy++ log for the target window is:
<00001> 000307DA S WM_NULL wParam:00000207 lParam:00000000
<00002> 000307DA R WM_NULL lResult:00000000
<00003> 000307DA S WM_NULL wParam:00000208 lParam:00000000
<00004> 000307DA R WM_NULL lResult:00000000
I'm not sure how this output should look. I expected the first line to be
something like:
S WM_RBUTTONDOWN wParam: 00000000 lparam:00100020
Any suggestions would be very welcome.
Lou.
Stoitcho Goutsev (100) said:Hi Louise,
No there is not security for that, beside the security permisions that
your
application needs to have in order to use PInvoke. As long as you can use
MoveWindow API that is a sign that you have enough security permisions.
My guess is that your WM_RBUTTONXXX has wrong numbers
They need to be
WM_MBUTTONDOWN = 0x0207
WM_MBUTTONUP = 0x0208
WM_NULL is 0x0000. I don't know how you declare those constants, but
check
their value. Otherwise it doesn't make sense to me. Spy++ must've caught
posted messages on the notpad side.
--
HTH
Stoitcho Goutsev (100) [C# MVP]
Louise said:Hi Stoitcho,
Wow, what a great tool.
My postmessage attempt doesnt seem to reach the window
reslt = PostMessage(myslave.handle, WM_RBUTTONDOWN, 100, 100)
reslt = PostMessage(myslave.handle, WM_RBUTTONUP, 100, 100)
there are no messages listed. But the send message commands
reslt = SendMessage(myslave.handle, WM_RBUTTONDOWN, 100, 100)
reslt = SendMessage(myslave.handle, WM_RBUTTONUP, 100, 100)
each produce a WM_NULL R and a WM_NULL S log record. I'm sending these
messages to notepad. Is this some sort of security device that I have
to
switch off? I'm using XP SP3 and I also have Zonealarm Pro running.
Lou.
:
Hi Louise,
Does mywindow receive the messages? Because it might receive the
messages
but does some checking (for example the real position of the mouse
cursor
or
call GetAsyncKeyState to check the mouse buttons) and then ignore the
messages. Use Spy++ tool to check if the messages are delievered to
the
target
--
HTH
Stoitcho Goutsev (100) [C# MVP]
Hello guys,
Thank you very much for your help. I think I am now creating my
parameters
correctly, but this only takes me on to my next problem. I'm using
these
parameters to send messages to a selected window. The messages to
the
window
seem to work ok but messages to the client area have no effect. e.g.
reslt = MoveWindow(mywindow.handle, 200, 150, 175, 300, 1)
works. But
reslt = PostMessage(mywindow.handle, WM_RBUTTONDOWN, 100,
100)
reslt = PostMessage(mywindow.handle, WM_RBUTTONUP, 100, 100)
doesnt. any ideas about why that might be?
Thanks again,
Louise.
:
Can anyone tell me why makewparam gives the build error 'makewparam
is
not
declared'? Do I have to create a reference?