"Jose María del Álamo" <gci...@fais.upm.es> wrote in message
news:3896BFD2...@fais.upm.es...
Davorin Perkovic - Pjer escribió:
or this:
///////////////////////////////////////////////////////////////////////////
CWnd *pWnd = AfxGetApp()->m_pMainWnd;
HWND hwnd = NULL;
if (pWnd)
hwnd = pWnd->GetSafeHwnd();
///////////////////////////////////////////////////////////////////////////
////////////////////////////////// From MSDN ///////////////////////////
CWnd* AfxGetMainWnd( );
Return Value
If the server has an object that is in-place active inside a container, and
this container is active, this function returns a pointer to the frame
window object that contains the in-place active document.
If there is no object that is in-place active within a container, or your
application is not an OLE server, this function simply returns the
m_pMainWnd of your application object.
If AfxGetMainWnd is called from the application's primary thread, it returns
the application's main window according to the above rules. If the function
is called from a secondary thread in the application, the function returns
the main window associated with the thread that made the call.
Remarks
If your application is an OLE server, call this function to retrieve a
pointer to the active main window of the application instead of directly
referring to the m_pMainWnd member of the application object.
If your application is not an OLE server, then calling this function is
equivalent to directly referring to the m_pMainWnd member of your
application object.
"Jose María del Álamo" <gci...@fais.upm.es> wrote in message
news:3896C90C...@fais.upm.es...