Click here to Skip to main content
15,894,343 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Retreiving processor serial number Pin
Pavlos Touboulidis9-Jul-01 10:25
Pavlos Touboulidis9-Jul-01 10:25 
GeneralRe: Retreiving processor serial number Pin
orcun colak10-Jul-01 8:04
orcun colak10-Jul-01 8:04 
General_declspec(property) Question Pin
Philip Patrick9-Jul-01 2:32
professionalPhilip Patrick9-Jul-01 2:32 
GeneralRe: _declspec(property) Question Pin
coder84729-Jul-01 2:42
coder84729-Jul-01 2:42 
GeneralRe: _declspec(property) Question Pin
Philip Patrick9-Jul-01 3:03
professionalPhilip Patrick9-Jul-01 3:03 
GeneralRe: _declspec(property) Question Pin
Tomasz Sowinski9-Jul-01 2:44
Tomasz Sowinski9-Jul-01 2:44 
GeneralThanks a lot ! Pin
9-Jul-01 2:17
suss9-Jul-01 2:17 
GeneralSetCapture problem in modal dialog Pin
Christian Graus9-Jul-01 2:11
protectorChristian Graus9-Jul-01 2:11 
I have written us a colour picker to replace the scabby Windows one, and especially with GDI+, allow us to enter alpha as well. My managet wants to be able to select colours from anywhere on the screen by clicking on them. Rather than make the dialog modeless, I decided to be cunning, and call SetCapture and then just check if I have clicked outside the dialog. I call SetCapture in OnInitDialog, and then in OnLButtonDOwn I do this:

CRect rc;
GetWindowRect(&rc);
CPoint pt = point;
ClientToScreen(&pt);
if (!rc.PtInRect(pt))
{
    CWindowDC window(NULL);
    COLORREF rgb = window.GetPixel(pt);
    UpdateData();
    m_Red = GetRValue(rgb);
    m_Green = GetGValue(rgb);
    m_Blue = GetBValue(rgb);
    UpdateData(false);
    ReleaseCapture();
    SetCapture();
    Invalidate(false);
    return;
}


I've added releasecapture and setcapture to try and solve my problem, which is this. This all works great the first time I do it, after that it won't work at all. Clicking in the dialog works, of course, but I did a debug with a breakpoint set, and OnLButton down is not called again after time if I click outside the dialog. How can I keep the Capture for as long as the dialog is running ? Do I need to run a timer ? Why doesn't it work in the function as I wrote it ? Where's that piece of rope when I need it ?

Christian

#include "std_disclaimer.h"

People who love sausage and respect the law should never watch either one being made.

The things that come to those who wait are usually the things left by those who got there first.
GeneralRe: SetCapture problem in modal dialog Pin
Tomasz Sowinski9-Jul-01 2:26
Tomasz Sowinski9-Jul-01 2:26 
GeneralRe: SetCapture problem in modal dialog Pin
Christian Graus9-Jul-01 12:17
protectorChristian Graus9-Jul-01 12:17 
GeneralMenu's Pin
vijayaramaraju9-Jul-01 1:11
vijayaramaraju9-Jul-01 1:11 
GeneralRe: Menu's Pin
9-Jul-01 1:19
suss9-Jul-01 1:19 
GeneralRe: Menu's Pin
9-Jul-01 1:22
suss9-Jul-01 1:22 
GeneralRe: Menu's Pin
Tomasz Sowinski9-Jul-01 1:22
Tomasz Sowinski9-Jul-01 1:22 
Generalcolouring in VC Pin
vijayaramaraju9-Jul-01 1:08
vijayaramaraju9-Jul-01 1:08 
GeneralRe: colouring in VC Pin
9-Jul-01 1:27
suss9-Jul-01 1:27 
GeneralThe Registry - complex issues Pin
James Parker9-Jul-01 0:23
James Parker9-Jul-01 0:23 
GeneralRe: The Registry - complex issues Pin
Tomasz Sowinski9-Jul-01 0:48
Tomasz Sowinski9-Jul-01 0:48 
GeneralRe: The Registry - complex issues Pin
9-Jul-01 3:51
suss9-Jul-01 3:51 
Generaldatabase error item... Pin
Gérald Mercet8-Jul-01 23:35
Gérald Mercet8-Jul-01 23:35 
Generaloverlay YUV data using direcX Pin
8-Jul-01 20:07
suss8-Jul-01 20:07 
Generalthe same user interface as MS media player7 Pin
prog75848-Jul-01 18:10
prog75848-Jul-01 18:10 
GeneralHelp with Networking Code Pin
8-Jul-01 15:01
suss8-Jul-01 15:01 
GeneralRe: Help with Networking Code Pin
Sascha Loetz9-Jul-01 0:01
Sascha Loetz9-Jul-01 0:01 
Generalsource code on buffer manager and page Pin
thinker8-Jul-01 12:11
thinker8-Jul-01 12:11 

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.