2 Replies - 2417 Views - Last Post: 28 September 2007 - 08:10 AM Rate Topic: -----

#1 CharlieWasAnAngel   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 28-September 07

How to retrieve the title of a dialog box

Posted 28 September 2007 - 07:12 AM

View PostcygnusX, on 23 Aug, 2007 - 04:52 AM, said:

Ok,sorry.



Bit harsh wasn't it???

Anyway. I'm trying to do the same thing - get the title of a dialog box using getText. The thing is, it doesn't seem to like me passing a string variable as the second parameter:

string text = "";
IntPtr len = SendMessage(handle, WM_GETTEXTLENGTH, IntPtr.Zero, IntPtr.Zero);
string sBuff = new String('\0', len.ToInt32() + 1);
int retVal = SendMessage(handle, WM_GETTEXT, len, ref sBuff);



Where I've passed sBuff it seems to want an IntPtr datatype. I've tried passing an IntPtr datatype, just for the hell of it, and it still didn't like it. What I don't understand as well is if the sBuff parameter is the return value, and the return value is IntPtr, how do you get text out of it? Bit confused.....

*Always use code tags for your code

This post has been edited by PsychoCoder: 28 September 2007 - 07:33 AM


Is This A Good Question/Topic? 0
  • +

Replies To: How to retrieve the title of a dialog box

#2 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1663
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: How to retrieve the title of a dialog box

Posted 28 September 2007 - 07:37 AM

View PostCharlieWasAnAngel, on 28 Sep, 2007 - 07:12 AM, said:

Bit harsh wasn't it???

Anyway. I'm trying to do the same thing - get the title of a dialog box using getText. The thing is, it doesn't seem to like me passing a string variable as the second parameter:

Where I've passed sBuff it seems to want an IntPtr datatype. I've tried passing an IntPtr datatype, just for the hell of it, and it still didn't like it. What I don't understand as well is if the sBuff parameter is the return value, and the return value is IntPtr, how do you get text out of it? Bit confused.....

*Always use code tags for your code


First, no I wasn't being hard, we wont do your work for you here. We'll provide help, sample of what you're trying to do, but we're not going to do all the work for you. I gave him sample code that does what he asked, then he wanted me to tell him how to implement it, meaning he wanted the answer and someone to implement it for him as well, thus meaning he had to do no work at all.

Second, this should have been its own thread, as its not the same thing. He was looking how to get the text under the cursor, you're trying to get the title of a dialog box. I am creating a new thread for this post :)
Was This Post Helpful? 0
  • +
  • -

#3 CharlieWasAnAngel   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 28-September 07

Re: How to retrieve the title of a dialog box

Posted 28 September 2007 - 08:10 AM

re new thread - thanks!!


don't suppose you have any ideas about my issue do you? pointers (pardon the pun), clues or complete solutions accepted :-)

This post has been edited by CharlieWasAnAngel: 28 September 2007 - 08:11 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1