I am working on automating a program whose source I don't have. I have everything working except I am struggling with sending a message to two fields. I am able to send the characters using a cmdlet created by Dr. McCaffrey, which uses sendmessage.
The problem is that this appends the characters to the end of the field. I want to make another cmdlet that clears the field first so that I may then append the characters to it but I canot figure out how to do that with sendmesage and I was unable to find anything about that in the user32 library.
Thanks for the help all.
2 1674
Hi Gerdescm,
I dont know which platform ur using.
in linux and other RTOS :- we can use message-ques for sending and receiving the messages.
ur problem: see have a buffer( file for storing the messages), before writing into buffer make sure u ask the question whether :
1. to append to the existing file,
2. to clear the earlier contents.
!!Sorry!! if i have not given the solution.
Regards,
Answers.
Hey, thanks for the response. I am running on windows XP, so that does not supply the answer sadly. to give a bit more detail on how it is working, the cmdlet is using the user32.dll library which has a sendmessage function contained within. The sendmessage function can do many things when interfacing with a window control (it can click buttons append to fields etc) but I cannot find documentation on how to select what it is to do or what capabilities it has. I believe (judging by the code) that the WM_CHAR = 0x0102 is what specifies that it should be appending characters to the field. Unfortunately I have not been able to find information on what I would need to specify to have it either clear the field or simply replace the contents of the field with what I specify. I have included the code of the cmdlet that appends characters below. Thanks again for your help! -
[Cmdlet(VerbsCommunications.Send, "Chars")]
-
public class SendCharsCommand : Cmdlet
-
{
-
private IntPtr handleControl;
-
private string s;
-
-
[Parameter(Position = 0)]
-
public IntPtr HandleControl {
-
get { return handleControl; }
-
set { handleControl = value; }
-
}
-
-
[Parameter(Position = 1)]
-
public string S {
-
get { return s; }
-
set { s = value; }
-
}
-
-
[DllImport("user32.dll", EntryPoint = "SendMessage", CharSet = CharSet.Auto)]
-
private static extern void SendMessage(IntPtr hWnd, uint msg, int wParam, int lParam);
-
-
protected override void ProcessRecord() {
-
uint WM_CHAR = 0x0102;
-
foreach (char c in s) {
-
SendMessage(handleControl, WM_CHAR, c, 0);
-
}
-
}
-
} // class SendCharsCommand
-
Hi Gerdescm,
I dont know which platform ur using.
in linux and other RTOS :- we can use message-ques for sending and receiving the messages.
ur problem: see have a buffer( file for storing the messages), before writing into buffer make sure u ask the question whether :
1. to append to the existing file,
2. to clear the earlier contents.
!!Sorry!! if i have not given the solution.
Regards,
Answers.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Robin |
last post by:
Ok, I have a form that on clicking of the Update button first updates
the specific record in the db, then Inserts if the vMemo field is not
empty. The problem that I'm having is that After...
|
by: hortoristic |
last post by:
We are using JavaScript to Enable/Disable certain fields on web pages
based on business rules.
A simple example is if when using an option type tag, and the two
options are Yes and No. If YES...
|
by: JSK |
last post by:
Hi,
As any one worked in VB.NET and made use of Sendmessage API?
The Issue I am running into is how to pass pointers of Data Structures (UDT)
to the SendMessage.
I starting looking at "IntPrt"...
|
by: Lars Netzel |
last post by:
Hello!
Thanx to this newgroup I have finally, with the help of you guys, gotten
this to work halfway.. but the final action is still not working, clicking
the "Button2" thru SendMessage().
...
|
by: Roger Aikin |
last post by:
I've converted a VB6 project to VB.Net 2005. (Actually using vstudio pro
2005).
I'm on a machine that also has VB6 and Vstudio.net 2003 on it. The project
uses Word, Excel, MapPoint and SqlClient...
| |
by: scprosportsman |
last post by:
Please help guys, i am trying to set up a database here at work and im
fairly new to access in terms of writing functions and queries and
stuff. I have 2 different places on my design that will...
|
by: SQACSharp |
last post by:
I'm trying to get the control name of an editbox in another window.
The following code set the value "MyPassword" in the password EditBox
but it fail to return the control name of the EditBox. ...
|
by: Necromis |
last post by:
Ok, I have gotten my head around things better regarding SendMessage
and FindWindow functions. However, I am running into an issue with my
code still. The program I am working with is EXTRA! by...
|
by: michelqa |
last post by:
Hi,
I need to call a lot of different native SendMessage to retreive
informations from non managed application.
Some win32 messages use struct pointer for lparam....how to create and...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |