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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

making an ATL CWindowImpl modal ???

Status
Not open for further replies.

iza

Programmer
Apr 4, 2000
1,804
FR
hi :)
i have an ATL Dialog box that launches a window (which is a custom class derived from CWindowImpl) when a button is clicked
now i want that window to be modal = to handle ALL events until it's closed
is it feasible ? can someone tell me how ??
some code ...

my custom class is CMyWindow
the call to the window
LRESULT OnClickedCap(...)
{
CMyWindow m_cwin;
RECT rt;
SetRect(&rt, ...);
m_cwin.Create(GetDesktopWindow(), rt, "test",WS_VISIBLE|WS_POPUP); // getdestopwindow just because i need the c_win to be reaaaaaaaaallly big
m_cwin.SetActiveWindow();
return 0;
}

and in the CMyWindow class, i declare
class CMyWindow : public CWindowImpl<CMyWindow>
{
public:
...

BEGIN_MSG_MAP(CMyWindow)
MESSAGE_HANDLER(WM_PAINT, OnPaint)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
END_MSG_MAP()
..
}


so what could i add to make CMyWindow to handle all messages (and return when WM_DESTROY is fired ) ???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top