I am trying to pass a message to a userform in VBA. I will include the code of what I have so far below. The problem I am having is that I don't know what I need to send in order to get the text I want to appear in the textfield that I want it to appear in.
Here is the code... -
Private Const WM_SETTEXT As Long = &HC
-
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
-
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
-
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
-
(ByVal parentHwnd As Long, _
-
ByVal nextChildHwnd As Long, _
-
ByVal lpClassName As String, _
-
ByVal lpWindowName As String _
-
) As Long
-
-
Private Sub UserForm_Activate()
-
Dim windowHandle As Long
-
Dim lpClassName As String
-
Dim lpWindowName As String
-
Dim childHandle As Long
-
-
Dim lParam As String
-
-
lpClassName = "ThunderDFrame"
-
lpWindowName = Me.Name
-
windowHandle = FindWindow(lpClassName, lpWindowName)
-
childHandle = FindWindowEx(windowHandle, 0, "F3 Server 60000000", "")
-
MsgBox childHandle
-
-
lParam = "FuzzButt"
-
SendMessage childHandle, WM_SETTEXT, 0&, lParam
-
-
End Sub
-
So, I get the 'Frame' for the form I want to modify (windowHandle) and then I used that to get the handle to the part of the window inside the frame, but not including the frame (childHandle). I want to set a textField on that form to some text value. What I have above just messes up the 'Caption' of the window. If I send the same text to the parent window then it corrupts the titlebar of the window. It doesn't set it to the text in lParam.
So... What am I doing wrong?
0 1100 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Harolds |
last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005
the pmID is evaluated to "" instead of what the value is set to:
....
xmlItems.Document = pmXML
// Add the pmID parameter to the XSLT stylesheet
XsltArgumentList xsltArgList = new XsltArgumentList();
xsltArgList.AddParam("pmID", "", pmID);
xmlItems.TransformArgumentList = xsltArgList;
|
by: Gvs |
last post by:
Hi,
I'm currently trying to pass messages into a queue. This all works fine,
however, i'm trying to my program to stop sending messages to the queue when
it reaches an upper threshold. At present this threshold is the number of
chairs in a waiting room. This is an int represented by nChairs.
So i want to compare this to the number of messages in my queue. I'm using
the following lines of code to do this, however the queue is always...
|
by: Curious |
last post by:
Hi,
I need some technique to communicate by passing messages with different
threads. For my problem shared memory is not applicable.
Can someone give me some help of what there is available in the .net.
Thanks in Advance
|
by: zorhel |
last post by:
Hi.
My clients will be IE, Mozilla and Opera in
a Windows and *nix OS.
So, my web app need to, from a server, send messages to a specific client
(browser), send messages for all clients, redirect a client to another page.
In other way, a client will be able to send messages to another client,
throw the server.
These are the first funcionalities.
|
by: Jaime Stuardo |
last post by:
Hi all..
I have created a business logic component that is used from my ASP.NET
webform. It works, but connection string to the database is hard coded, as
in this method :
public DataSet GetCategories()
{
SqlConnection conn = new SqlConnection("Data Source=DEVSERVER;Initial
Catalog=XXXX;User ID=X;Password=Y");
| |
by: Nak |
last post by:
Hi there,
I was wondering if it was possible to pass objects in windows messages,
obviously via pointers I would presume, but I can't quite work out how to
turn an object into a pointer in VB.NET, if it is even possible of course?!?
Anyway, if anyone knows a way of doing this I would be most appreciative of
some advice, thanks yet again in advance!
Nick.
|
by: Rune Jacobsen |
last post by:
Hi all,
I am working on my single instance application that now also has a URL
type associated with it, according to the Asynchronous Pluggable
Protocols information from MSDN. Now, if my application is not already
started, everything works fine. The APP setup starts my program with the
URL as the command line argument, and it displays the proper information
to the user. This works great and was a pleasure to program.
However, my...
|
by: Hakan Örnek |
last post by:
Hi ,
I want to parameter passing to my windows sevice. I call service commands
like this ;
'------------------------------------------------------------
Dim sc As ServiceController
sc = New ServiceController("ProsetLogServices")
sc.MachineName = "."
If sc.Status = ServiceControllerStatus.Stopped Then
sc.Start()
End If
|
by: MikeY |
last post by:
Perhaps someone can point me in the right direction in finding code, or
finding reading information on how to pass information (ie. ArrayList,
string, etc) between two running window applications, that won't
neccessarily be on the same machine.
This will be my first attempt at this, and I'm not sure if this falls under
COM, or ActiveX.
Any and all help is appreciated.
|
by: AAaron123 |
last post by:
On a Form I have a RichTextBox.
I do the call for EM_SETEVENTMASK with ENM_REQUESTRESIZE
The user control's WndProc writes to the consol to keep track of any
EN_REQUESTRESIZE messages.
As I type into the RichTextBox I see the results of the console writes in
the Output window.
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |