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

C / C++ / MFC

 
GeneralRe: How to Allocate global memory Pin
ThatsAlok18-Mar-05 22:31
ThatsAlok18-Mar-05 22:31 
GeneralRe: How to Allocate global memory Pin
Mircea Puiu20-Mar-05 0:33
Mircea Puiu20-Mar-05 0:33 
GeneralRe: How to Allocate global memory Pin
ThatsAlok20-Mar-05 17:49
ThatsAlok20-Mar-05 17:49 
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 
Here is my worker thread that I create ever 100ms in the OnTimer() function, it works but uses 97% of the cpu. Any help would be appreciated.
POINT pt; // Global for GetMouseProc & OnTimer.

UINT GetMouseProc(LPVOID pParam)
{
HWND hwnd = ::GetDesktopWindow();
::SetCapture(hwnd);
::GetCursorPos(&pt);
::ReleaseCapture();
::ExitThread(0);

return 0;
}

void CColorTakeDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default

HWND m_hwnd = ::GetDesktopWindow();
CString str;

// =======================================================================
// Get the mouse pointer position and display it
// =======================================================================
DWORD ExitCode = STILL_ACTIVE;
HANDLE m_hThread;
if(pThread == NULL)
{
pThread = AfxBeginThread(GetMouseProc, this, THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED, NULL);
pThread->m_bAutoDelete = FALSE;
m_hThread = pThread->m_hThread;
}
pThread->ResumeThread();
while(ExitCode == STILL_ACTIVE)
{
::GetExitCodeThread(m_hThread, &ExitCode);
}
delete(pThread);
pThread = NULL;

str.Format("X: %d, Y: %d", pt.x, pt.y);
m_mouse.SetWindowText((LPCTSTR)str);



Old dog learning new tricks!
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 
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 

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.