Click here to Skip to main content
15,913,159 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: problem with colour the radio & check box in property page Pin
Rajesh R Subramanian12-Nov-06 19:39
professionalRajesh R Subramanian12-Nov-06 19:39 
GeneralRe: problem with colour the radio & check box in property page Pin
vikas amin12-Nov-06 20:21
vikas amin12-Nov-06 20:21 
GeneralRe: problem with colour the radio & check box in property page Pin
Rajesh R Subramanian12-Nov-06 20:43
professionalRajesh R Subramanian12-Nov-06 20:43 
GeneralRe: problem with colour the radio & check box in property page Pin
vikas amin12-Nov-06 21:14
vikas amin12-Nov-06 21:14 
Question"How can I pass jbyte * from C++ to VB" Pin
Orchid8512-Nov-06 0:46
Orchid8512-Nov-06 0:46 
Questioninterface in background Pin
Johpoke12-Nov-06 0:42
Johpoke12-Nov-06 0:42 
AnswerRe: interface in background Pin
Sceptic Mole12-Nov-06 6:16
Sceptic Mole12-Nov-06 6:16 
AnswerRe: interface in background Pin
Mike_V12-Nov-06 15:10
Mike_V12-Nov-06 15:10 
GeneralRe: interface in background Pin
Johpoke13-Nov-06 8:17
Johpoke13-Nov-06 8:17 
GeneralRe: interface in background Pin
Mike_V13-Nov-06 8:43
Mike_V13-Nov-06 8:43 
GeneralRe: interface in background Pin
Johpoke13-Nov-06 8:51
Johpoke13-Nov-06 8:51 
GeneralRe: interface in background Pin
Johpoke13-Nov-06 8:52
Johpoke13-Nov-06 8:52 
GeneralRe: interface in background Pin
Mike_V13-Nov-06 12:20
Mike_V13-Nov-06 12:20 
GeneralRe: interface in background Pin
Johpoke14-Nov-06 6:21
Johpoke14-Nov-06 6:21 
GeneralRe: interface in background Pin
Johpoke14-Nov-06 9:09
Johpoke14-Nov-06 9:09 
Questionhow to generate key for using in AES algo Pin
sharad puttar12-Nov-06 0:22
sharad puttar12-Nov-06 0:22 
AnswerRe: how to generate key for using in AES algo Pin
Mark Salsbery12-Nov-06 8:02
Mark Salsbery12-Nov-06 8:02 
QuestionDetecting mouse buttons Pin
Waldermort11-Nov-06 23:55
Waldermort11-Nov-06 23:55 
Detecting mouse buttons itself is quite easy, but there an equaly easy way to detect if the mouse button is being held down for a period of time?

My method is to launch my own message loop, but if an error occurs it would kinda mess up the whole program. Please take a look at my code and if you see any potential probems, please point them out.

do
{
    if ( ! ::GetMessage( &msg, 0, 0, 0 ) )
        break;
    if ( ::CallMsgFilter( &msg, MSGF_SCROLLBAR ) )
        continue;
    pt = msg.pt;
    ::ScreenToClient(m_hWnd,&pt);
    if (msg.message == WM_LBUTTONUP)
        HandleMouseUp(pt);
    else if (msg.message == WM_MOUSEMOVE)
        HandleMouseMove(pt);
    else if (msg.message == WM_TIMER)
    {
        if ( bFirstRun )
        {
            // prevent a single click acting like a hold
            bFirstRun = false;
            // cause a 500ms pause before acting on mouse hold
            for ( int i=0; i<50; i++ )
            {
                ::Sleep(10);
                MSG peek;
                if ( PeekMessage(&peek,m_hWnd,WM_LBUTTONUP,WM_LBUTTONUP,FALSE) )
                    break;
            }
            continue;
        }
        HandleMouseDown(pt);
    }
    else
    {
        ::TranslateMessage( &msg );
        ::DispatchMessageW( &msg );
    }
} while ( msg.message != WM_LBUTTONUP );

AnswerRe: Detecting mouse buttons Pin
Mike_V12-Nov-06 15:23
Mike_V12-Nov-06 15:23 
QuestionWant help,please. Pin
toeh11-Nov-06 23:04
toeh11-Nov-06 23:04 
AnswerRe: Want help,please. Pin
Hamid_RT11-Nov-06 23:13
Hamid_RT11-Nov-06 23:13 
GeneralRe: Want help,please. Pin
toeh11-Nov-06 23:38
toeh11-Nov-06 23:38 
GeneralRe: Want help,please. Pin
Hamid_RT12-Nov-06 0:13
Hamid_RT12-Nov-06 0:13 
GeneralRe: Want help,please. Pin
toeh12-Nov-06 0:19
toeh12-Nov-06 0:19 
GeneralRe: Want help,please. Pin
Hamid_RT12-Nov-06 0:49
Hamid_RT12-Nov-06 0:49 

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.