• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

Using Setparent to add controls to an AOL Chat room

I want to be able to add a further text box, list box and two icons onto an AOL chat room.  This sounds easy but i need to make the chat room allow space for these controls to be added, and also make sure they remain part of the room when it's resized, minimized etc.
0
Kinkz
Asked:
Kinkz
  • 9
  • 8
  • 6
  • +2
1 Solution
 
KDivadCommented:
You could use SetParent to do this, BUT... SetParent is only supposed to be used to transer controls through the same app, otherwise, you'll find the control "disconnected" from it's code.
0
 
vettrangerCommented:
To do that right you'd need the kit AOL used to supply that documented the hooks into AOL code. However, I think they discontinued supplying that kit some years ago. Before the boom year when AOL membership shot up to 7 million, they were keen to have outside content/feature providers, since it meant neat things that they didn't have to underwrite the cost of.

After that boom, they had so much cash they realized they didn't need outside content/feature providers anymore, and they started dropping them like hot potatoes. I think if you contact AOL and ask them for the toolkit they used to supply to help you do this, you'll now get nothing but a stone wall.
0
 
MirkwoodCommented:
You can't add controls to another application, windows will kick your ass and crash your applicatoin.
Only when the application loads you as a DLL you can try it. So AOL must have an option to allow you to do this.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
KDivadCommented:
Mirkwood,
I've added a textbox to explorer (just to see if I could) and it added without any problems. Perhaps only some apps "disagree" with this?

Later,
0
 
KinkzAuthor Commented:
I think the point about not being able to add controls to another application is just wrong, i've seen and used many programs using Setparent to do this.
0
 
KDivadCommented:
Perhaps those apps were built to accept the extra controls. I never said you couldn't do it, only that I've heard that it "disconnects" the control from it's underlying code.
0
 
KinkzAuthor Commented:
It was a response to Mirkwoods comments, not yours sorry
0
 
KDivadCommented:
No problem. I just had to make sure. Understand? Anyway, I disagree with Mirkwood on this one, too.
0
 
MirkwoodCommented:
You can add the controls but not handle them so what's the use... only if you're loaded in their application address space you can handle them.
0
 
mystamiCommented:
You can easily use SetParent to add the whole AOL ChatRoom to your own form, and still be able to use all of the features on the form.  And then, you can make your program set the chatroom back to AOL when you unload your program.  I know, I've done it before!  :-)  Well, everything except for this one thing.   Making the Chatroom borderless.  Any ideas?  I've been told that you use SendMessage.  But that's all that I know right now.
0
 
mystamiCommented:
Oops I didn't mean to send that to answer your question Kinkz.  I meant to send it as a Comment.  Sorry!
0
 
KinkzAuthor Commented:
I had to reject it because it was accidentally sent as an answer rather than a comment.  My email is Kinkz@xoommail.com if anyone has answers too long to put on here.
0
 
KinkzAuthor Commented:
Again, i can't agree with Mirkwood that you can't handle the controls, although it's not the answer to what i wanted, Mystami has already supplied me with a working example.
0
 
KDivadCommented:
Actually, you CAN handle some of the controls quite well. A textbox has a LOT of API's for getting/changing the text, font, etc. You can move it, resize it, hide it... You can intercept mouse and keyboard events...

A lot of work, but it is possible.
0
 
KinkzAuthor Commented:
This is what i've been looking at, thanks KD, i'd just like to make sure people understand that i'm not ONLY talking about using Setparent - i realise that Setparent on it's own ought to be restricted to controls within the same application - but combining it's use with other code as KD has suggested.
0
 
KDivadCommented:
The "monitoring" part, i.e. watching for changes, will almost HAVE to take place in a loop or timer.

To get the window's dimensions (or in this case, the textbox):

Public Declare Function GetWindowRect Lib "user32" Alias "GetWindowRect" (ByVal hwnd As Long, lpRect As RECT) As Long
Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
End Type

You can use this to get a window/control's caption:

Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long

Hope this helps some.
0
 
mystamiCommented:
well, actually you would put the code in form resize.  that way whenever you resize the form it would resize what you want on the form.  using a timer in that case is not a very good idea.  it could cause the program to slow down or possibly error.  
0
 
KDivadCommented:
mystami, I would be very interested in knowing how to put code in AOL's form_resize event.
0
 
mystamiCommented:
No, I was talking about how Kinkz was going to add all of the controls seperately to his form.  And, that's what I was referring to.  If I'm correct that's what you all have been talking about.  So, in this sense I believe I am correct.
0
 
KDivadCommented:
>>controls seperately to his form<<
AOL is the form we are adding to, not a form in Kinkz own app, therefore the Form_Resize event is not accessible and so must be monitored some other way. Sorry about the confusion.
0
 
mystamiCommented:
Oh, ok my fault.  I must have just mis-read or something.  I thought you were still talking about adding AOL controls seperately to his form.
0
 
mystamiCommented:
Kinkz I just sent you an example of what I believe you are wanting to do.
0
 
KinkzAuthor Commented:
This is so excellent thanks a lot Myst...
0
 
mystamiCommented:
no problem.  anytime.  =)
0
 
KDivadCommented:
Considered VERY bad form to email answers to someone, because someone might pay for this question to get the answer, only to find out that the answer isn't here.
If it's code, you should post it, if it isn't just code (ocx, dll, exe, etc.), you should upload to the net somewhere and provide the URL to it.
0
 
mystamiCommented:
If you've paid for this answer then please e-mail me at mystami@aol.com and I will mail you the code on how to do this.  Or atleast help you out!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 9
  • 8
  • 6
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now