473,405 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Reading the text in a panel of a statusbar in another program

gv
Hi all,

I'm trying to just read the text in one of the panels of a statusbar in a
different program. I have
tried the code below which works fine with notepad.
Can someone please help?
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Int32
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA"
(ByVal hWnd1 As Int32, ByVal hWnd2 As Int32, ByVal lpsz1 As String, ByVal
lpsz2 As String) As Int32
Private Declare Function GetMessageSTRING Lib "user32" Alias
"SendMessageA" (ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam As
Int32, ByVal lParam As String) As Int32
Private Declare Function SendMessageSTRING Lib "user32" Alias
"SendMessageA" (ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam As
Int32, ByVal lParam As String) As Int32

Private Const WM_SETTEXT = &HC
Private Const WM_GETTEXT = &HD
Private Const WM_GETTEXTLENGTH = &HE

Private Declare Auto Function SendMessage Lib "user32.dll" (ByVal hwnd
As Int32, ByVal _WM_USER As Integer, ByVal wParam As Integer, ByVal
windowText As StringBuilder) As Integer
Public Function GetText()
Try

Dim WindowStart As Integer
Dim ChildWindowTxt As Integer
Dim getstring As String

WindowStart = FindWindow("NewProg", vbNullString)
ChildWindowTxt = FindWindowEx(WindowStart, 0&, "statusbar5",
vbNullString)

Dim textSize As Integer = 1024
Dim buffer As New StringBuilder(textSize)
SendMessage(ChildWindowTxt, WM_GETTEXT, textSize, buffer)
MessageBox.Show(buffer.ToString())
Catch ex As Exception

End Try

End Function

thanks
gv
Nov 21 '05 #1
0 716

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: flupke | last post by:
Hi, i'm trying to convert my java console app to a python gui. Now, the only problem i seem to have at the moment are the resizers for the layout. It seems that for the purpose of what i'm...
3
by: Suresh Kumaran | last post by:
Hi Everyone, Is there any one out there who can help me in VB.NET to show the tooltip description of the TOOLBAR panel in the STATUSBAR. In other words when the mouse hovers over the tool bars...
1
by: Michele Locati | last post by:
Hi to everybody I hope this is the right place to post this question. I have a problem I can't solve by myself. Maybe someone here can help me... I need to access the content of a status bar...
9
by: Christian Blackburn | last post by:
Hi Gang, I've had this happen with a couple of controls now, but my patience has worn thin. Can somebody tell me why I can read/write to most objects on my form from my module, but not when...
7
by: Geoff | last post by:
I would like to have a status bar which has a few panels, one of which I want to display a different .gif under different conditions. I have added the status bar to the form, I have added the...
0
by: Stephen Muecke | last post by:
I use the following code to draw vertical text in an ownerdrawn StatusBar The text is drawn top to bottom. Is there a way to have the text drawn bottom to top? Stephen Private Sub...
2
by: Curious | last post by:
Hi, I have program, creating multiple threads, and each thread is updating the same richtextbox(appending to previous text), and text in the statusbar. To update the richtextbox and statusbar,...
1
Elias Alhanatis
by: Elias Alhanatis | last post by:
Dear friends, First of all , i wish a Happy New Year to all of you!!!! I have been learning Python and the Tkinter GUI package for the last 6 months , and now i am trying to rewrite a program...
4
by: lilyumestar | last post by:
I have project I have to do for class. We have to write 4 different .java files. Project2.java HouseGUI.java House.java HouseSorting.java I already finish House.java and I need to work on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
marktang
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,...
0
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...
0
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...
0
agi2029
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,...
0
isladogs
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.