Problem getting Caption of a window control using SendMessage & WM_GETTEXT
-
Hi There. I am trying to get a caption of a windows control using below code... But its fatching only a set of square boxes (Carriage return).
TCHAR buf[512];
::SendMessage(pWaitingProcessCompleteWnd6, WM_GETTEXT, 0 , (LPARAM)buf);I have checked the address of pWaitingProcessCompleteWnd6 using spy++, its pointing to the right control. Please help. Thanks PanB
-
Hi There. I am trying to get a caption of a windows control using below code... But its fatching only a set of square boxes (Carriage return).
TCHAR buf[512];
::SendMessage(pWaitingProcessCompleteWnd6, WM_GETTEXT, 0 , (LPARAM)buf);I have checked the address of pWaitingProcessCompleteWnd6 using spy++, its pointing to the right control. Please help. Thanks PanB
PankajB wrote:
But its fatching only a set of square boxes (Carriage return).
How are you verifying this?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
Hi There. I am trying to get a caption of a windows control using below code... But its fatching only a set of square boxes (Carriage return).
TCHAR buf[512];
::SendMessage(pWaitingProcessCompleteWnd6, WM_GETTEXT, 0 , (LPARAM)buf);I have checked the address of pWaitingProcessCompleteWnd6 using spy++, its pointing to the right control. Please help. Thanks PanB
How about using GetWindowText[^] instead?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown -
How about using GetWindowText[^] instead?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknownFrom his previous bizarre post (where he's searching for a control by it's caption), I think this particular control is owned by a different process, which makes GetWindowText() unusable. Of course, I'm only assuming things. :)
It is a crappy thing, but it's life -^ Carlo Pallini
-
From his previous bizarre post (where he's searching for a control by it's caption), I think this particular control is owned by a different process, which makes GetWindowText() unusable. Of course, I'm only assuming things. :)
It is a crappy thing, but it's life -^ Carlo Pallini
Rajesh R Subramanian wrote:
From his previous bizarre post (where he's searching for a control by it's caption), I think this particular control is owned by a different process
Ahh, I missed that one. You're probably right Rajesh.
Rajesh R Subramanian wrote:
Of course, I'm only assuming things.
Yeah, that's usually 50% of the job trying to put together a useful answer depending on the lack of information in the posts.... ;)
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown -
Rajesh R Subramanian wrote:
From his previous bizarre post (where he's searching for a control by it's caption), I think this particular control is owned by a different process
Ahh, I missed that one. You're probably right Rajesh.
Rajesh R Subramanian wrote:
Of course, I'm only assuming things.
Yeah, that's usually 50% of the job trying to put together a useful answer depending on the lack of information in the posts.... ;)
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknownRoger Stoltz wrote:
Yeah, that's usually 50% of the job trying to put together a useful answer depending on the lack of information in the posts.... Wink
[Sylverster Stallone tone] Well, it's tough answering questions here. They give me a war that I cannot believe in. [/Sylverster Stallone tone]
It is a crappy thing, but it's life -^ Carlo Pallini
-
Roger Stoltz wrote:
Yeah, that's usually 50% of the job trying to put together a useful answer depending on the lack of information in the posts.... Wink
[Sylverster Stallone tone] Well, it's tough answering questions here. They give me a war that I cannot believe in. [/Sylverster Stallone tone]
It is a crappy thing, but it's life -^ Carlo Pallini
Rajesh R Subramanian wrote:
Sylverster Stallone tone
Hey man, you're too young to remember Sly. --Carlo Rocky Rambo. :-D
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
From his previous bizarre post (where he's searching for a control by it's caption), I think this particular control is owned by a different process, which makes GetWindowText() unusable. Of course, I'm only assuming things. :)
It is a crappy thing, but it's life -^ Carlo Pallini
Actually, you can use GetWindowText on windows which belong to a different process.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
Actually, you can use GetWindowText on windows which belong to a different process.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
Code-o-mat wrote:
Actually, you can use GetWindowText on windows which belong to a different process
Well, read the subject line of the post again and you'll find it mentions "window control". Then have a look at the documentation I linked to in my post where it clearly says "GetWindowText cannot retrieve the text of a control in another application". But, then I'm just assuming the OP really meant a control when he wrote it.... ;)
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown -
Actually, you can use GetWindowText on windows which belong to a different process.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
Please read the whole conversation before adding your comments. We're talking about a control that is owned by another process.
It is a crappy thing, but it's life -^ Carlo Pallini
-
Rajesh R Subramanian wrote:
Sylverster Stallone tone
Hey man, you're too young to remember Sly. --Carlo Rocky Rambo. :-D
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]There you go, changing your middle name again. Warm regards, Rajesh "Neo" Subramanian.
It is a crappy thing, but it's life -^ Carlo Pallini
-
Please read the whole conversation before adding your comments. We're talking about a control that is owned by another process.
It is a crappy thing, but it's life -^ Carlo Pallini
I did read the whole conversation, but maybe i misunderstood something...sorry about that... I thought by "window control" you meant things like buttons or edit boxes on windows, and as far as i know you are able to get the text of those, or at least some of them, some controls, like buttons allow you to query their windowtext over process boundaries, while some don't. But i guess you meant something else, sorry... :(
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
I did read the whole conversation, but maybe i misunderstood something...sorry about that... I thought by "window control" you meant things like buttons or edit boxes on windows, and as far as i know you are able to get the text of those, or at least some of them, some controls, like buttons allow you to query their windowtext over process boundaries, while some don't. But i guess you meant something else, sorry... :(
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
No worries, there's no need to apologise if you have read the whole conversation before adding your comments. You can have a look at the Remarks section of the respective documentation page[^] to know what I'm talking about. Here[^] is a detailed explanation. :)
It is a crappy thing, but it's life -^ Carlo Pallini
-
No worries, there's no need to apologise if you have read the whole conversation before adding your comments. You can have a look at the Remarks section of the respective documentation page[^] to know what I'm talking about. Here[^] is a detailed explanation. :)
It is a crappy thing, but it's life -^ Carlo Pallini
Thanks :)
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <