본문 바로가기
VisualStudio.C++.C#/코딩팁,함수활용,단편

win API . FindWindow , FindWindowEx

by i.got.it 2020. 9. 5.

 

 

// activate an application with a window with a specific class name
BOOL CMyApp::FirstInstance()
{
   CWnd *pWndPrev, *pWndChild;

   // Determine if a window with the class name exists...
   pWndPrev = CWnd::FindWindow(_T("MyNewClass"), NULL);
   if (NULL != pWndPrev)
   {
      // If so, does it have any popups?
      pWndChild = pWndPrev->GetLastActivePopup();

      // If iconic, restore the main window
      if (pWndPrev->IsIconic())
         pWndPrev->ShowWindow(SW_RESTORE);

      // Bring the main window or its popup to the foreground
      pWndChild->SetForegroundWindow();

      // and you are done activating the other application
      return FALSE;
   }

   return TRUE;
}

 

 

 

from : 

 

CWnd Class

 

docs.microsoft.com

 

 

 

 

FindWindowExA function (winuser.h) - Win32 apps | Microsoft Docs

 

FindWindowExA function (winuser.h) - Win32 apps

Retrieves a handle to a window whose class name and window name match the specified strings. The function searches child windows, beginning with the one following the specified child window. This function does not perform a case-sensitive search.

docs.microsoft.com

 

댓글



 

비트코인




암호화폐       외환/나스닥/골드         암호화폐/외환/나스닥/골드
     
현물 |선물 인버스 |선물 USDT       전략매니저(카피트레이딩)         프랍 트레이더 온라인 지원가능. MT4,MT5