//머라 이름을 정하기가 좀 그래서 그렇지만...-0-;;;
//버튼에 투명을 지정하였는데도 투명지정된곳의
//색이 빠지고 바닥색..음..회색으로 계속 남아있을때는
// 아래의 CtlColor 이라는 함수를 추가하여
// (HBRUSH)::GetStockObject(NULL_BRUSH) 이놈을 리턴시키면 된당...
HBRUSH CtlColor(CDC* pDC, UINT nCtlColor)
{
    // TODO: Change any attributes of the DC here
   
    // TODO: Return a non-NULL brush if the parent's handler should not be called
    //return NULL;
    return (HBRUSH)::GetStockObject(NULL_BRUSH);
}
2007/09/01 22:16 2007/09/01 22:16

vc++ 뷰의 스크롤바 없애자~

개발/Visual Studio 2007/09/01 22:16 posted by zekill
void OnSize(UINT nType, int cx, int cy)
{
    CFormView::OnSize(nType, cx, cy);
   

//이거 같이 한줄로 해도되고....
    if(m_bInit)
        SetScrollSizes(MM_TEXT, CSize(cx, cy));  // <<- 스크롤바 없애기...



//이거 같이 여러줄(?)로.. 해도되고..ㅡㅡ;;;   
    if(m_bInit){
        CRect rect;
        CSize size;
        GetWindowRect(&rect);
        size = rect.Size();

        SetScaleToFitSize(size);  
        GetParentFrame()->RecalcLayout();
    }
//(m_bInit) 요넘은 init가 되었는지 체크하는 플래그
//저거 안하면 기본사이즈 맘대로 커지더라...-0-;;;
//뭐사이즈야..별도로 지정해도 되고...-0-;;;; movewindow
}
2007/09/01 22:16 2007/09/01 22:16

vc++ 투명 윈도우 만들자~

개발/Visual Studio 2007/09/01 22:15 posted by zekill
BYTE byTrans = 128; // 0 - 255
    LONG lOldStyle;
    const DWORD WS_EX_LAYERED = 0x80000;
    const DWORD LWA_ALPHA = 0x2;
    typedef BOOL (_stdcall *API_TYPE)(HWND,COLORREF,BYTE,DWORD);
    API_TYPE SetLayeredWindowAttributes;

    HMODULE hUser32 = ::GetModuleHandle( _T("user32.dll"));
    SetLayeredWindowAttributes = (API_TYPE)::GetProcAddress( hUser32, "SetLayeredWindowAttributes");

    if( SetLayeredWindowAttributes)
    {
        lOldStyle = GetWindowLong( m_hWnd, GWL_EXSTYLE);
        long lret;
        lret = SetWindowLong( m_hWnd, GWL_EXSTYLE, lOldStyle | WS_EX_LAYERED);

        int ret;
        ret = SetLayeredWindowAttributes( m_hWnd, 0, byTrans, LWA_ALPHA);
    }


// 요걸로 하면 되긴 되는데...
// 다이얼로그의 스타일이 child 일때는 무조건 실패당..안댄다는얘기..ㅡㅡ
// 팝업스타일일때만 가능
2007/09/01 22:15 2007/09/01 22:15
//음..클라이언트엣지를 없애주면...-0-
//폼뷰에서 초기화할때 아래코드를...

void CInnisCastView::OnInitialUpdate()
{
    CFormView::OnInitialUpdate();
    ModifyStyleEx(WS_EX_CLIENTEDGE, 0);    // 경계선 없애기..-0-

    GetParentFrame()->RecalcLayout();
    ResizeParentToFit();

    this->GetParent()->MoveWindow(0, 0, 250, 500);
    this->GetParent()->CenterWindow();

}
2007/09/01 22:14 2007/09/01 22:14
//비트맵 불러오고
CBitmap *bmpImage;
    bmpImage = CBitmap::FromHandle((HBITMAP)LoadImage(GetModuleHandle(NULL), "skin\\All player1.bmp", IMAGE_BITMAP,0,0,LR_CREATEDIBSECTION | LR_LOADFROMFILE | LR_DEFAULTSIZE ));

//사이즈가져오고
    BITMAP bitmap;
    int nBmpWidth, nBmpHeight;
    ::GetObject(*bmpImage, sizeof(BITMAP), &bitmap);   
    nBmpWidth = bitmap.bmWidth;
    nBmpHeight = bitmap.bmHeight;
2007/09/01 22:14 2007/09/01 22:14
TAG ,