천객만래 [千客萬來] (It has an interminable succession of visitors)

'CallWindowProc'에 해당되는 글 2건

  1. 2015.01.15 [개발/VC] IE 서브클래싱(subclass)
  2. 2011.02.07 [개발/VC] IE 서브클래싱(subclass)




[VC] IE 서브클래싱(subclass)


WNDPROC g_pOldProc;

static LRESULT CALLBACK MyIEProc(HWND, UINT, WPARAM, LPARAM);

 

 

void CBand::SubClass(HWND hWnd)

{

     // 64bit 환경을 위해서 SetWindowLongPtr() 사용

    g_pOldProc = (WNDPROC) SetWindowLongPtr(hwndOfCallingComponent, GWLP_WNDPROC, (LONG_PTR)IEProc);

}

 

LRESULT CALLBACK CBand::MyIEProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
 BOOL bRes = false;

 if (Message == WM_SIZE)
  bRes = g_pBand->SetPosition();
 if (Message == WM_ERASEBKGND)
  bRes  = false;

 if (bRes == false)
  return CallWindowProc (g_pOldProc, hwnd, message, wParam, lParam);

}

// 위치 체크 및 이동
BOOL CBand::SetPosition()
{
 RECT rc;

 ::GetClientRect(m_BandWnd, &rc);
 if (rc.top == 0)
 {
  // 작업내용
 }

 return false;
}

 

 

참고 :

http://0x68.com/shorts/subclass.asp

http://social.msdn.microsoft.com/Forums/en/vclanguage/thread/7cd4b8b5-1cd6-4661-9f29-e0569156cea4

http://www.cyworld.com/soinho/1291233

Posted by SB패밀리

[VC] IE 서브클래싱(subclass)


WNDPROC g_pOldProc;

static LRESULT CALLBACK MyIEProc(HWND, UINT, WPARAM, LPARAM);

 

void CBand::SubClass(HWND hWnd)
{
     // 64bit 환경을 위해서 SetWindowLongPtr() 사용

    g_pOldProc = (WNDPROC) SetWindowLongPtr(hwndOfCallingComponent, GWLP_WNDPROC, (LONG_PTR)IEProc);
}

LRESULT CALLBACK CBand::MyIEProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
 BOOL bRes = false;

 if (Message == WM_SIZE)
  bRes = g_pBand->SetPosition();
 if (Message == WM_ERASEBKGND)
  bRes  = false;

 if (bRes == false)
  return CallWindowProc (g_pOldProc, hwnd, message, wParam, lParam);

}

// 위치 체크 및 이동
BOOL CBand::SetPosition()
{
 RECT rc;

 ::GetClientRect(m_BandWnd, &rc);
 if (rc.top == 0)
 {
  // 작업내용
 }

 return false;
}

 

참고 :

http://0x68.com/shorts/subclass.asp
http://social.msdn.microsoft.com/Forums/en/vclanguage/thread/7cd4b8b5-1cd6-4661-9f29-e0569156cea4
http://www.cyworld.com/soinho/1291233

Posted by SB패밀리