creating a window from dll
-
is there anyway to call RegisterClass() and CreateWindow() "dynamically"? i need to make a message pump for a worker thread in an ATL control. Everyone says "make a message pump", so show me how. i dont want to know "what to do" i want to know "how to do it". Thanks, people. Let's see some CODE since this is called "CodeProject" haha Thanks if anyone can help me. ~Timothy T. Rymer www.digipen.edu tim.xpertz.com
-
is there anyway to call RegisterClass() and CreateWindow() "dynamically"? i need to make a message pump for a worker thread in an ATL control. Everyone says "make a message pump", so show me how. i dont want to know "what to do" i want to know "how to do it". Thanks, people. Let's see some CODE since this is called "CodeProject" haha Thanks if anyone can help me. ~Timothy T. Rymer www.digipen.edu tim.xpertz.com
Hey, behold the authentic message pump:
// The real message pumpTM.
// Use it wisely.
MSG msg;while(GetMessage(&msg,NULL,0,0)!=0){
TranslateMessage(&msg);
DispatchMessage(&msg);
}Jokes aside, every window created within a particular thread can only work if that thread, after window creation, gracefully decays into this message loop.
GetMessage
returns 0 upon callingPostQuitMessage
(usually issued from theWM_DESTROY
handler of the thread main window), signalling the thread to exit from the message pump (because no further message processing is required). Joaquín M López Muñoz Telefónica, Investigación y Desarrollo -
Hey, behold the authentic message pump:
// The real message pumpTM.
// Use it wisely.
MSG msg;while(GetMessage(&msg,NULL,0,0)!=0){
TranslateMessage(&msg);
DispatchMessage(&msg);
}Jokes aside, every window created within a particular thread can only work if that thread, after window creation, gracefully decays into this message loop.
GetMessage
returns 0 upon callingPostQuitMessage
(usually issued from theWM_DESTROY
handler of the thread main window), signalling the thread to exit from the message pump (because no further message processing is required). Joaquín M López Muñoz Telefónica, Investigación y DesarrolloJoaquín M López Muñoz wrote: The real message pump. TradeMark...? ;P :laugh: "An expert is someone who has made all the mistakes in his or her field" - Niels Bohr