I'm making a class module that you can declare in an ActiveX control so that you can use it like a handle to reshape the control. (basicly you can drag it around your ActiveX control even when your control is at design time.

to do this I'm creating a window class of my own using the API I've got an old book on windows programming in C which explains the basics but I'm a bit confused about the message loop.

in the C code I've seen there's a loop at the end of the main procedure that looks like this.

Code:
while (GetMessage (&msg, NULL, 0, 0))
    {
    TranslateMessage (&msg) ;
    DispatchMessage (&msg) ;
    }
which translates to

Code:
Do While GetMessage(uMsg, vbNull, 0, 0)

    TranslateMessage uMsg
    DispatchMessage uMsg
    
Loop

where uMsg is a MSG type (defined in the API viewer.

basicly this continually checks the message queue of the window and sends the messages to the window procedure (Normaly VB does this for you.)

I wnt to know what to do about this in VB, I'm planning on having this in a class in an activeX control so I'll have several running at and I'm a bit cautiout about having loads of infinate loops running at once (if I put the loop in the Class initialize event), even with DoEvents, I reckon I can't have 2 running at once in the same thread, what's the best way to handle this problem.

I hope this makes sense.