I want to use
if (FindWindow ( "ADDRBOOKCLASS", NULL ))
{
}
to know if an application it`s running and to get the app`s handle...

I have used it when I wrote a program using MSVC 1.5
I just wrote a call to my RegisterClass function (below) and, in the dialog template, I put the class name. But I`m trying to do the same in another application (a dilaog based app MSVC 5.0) and if the dialog template have the class name the app crash... Someone knows what is wrong?
BOOL CViewWnd::RegisterClass()
{
WNDCLASS wndclass;
wndclass.style = 0;
// Let's use DefDlgProc for our dialog's Window Procedure, we
// don't need to modify any of the behavior anyway.
wndclass.lpfnWndProc = DefDlgProc;
wndclass.cbClsExtra = 0 ;
// This field MUST be set to DLGWINDOWEXTRA, or this class we're
// registering won't work properly with our dialog boxes.
wndclass.cbWndExtra = DLGWINDOWEXTRA ;
// Use the app's instance. AfxGetInstanceHandle() gets this for us nicely.
wndclass.hInstance = AfxGetInstanceHandle();
// Load our custom icon. "MYICON" should be defined in the .RC file.
wndclass.hIcon = ::LoadIcon (AfxGetInstanceHandle(), "AFX_IDI_STD_FRAME") ;
// Use an arrow cursor for kicks
wndclass.hCursor = ::LoadCursor (NULL, IDC_ARROW) ;
wndclass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1) ;
wndclass.lpszMenuName = NULL ;

// Make up a unique name for our dialog class. This same name must
// be used in our dialog box template to force the dialog box to
// use this new class.
wndclass.lpszClassName = "ADDRBOOKCLASS";

return ::RegisterClass(&wndclass);
}

Thanks!

Cesario Simões, Jr.