Click here to Skip to main content
15,892,072 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to Allocate global memory Pin
Michael Dunn20-Mar-05 6:05
sitebuilderMichael Dunn20-Mar-05 6:05 
GeneralRe: How to Allocate global memory Pin
ThatsAlok20-Mar-05 17:57
ThatsAlok20-Mar-05 17:57 
GeneralApi : which lists the devices on a computer Pin
brilliant10118-Mar-05 17:43
brilliant10118-Mar-05 17:43 
GeneralRe: Api : which lists the devices on a computer Pin
Gary R. Wheeler20-Mar-05 2:28
Gary R. Wheeler20-Mar-05 2:28 
GeneralWorker Thread Pin
Roger6518-Mar-05 13:12
Roger6518-Mar-05 13:12 
GeneralRe: Worker Thread Pin
PJ Arends18-Mar-05 13:27
professionalPJ Arends18-Mar-05 13:27 
GeneralRe: Worker Thread Pin
Roger6518-Mar-05 13:39
Roger6518-Mar-05 13:39 
GeneralRe: Worker Thread Pin
PJ Arends18-Mar-05 14:03
professionalPJ Arends18-Mar-05 14:03 
For what you are trying to do in the example given I think you are over-thinking your problem. Why even call SetCapture to begin with? Why even have a worker thread? All you seem to want is to get the cursor coordinates every timer tick and display them on your m_mouse window. GetCursorPos does not care about which window has the capture, it justr returns the position of the cursor in screen coordinates. Why won't something like this work?
void CColorTakeDlg::OnTimer(UINT nIDEvent)
{
   POINT pt;
   GetCursorPos(&pt);
   CString str;
   str.Format("X: %d, Y: %d", pt.x, pt.y);
   m_mouse.SetWindowText(str);
}
No worker threads, no global variables, and definitely cleaner than what you have.



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

"Obviously ???  You're definitely a superstar!!!" mYkel - 21 Jun '04

Within you lies the power for good - Use it!
Honoured as one of The Most Helpful Members of 2004

GeneralRe: Worker Thread Pin
Roger6518-Mar-05 14:45
Roger6518-Mar-05 14:45 
GeneralMFC: Unicode and Code Pages Pin
Jim Herren18-Mar-05 12:57
Jim Herren18-Mar-05 12:57 
GeneralRe: MFC: Unicode and Code Pages Pin
Mike Dimmick19-Mar-05 13:19
Mike Dimmick19-Mar-05 13:19 
GeneralRe: MFC: Unicode and Code Pages Pin
Jim Herren19-Mar-05 16:38
Jim Herren19-Mar-05 16:38 
GeneralGet "Text" with Hook Pin
postler-t18-Mar-05 11:25
postler-t18-Mar-05 11:25 
GeneralRe: Get "Text" with Hook Pin
Alexander M.,19-Mar-05 4:53
Alexander M.,19-Mar-05 4:53 
GeneralRe: Get "Text" with Hook Pin
postler-t19-Mar-05 6:44
postler-t19-Mar-05 6:44 
Generalproblem with TBSTYLE_FLAT toolbar Pin
ljr2418-Mar-05 11:10
ljr2418-Mar-05 11:10 
GeneralOnSize execution, locks Pin
Vancouver18-Mar-05 11:02
Vancouver18-Mar-05 11:02 
GeneralRe: OnSize execution, locks Pin
Blake Miller18-Mar-05 11:42
Blake Miller18-Mar-05 11:42 
GeneralRe: OnSize execution, locks Pin
Vancouver18-Mar-05 11:56
Vancouver18-Mar-05 11:56 
GeneralRe: OnSize execution, locks Pin
Blake Miller18-Mar-05 12:18
Blake Miller18-Mar-05 12:18 
GeneralRe: OnSize execution, locks Pin
Vancouver18-Mar-05 15:33
Vancouver18-Mar-05 15:33 
GeneralFinal explanation Pin
Vancouver19-Mar-05 10:59
Vancouver19-Mar-05 10:59 
Generalsizeof() question Pin
BlackDice18-Mar-05 10:22
BlackDice18-Mar-05 10:22 
GeneralRe: sizeof() question Pin
Ravi Bhavnani18-Mar-05 10:27
professionalRavi Bhavnani18-Mar-05 10:27 
GeneralRe: sizeof() question Pin
BlackDice18-Mar-05 10:42
BlackDice18-Mar-05 10:42 

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.