Click here to Skip to main content
15,911,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Resizing PropertySheet. Pin
«_Superman_»27-Jun-09 17:40
professional«_Superman_»27-Jun-09 17:40 
GeneralRe: Resizing PropertySheet. Pin
FISH78627-Jun-09 17:55
FISH78627-Jun-09 17:55 
Questionpointer-to-pointer cannot be used to allocate huge matrices Pin
ro_milano27-Jun-09 6:38
ro_milano27-Jun-09 6:38 
Questionhow can i get lpstore value. Pin
santhosh-padamatinti27-Jun-09 1:56
santhosh-padamatinti27-Jun-09 1:56 
QuestionAdd Virtual Function in VC6 missing in VS2008 Pin
sashoalm27-Jun-09 1:56
sashoalm27-Jun-09 1:56 
AnswerRe: Add Virtual Function in VC6 missing in VS2008 Pin
«_Superman_»27-Jun-09 2:38
professional«_Superman_»27-Jun-09 2:38 
GeneralRe: Add Virtual Function in VC6 missing in VS2008 Pin
sashoalm27-Jun-09 2:47
sashoalm27-Jun-09 2:47 
Questionconverting Strucutre to Byte array Pin
jalsa G26-Jun-09 23:58
jalsa G26-Jun-09 23:58 
AnswerRe: converting Strucutre to Byte array Pin
chandu00427-Jun-09 0:01
chandu00427-Jun-09 0:01 
GeneralRe: converting Strucutre to Byte array Pin
jalsa G27-Jun-09 0:06
jalsa G27-Jun-09 0:06 
GeneralRe: converting Strucutre to Byte array Pin
chandu00427-Jun-09 0:11
chandu00427-Jun-09 0:11 
GeneralRe: converting Strucutre to Byte array Pin
CPallini27-Jun-09 0:41
mveCPallini27-Jun-09 0:41 
GeneralRe: converting Strucutre to Byte array Pin
«_Superman_»27-Jun-09 2:51
professional«_Superman_»27-Jun-09 2:51 
GeneralRe: converting Strucutre to Byte array Pin
kumar sanghvi27-Jun-09 3:01
kumar sanghvi27-Jun-09 3:01 
GeneralRe: converting Strucutre to Byte array Pin
CPallini27-Jun-09 4:28
mveCPallini27-Jun-09 4:28 
QuestionDoes it have a part for C++ builder? Pin
favorxx26-Jun-09 21:20
favorxx26-Jun-09 21:20 
AnswerRe: Does it have a part for C++ builder? Pin
CPallini26-Jun-09 23:37
mveCPallini26-Jun-09 23:37 
GeneralRe: Does it have a part for C++ builder? Pin
favorxx27-Jun-09 2:19
favorxx27-Jun-09 2:19 
QuestionHow to read footer at a sector using C++/VC++ Pin
Shiv Murti Pal26-Jun-09 20:51
Shiv Murti Pal26-Jun-09 20:51 
QuestionWrite PE with VC6 [modified] Pin
tuan111126-Jun-09 17:51
tuan111126-Jun-09 17:51 
AnswerRe: Write kernel OS Pin
Michael Schubert26-Jun-09 23:52
Michael Schubert26-Jun-09 23:52 
GeneralRe: Write kernel OS Pin
sashoalm27-Jun-09 1:37
sashoalm27-Jun-09 1:37 
QuestionContext sensitive help in MFC app Pin
Sternocera26-Jun-09 10:39
Sternocera26-Jun-09 10:39 
Question[SOLVED] Help needed with Alphablend function [modified] Pin
Rozis26-Jun-09 10:01
Rozis26-Jun-09 10:01 
AnswerRe: Help needed with Alphablend function Pin
PJ Arends26-Jun-09 11:05
professionalPJ Arends26-Jun-09 11:05 
I use it on a splash screen.

header file:
typedef BOOL (WINAPI ALPHABLEND)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION);
typedef ALPHABLEND* LPALPHABLEND;

class ...
{
...
   HINSTANCE m_hLib;
   LPALPHABLEND m_lpfnAlphaBlend;
...
};


source file:
// in class c'tor
        m_hLib = LoadLibrary(_T("msimg32.dll"));
        if (m_hLib != NULL)
        {
            m_lpfnAlphaBlend = (LPALPHABLEND)GetProcAddress(m_hLib, "AlphaBlend");
        }

// in class d'tor
    if (m_hLib != NULL)
    {
        FreeLibrary(m_hLib);
        m_hLib = NULL;
    }


BOOL C*********::OnEraseBkgnd(CDC* pDC) 
{
    CDialog::OnEraseBkgnd(pDC);

    if (m_lpfnAlphaBlend != NULL)
    {
        CRect rc;
        GetClientRect(rc);

        BITMAP b;
        if (GetObject(m_hBitmap,
                      sizeof(BITMAP),
                      &b))
        {
            CDC DC;
            DC.CreateCompatibleDC(pDC);
            int s = DC.SaveDC();

            DC.SelectObject(m_hBitmap);
            
            BLENDFUNCTION bf = {0};
            bf.BlendOp = AC_SRC_OVER;
            bf.SourceConstantAlpha = 0x20;

            m_lpfnAlphaBlend(*pDC,
                             (rc.Width() - b.bmWidth) / 2,
                             (rc.Height() - b.bmHeight) / 2,
                             b.bmWidth,
                             b.bmHeight,
                             DC,
                             0,
                             0,
                             b.bmWidth,
                             b.bmHeight,
                             bf);
            DC.RestoreDC(s);
        }
    }
	
    return TRUE;
}



You may be right
I may be crazy
-- Billy Joel --


Within you lies the power for good - Use it!

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.