Click here to Skip to main content
15,893,487 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: check if type is defined using preprocessor? Pin
Sauce!19-Oct-09 19:00
Sauce!19-Oct-09 19:00 
QuestionNeed help for CStdioFile or CFile Pin
Nicholas Amh19-Oct-09 16:29
Nicholas Amh19-Oct-09 16:29 
AnswerRe: Need help for CStdioFile or CFile Pin
«_Superman_»19-Oct-09 16:39
professional«_Superman_»19-Oct-09 16:39 
GeneralRe: Need help for CStdioFile or CFile Pin
Nicholas Amh19-Oct-09 17:10
Nicholas Amh19-Oct-09 17:10 
GeneralRe: Need help for CStdioFile or CFile Pin
Iain Clarke, Warrior Programmer19-Oct-09 23:08
Iain Clarke, Warrior Programmer19-Oct-09 23:08 
GeneralRe: Need help for CStdioFile or CFile Pin
Nicholas Amh19-Oct-09 23:39
Nicholas Amh19-Oct-09 23:39 
QuestionDarken Windows Desktop and draw normal brightness moveable rectangle [modified] Pin
Neville Franks19-Oct-09 13:06
Neville Franks19-Oct-09 13:06 
AnswerRe: Darken Windows Desktop and draw normal brightness moveable rectangle [modified] Pin
Adam Roderick J19-Oct-09 17:50
Adam Roderick J19-Oct-09 17:50 
To do this, Firstly capture the desktop image.
then do the following steps.
1. Draw the captured image.
2. Draw the invererted image of captured image over it.
some vc++ code snippet to help you:-
void OnDraw( CDC* pDC_i )
{
        if( 0 != m_NormalImage )
        {
            CDC MemDc;
            MemDc.CreateCompatibleDC( pDC_i );
            CImage  *pOldImage = MemDc.SelectObject( m_NormalImage );
            CRect rect;
            GetClientRect( &rect );
            rect.left = HEADER_OFFSET;
            rect.right = max( rect.Width(), 300 ) + HEADER_OFFSET;
            rect.top = HEADER_OFFSET;
            rect.bottom = HEADER_OFFSET + HEADER_HEIGHT ;
            COLORREF CurrentBkgd = pDC_i->SetBkColor( IMAGE_HEADER_BKGDCOLOR );
            pDC_i->SetBkColor( CurrentBkgd );
            pDC_i->BitBlt( 0, HEADER_OFFSET + HEADER_HEIGHT + HEADER_OFFSET , m_nWidth, HEADER_OFFSET + m_nHeight + HEADER_HEIGHT + HEADER_OFFSET, 
                           &MemDc, 0, 0, SRCCOPY );
            if( m_bInvertStatus && 0 != m_pInverseImage )
            {
                DrawInverseImage( pDC_i );
                
            }
            MemDc.SelectObject( pOldImage );
            MemDc.DeleteDC();
        }
}



void SetInvertImage( HBITMAP himageinverse_i)
{
       m_pinverseImage = new CBitmap();
       m_pinverseImage->Attach( himageinverse_i);
}

void DrawInvertImage( CDC* pDC_i )
{
        if( 0 !=m_pinverseImage )
        {
            CDC Memdc;
            Memdc.CreateCompatibleDC( pDC_i );
            CBitmap  *pOldBitmap = dcMem.SelectObject(m_inverseImage );
            pDC_i->BitBlt( 0, HEADER_OFFSET + HEADER_HEIGHT + HEADER_OFFSET, m_nWidth, HEADER_OFFSET + m_nHeight + HEADER_HEIGHT + HEADER_OFFSET, 
                           &dcMem, 0, 0, SRCINVERT );
            dcMem.SelectObject( pOldBitmap );
            dcMem.DeleteDC();        
        }
}


Now screen will be fully black.
3. Now make the inverted image part as transparent of your wish, just refer this article.([^])
I think your task is achieved

Величие не Бога может быть недооценена.

modified on Tuesday, October 20, 2009 12:02 AM

GeneralRe: Darken Windows Desktop and draw normal brightness moveable rectangle Pin
Neville Franks19-Oct-09 23:48
Neville Franks19-Oct-09 23:48 
AnswerRe: Darken Windows Desktop and draw normal brightness moveable rectangle Pin
Naveen19-Oct-09 18:20
Naveen19-Oct-09 18:20 
GeneralRe: Darken Windows Desktop and draw normal brightness moveable rectangle Pin
Neville Franks19-Oct-09 23:50
Neville Franks19-Oct-09 23:50 
AnswerRe: Darken Windows Desktop and draw normal brightness moveable rectangle Pin
Iain Clarke, Warrior Programmer19-Oct-09 23:05
Iain Clarke, Warrior Programmer19-Oct-09 23:05 
GeneralRe: Darken Windows Desktop and draw normal brightness moveable rectangle Pin
Neville Franks19-Oct-09 23:51
Neville Franks19-Oct-09 23:51 
QuestionSetWindowsHookEx to modify GetSaveFileName Pin
Patcher3219-Oct-09 9:49
Patcher3219-Oct-09 9:49 
AnswerRe: SetWindowsHookEx to modify GetSaveFileName Pin
Richard MacCutchan19-Oct-09 12:00
mveRichard MacCutchan19-Oct-09 12:00 
Questionerror C2955: use of class template requires template argument list in C++/MFC [modified] Pin
mfc doubt19-Oct-09 8:58
mfc doubt19-Oct-09 8:58 
AnswerRe: error C2955: use of class template requires template argument list in C++/MFC Pin
CPallini19-Oct-09 11:12
mveCPallini19-Oct-09 11:12 
AnswerRe: error C2955: use of class template requires template argument list in C++/MFC Pin
Stuart Dootson19-Oct-09 12:58
professionalStuart Dootson19-Oct-09 12:58 
QuestionSetWindowsHookEx under Windows Service Pin
FotisSs19-Oct-09 8:02
FotisSs19-Oct-09 8:02 
AnswerRe: SetWindowsHookEx under Windows Service Pin
«_Superman_»19-Oct-09 8:29
professional«_Superman_»19-Oct-09 8:29 
GeneralRe: SetWindowsHookEx under Windows Service Pin
IvanProg3-Apr-10 4:11
IvanProg3-Apr-10 4:11 
AnswerRe: SetWindowsHookEx under Windows Service Pin
mirushaki27-Jul-15 1:26
mirushaki27-Jul-15 1:26 
QuestionhWnd passed into another class Pin
Nicola Curran19-Oct-09 5:44
Nicola Curran19-Oct-09 5:44 
AnswerRe: hWnd passed into another class Pin
Chris Losinger19-Oct-09 6:29
professionalChris Losinger19-Oct-09 6:29 
AnswerRe: hWnd passed into another class Pin
Cedric Moonen19-Oct-09 7:17
Cedric Moonen19-Oct-09 7:17 

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.