////////////////////////////////////////////////////////////////////////////// // MFC Tip #1 -- Vision X Software -- http://www.visionx.com/mfcpro // Avoiding a second instance by activating the current instance // // This source code is provided for instructional purposes, and is released // to the public domain. No claim of ownership is made. Use it at your own // risk. No warranties are expressed or implied. The resulting program may // not be fully functional. No animals were used to test this code. ////////////////////////////////////////////////////////////////////////////// HWND hwnd = ::FindWindow(NULL, "title of your app"); if (hwnd) { ::ShowWindow(hwnd, SW_SHOWDEFAULT); ::BringWindowToTop(hwnd); } return FALSE;