Hello..

I am an intermediate c++ programmer and currently using Visual C++. I want to write a program which could receive real-time information from the currently running applications and process that information to perform its respective task.

for example: How can I receive the characters written on the title bar of an application to be able to process that information("the string" of the title bar)?
Could anyone post a simple example on that fact... I'll be really obliged.

Please help me...

Thanks...

Recommended Answers

All 5 Replies

To get the title of a window, you can use GetWindowText.
You will need to acquire the target window's handle first.

To get the title of a window, you can use GetWindowText.
You will need to acquire the target window's handle first.

I couldn't really understand what you mean by "acquire the target window's handle first."
Could you please elaborate by giving a simple example.

Thanks..

In Windows, each window has a handle, which acts as an ID. Use a program like TaskManagerEx to find out the handle of a particular window.

I got the handle of the title bar as "0x00A30130" .(using TaskManagerEx) I'm not able to put this data into the function GetWindowsText().

What I'm doing is - GetWindowText(0x00A30130, x , 20);

This is giving me error:

error C2664: 'GetWindowTextA' : cannot convert parameter 1 from 'const int' to 'struct HWND__ *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast

Could anyone please tell me the correct syntax..

Use reinterpret_cast<HWND__*>(0x00A30130).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.