Click here to Skip to main content
15,898,614 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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!
Generalremote process creation Pin
Rubin Boban28-Feb-04 0:44
Rubin Boban28-Feb-04 0:44 
GeneralRe: remote process creation Pin
Antti Keskinen28-Feb-04 1:36
Antti Keskinen28-Feb-04 1:36 
Generala printing question Pin
saibetty27-Feb-04 23:59
saibetty27-Feb-04 23:59 
GeneralRe: a printing question Pin
Gary R. Wheeler28-Feb-04 6:41
Gary R. Wheeler28-Feb-04 6:41 
GeneralRe: a printing question Pin
saibetty10-Mar-04 21:28
saibetty10-Mar-04 21:28 
GeneralRe: a printing question Pin
Steve S1-Mar-04 6:44
Steve S1-Mar-04 6:44 
Questionglobalalloc = RAM? Pin
shinay27-Feb-04 22:25
shinay27-Feb-04 22:25 
AnswerRe: globalalloc = RAM? Pin
Antti Keskinen28-Feb-04 1:23
Antti Keskinen28-Feb-04 1:23 
QuestionHow I can embed an ActiveX control in the file dialog? Pin
quantum198127-Feb-04 21:15
quantum198127-Feb-04 21:15 
GeneralCButton & CReBar Pin
Bitzer.bit27-Feb-04 21:08
Bitzer.bit27-Feb-04 21:08 
GeneralRe: CButton & CReBar Pin
Antti Keskinen28-Feb-04 1:39
Antti Keskinen28-Feb-04 1:39 
GeneralRe: CButton & CReBar Pin
Bitzer.bit28-Feb-04 2:20
Bitzer.bit28-Feb-04 2:20 
GeneralRe: CButton & CReBar Pin
Antti Keskinen29-Feb-04 2:18
Antti Keskinen29-Feb-04 2:18 
GeneralDetecting the insertion/removal of removable storage Pin
mmica27-Feb-04 20:35
mmica27-Feb-04 20:35 
GeneralRe: Detecting the insertion/removal of removable storage Pin
Antti Keskinen28-Feb-04 4:06
Antti Keskinen28-Feb-04 4:06 
GeneralRe: Detecting the insertion/removal of removable storage Pin
Michael Dunn28-Feb-04 16:23
sitebuilderMichael Dunn28-Feb-04 16:23 
QuestionHow to pass safearray in a DLL Pin
ritu_kwatra27-Feb-04 20:05
ritu_kwatra27-Feb-04 20:05 

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.