private const int RF_TESTMESSAGE = 0xA123;
[DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]
public static extern int SendMessage(IntPtr hwnd,
[MarshalAs(UnmanagedType.U4)] int Msg, uint wParam, ulong lParam);
I'm trying to send a Windows message from a VB.NET 2005 app. I found
this example in C# that works fine, but I cannot figure out the VB
sysntax.
Thanks,
John 5 3119
On Mar 9, 3:50*pm, "John Heitmuller." <john.heitmul...@jrfcorp.net>
wrote:
private const int RF_TESTMESSAGE = 0xA123;
[DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]
public static extern int SendMessage(IntPtr hwnd,
[MarshalAs(UnmanagedType.U4)] int Msg, uint wParam, ulong lParam);
I'm trying to send a Windows message from a VB.NET 2005 app. *I found
this example in C# that works fine, but I cannot figure out the VB
sysntax.
Thanks,
John
Try this (untested):
Private Const RF_TESTMESSAGE As Integer = 41251
<DllImport("user32.dll", CharSet := CharSet.Auto, SetLastError :=
True)_
Public Shared Function SendMessage(ByVal hwnd As IntPtr,
<MarshalAs(UnmanagedType.U4)_
ByVal Msg As Integer, ByVal wParam As UInteger, ByVal lParam As ULong)
As Integer
End Function
"John Heitmuller." <jo*************@jrfcorp.netschrieb:
private const int RF_TESTMESSAGE = 0xA123;
[DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]
public static extern int SendMessage(IntPtr hwnd,
[MarshalAs(UnmanagedType.U4)] int Msg, uint wParam, ulong lParam);
Are you sure the parameter types for the 'wParam' and 'lParam' parameters
are correct? Note that they are 'IntPtr's, which means that they are 32-bit
types on 32-bit Windows versions and 64-bit types on 64-bit versions.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
(Instant VB)
Private Const RF_TESTMESSAGE As Integer = &HA123
<DllImport("user32.dll", CharSet:=CharSet.Auto, SetLastError:=True)_
Public Shared Function SendMessage(ByVal hwnd As IntPtr,
<MarshalAs(UnmanagedType.U4)ByVal Msg As Integer, ByVal wParam As UInteger,
ByVal lParam As ULong) As Integer
End Function
-- http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
Java to C#
Java to VB
Instant C#: convert VB to C#
Instant VB: convert C# to VB
Instant C++: VB, C#, or Java to C++/CLI
"John Heitmuller." wrote:
private const int RF_TESTMESSAGE = 0xA123;
[DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]
public static extern int SendMessage(IntPtr hwnd,
[MarshalAs(UnmanagedType.U4)] int Msg, uint wParam, ulong lParam);
I'm trying to send a Windows message from a VB.NET 2005 app. I found
this example in C# that works fine, but I cannot figure out the VB
sysntax.
Thanks,
John
"John Heitmuller." wrote:
private const int RF_TESTMESSAGE = 0xA123;
[DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]
public static extern int SendMessage(IntPtr hwnd,
[MarshalAs(UnmanagedType.U4)] int Msg, uint wParam, ulong lParam);
I'm trying to send a Windows message from a VB.NET 2005 app. I found
this example in C# that works fine, but I cannot figure out the VB
sysntax.
Thanks,
John http://www.pinvoke.net/ lists the following definition for SendMessage in
VB.net:
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)_
Function SendMessage( _
ByVal hWnd As HandleRef, _
ByVal Msg As UInteger, _
ByVal wParam As IntPtr, _
ByVal lParam As IntPtr) As IntPtr
End Function
Thanks to everybody. With your help I got it working. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Brandon J. Van Every |
last post by:
I'm realizing I didn't frame my question well.
What's ***TOTALLY COMPELLING*** about Ruby over Python? What makes you jump
up in your chair and scream "Wow! Ruby has *that*? That is SO...
|
by: David MacQuigg |
last post by:
I'm concerned that with all the focus on obj$func binding, &closures,
and other not-so-pretty details of Prothon, that we are missing what
is really good - the simplification of classes. There are...
|
by: Hermawih |
last post by:
Hello ,
I want your opinion about this .
In order to say it clearly , I think I have to describe it in long sentences .
I could consider myself as Intermediate/Advance Access Developer ;...
|
by: Hai Nguyen |
last post by:
I'm learning C sharp and do not like vb much. I'm creatiing a wepage using
panel to test myself. I tried to use these code below, which is written in
VB, and to transform them to c sharp but I got...
|
by: Hermawih |
last post by:
Hello ,
I want your opinion about this .
In order to say it clearly , I think I have to describe it in long sentences .
I could consider myself as Intermediate/Advance Access Developer ;...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |