Win32 , C++

윈도 AppBar 의 방향/상태 체크하기

김모작자 2006. 8. 4. 19:13
UINT   uState;
  CRect rcTaskbar;
  APPBARDATA abd;

  m_nSystemHeight = ::GetSystemMetrics(SM_CYSCREEN);
  m_nSystemWidth = ::GetSystemMetrics(SM_CXSCREEN);

  // 작업표시줄의 정보를 구함
  abd.cbSize = sizeof(APPBARDATA);
  abd.hWnd  = ::GetDesktopWindow();
  ::SetRect(&abd.rc, 0, 0, m_nSystemWidth, m_nSystemHeight);
  ::SHAppBarMessage(ABM_GETTASKBARPOS, &abd);

  uState = ::SHAppBarMessage(ABM_GETSTATE, &abd);

  rcTaskbar = abd.rc;

  switch(abd.uEdge)

  {
  case 0: // 왼쪽
    break;
  case 1: // 위쪽
    break;
  case 2: // 오른쪽
    break;
  case 3: // 아래쪽
    break;
  }

  // 작업표시줄이 자동 숨김인 경우
  if(uState & ABS_AUTOHIDE)
  {
  }