Click here to Skip to main content
15,910,980 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Can we use ConvertSidToStringSid in VC++6.0 and Windows2000? Pin
Michael Dunn29-Feb-04 6:37
sitebuilderMichael Dunn29-Feb-04 6:37 
GeneralKnights Tour Pin
Pharacyde28-Feb-04 21:10
Pharacyde28-Feb-04 21:10 
Generaltooltip for ListCtrl in MDI application Pin
Dudi Avramov28-Feb-04 21:03
Dudi Avramov28-Feb-04 21:03 
GeneralProblem to play and record wave files!!! Pin
Mehdi_Hosseinpour28-Feb-04 19:09
Mehdi_Hosseinpour28-Feb-04 19:09 
GeneralFirewalls & VC++ FTP application again Pin
rasha200328-Feb-04 18:17
rasha200328-Feb-04 18:17 
GeneralDifficuties on Mouse Coordinates Detection Pin
ansontong28-Feb-04 17:32
ansontong28-Feb-04 17:32 
GeneralRe: Difficuties on Mouse Coordinates Detection Pin
akira3229-Feb-04 1:23
akira3229-Feb-04 1:23 
GeneralBeginner: Having trouble with LoadResource and Windows Pin
mjeb111128-Feb-04 13:49
mjeb111128-Feb-04 13:49 
GeneralRe: Beginner: Having trouble with LoadResource and Windows Pin
Gerald Schwab28-Feb-04 14:49
Gerald Schwab28-Feb-04 14:49 
GeneralRe: Beginner: Having trouble with LoadResource and Windows Pin
mjeb111128-Feb-04 16:02
mjeb111128-Feb-04 16:02 
GeneralRe: Beginner: Having trouble with LoadResource and Windows Pin
Gary R. Wheeler29-Feb-04 5:58
Gary R. Wheeler29-Feb-04 5:58 
GeneralRe: Beginner: Having trouble with LoadResource and Windows Pin
mjeb111129-Feb-04 12:12
mjeb111129-Feb-04 12:12 
GeneralDialogBar and Tab Controls Pin
krugger28-Feb-04 11:37
krugger28-Feb-04 11:37 
Generalregsvr32 and XP Pin
BaldwinMartin28-Feb-04 9:03
BaldwinMartin28-Feb-04 9:03 
GeneralDLL bitmap Pin
BaldwinMartin28-Feb-04 7:58
BaldwinMartin28-Feb-04 7:58 
GeneralRe: DLL bitmap Pin
Gary R. Wheeler29-Feb-04 6:22
Gary R. Wheeler29-Feb-04 6:22 
GeneralCaps Lock Pin
Archer28228-Feb-04 7:01
Archer28228-Feb-04 7:01 
GeneralRe: Caps Lock Pin
PJ Arends28-Feb-04 8:27
professionalPJ Arends28-Feb-04 8:27 
GeneralRe: Caps Lock Pin
Archer28228-Feb-04 8:32
Archer28228-Feb-04 8:32 
GeneralRe: Caps Lock Pin
PJ Arends28-Feb-04 9:23
professionalPJ Arends28-Feb-04 9:23 
Generalflickering of controls Pin
JWood28-Feb-04 6:00
JWood28-Feb-04 6:00 
GeneralRe: flickering of controls Pin
alex.barylski28-Feb-04 10:36
alex.barylski28-Feb-04 10:36 
GeneralToolbar and transparent icons problem Pin
NodeX28-Feb-04 4:13
NodeX28-Feb-04 4:13 
Generalleft button mouse lock Pin
jmb2428-Feb-04 4:11
jmb2428-Feb-04 4:11 
GeneralRe: left button mouse lock Pin
PJ Arends28-Feb-04 9:52
professionalPJ Arends28-Feb-04 9:52 
A very good introduction to global hooks : http://www.flounder.com/hooks.htm[^]

Not having done what you want to do, this is just a guess. How about, when your user presses the left mouse button down, you set a flag in your dll, and while that flag is set you block all subsequent left mouse button messages until the user does whatever they have to to clear the flag. I believe you can block mouse messages by having your hook function return any positive value instead of returning the value returned by CallNextHookEx().

Untested code, but this should give you an idea.
LRESULT CALLBACK MouseHookProc(int code, WPARAM wp, LPARAM lp)
{
    LRESULT ret = CallNextHookEx(m_hMouseHook, code,  wp, lp);
    if (!m_bFlagSet && wp == WM_LBUTTONDOWN)
    {
        // Set the flag, allow the mouse message through
        m_bFlagSet = true;
        return ret;
    }
 
    if (m_bFlagSet && (wp == WM_LBUTTONDOWN || wp == WM_LBUTTONUP))
    {
        // flag is set, block the mouse message
        return 1;
    }
 
    // allow all other mouse messages through
    return ret;
}


HTH







Sonork 100.11743 Chicken Little

"You're obviously a superstar." - Christian Graus about me - 12 Feb '03

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.