473,396 Members | 1,758 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,396 software developers and data experts.

getting tittle bar text of any window

Hello All
I am using VB 6. I am trying to get the text in the tittle
bar of the window i click by using GetWindowText API
function but its not working. Here is the code i am using:-

Private Declare Function GetWindowText Lib "user32"
Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal
lpszString As String, ByVal cch As Long) As Long
Private Declare Function WindowFromPoint Lib "user32"
(ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function SetCapture Lib "user32" (ByVal
hwnd As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As
Long
Private Declare Function ClientToScreen Lib "user32"
(ByVal hwnd As Long, lpPoint As POINTAPI) As Long
Dim blnChoose As Boolean
Private Sub Command1_Click()
blnChoose = True
intRetVal = SetCapture(hwnd)
End Sub

Private Sub Form_Load()
blnChoose = False
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As
Integer, X As Single, Y As Single)
Dim window As Long
Dim buffer As String * 1024
Dim ptPoint As POINTAPI
If blnChoose Then
ptPoint.X = X
ptPoint.Y = Y
retval = ClientToScreen(hwnd, ptPoint)
window = WindowFromPoint(ptPoint.X, ptPoint.Y)
lngRetVal = GetWindowText(window, buffer, 1024)
Text1.Text = buffer
End If
End Sub

Please tell me if there is any problem in this code so
that my prob. can be solved

thanks
Nov 20 '05 #1
2 1935
Cor
Hi Shalender,

This is a VB.net newgroup as you could seen in your previous answers you
have got it is a very different language from VB6.

There are very much VB6 language newsgroups also,

They called often public.vb with a lot of special subjects.

You better place your questions in those newsgroups, because the first time
people will answer you here because most are very polite, but by keeping
doing it, some of us become a little bit sad.

Cor
I am using VB 6. I am trying to get the text in the tittle
bar of the window i click by using GetWindowText API
function but its not working. Here is the code i am using:-

Nov 20 '05 #2
* "shalender verma" <ve**********@yahoo.com> scripsit:
Hello All
I am using VB 6. I am trying to get the text in the tittle
bar of the window i click by using GetWindowText API
function but its not working. Here is the code i am using:-


<http://www.blackbeltvb.com/free/classspy.htm>

VB6 groups: microsoft.public.vb.*.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #3

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

Similar topics

3
by: dan glenn | last post by:
hi. I want to code a 'preview' function into a guestbook entry page. I can do it with a button that posts, bringing up a whole new page showing a preview of what has been entered, and then the user...
16
by: Chris Maloof | last post by:
Hello, Does anyone know how I can read the ASCII text from a console window (from another application) in WinXP? It doesn't sound like a major operation, but although I can find the window via...
3
by: NeverLift | last post by:
But, if it's not open, I don't want to open it . . . using window.open will open it if it doesn't exist, even if the url in that open is null (the window is then empty -- but it's open). The...
21
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does...
10
by: fotzor | last post by:
Hi, I'm a C++-Programmer and want to subclass the Edit used to write a SQL-Query in Access. The edit is of the special Access class OKttbx. Everything works, I injected a DLL into the...
3
by: shalender verma | last post by:
i want to get the text written in the tittle bar of the window of any other application which apperars on the back of the form. e.g i created a form and minimized that form and then i opened a...
3
by: shalender verma | last post by:
I am using VB6. I want to get the text in the tittle bar of any opened window of other app. such as word,excel or any app. appering at the back of my vb form. What i am doing is i created a small...
3
by: sundew | last post by:
so here is the test case: <head> <script type='text/javascript'> // this function simply returns the number of enumerable namespaces(objects) function numNSpaces(){ var num = 0; for(var i in...
6
by: fastestindian | last post by:
Hi, I am working windows CE application. I am opening a page which has Textbox in it. In that TextBox I am showing a text report. Previously the font of text was 'Tahoma' as system font was...
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: 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...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
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,...
0
jinu1996
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...
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,...

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.