Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a Control

Status
Not open for further replies.

AmkG

Programmer
May 12, 2001
366
0
0
PH
How does a control handle having multiple instances of itself with different stats? Am I right in assuming that it has something to do with SetWindowLong and GWL_USERDATA? How does a control handler get its own title string? "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
By control do you mean a user control. The only way to do that is through using indexes.

Craig, mailto:sander@cogeco.ca

"Procrastination is the art of keeping up with yesterday."

I hope my post was helpful!!!
 
User control or not, a control still has to handle multiple instance of itself with possibly different statuses. Presumably the way Microsoft recommends to programmers is the way they themselves did it with their own controls.

Can you expound on how they do that with indices? How is it done? I have an example in a REALLY OLD book, but it uses a static variable because it's only done once in an instance and in a modal dialog box at that. "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
There is a really good explanation to this In the Visual Basic(Microsoft) -Version 5 & 6. thread222-16995 Craig, mailto:sander@cogeco.ca

"Procrastination is the art of keeping up with yesterday."

I hope my post was helpful!!!
 
I'm doing this in assembly and I can't make head or tails about all that VB stuff.

Okay, here's what I need to do:

I have two of these child control windows in my program (actually more, but for purposes of testing...).

At a particular time, one of them might have the mouse, or neither might have.

While the child has the mouse, it has a different background. So it somehow has to save its state (has mouse or does not have mouse) so that the Paint procedure of the control knows whether or not to change the background.

"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
I tried doing SetWindowLong() with GWL_USERDATA and it worked. "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top