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.
KinkzAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.