Solved

CStatusBar.

Posted on 1998-03-07
2
241 Views
Last Modified: 2013-11-20
Hi,
I have a CStatusBar object that I am trying to update from a thread. The CStatusBar object is
a public member of my CMainWnd, and I am trying to update it with Cwnd::SetWindowText. I
tried SetPaneText, but that didn't work either. In fact, the only time it did work was when I had
a debugging messagebox showing, and so the paint message was being processed. I tried
sending the paint message manually with ::SendMessage, but that didn't work either. Does
anybody know what is the problem?
Thanks,
Eoin.
0
Comment
Question by:estronge
2 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 100 total points
ID: 1316817
Call your worker thread with the handle to the main window:

AfxBeginThread(DoSomething, this->m_hWnd);

Then your worker thread has something to update:

// Worker process to do something
UINT DoSomething(LPVOID pParam)
{
      HWND hWnd = (HWND)pParam;

      ::SetDlgItemText(hWnd, IDC_STATUSBAR, "Yo!");
      return 0;    // thread completed successfully}
}
0
 

Author Comment

by:estronge
ID: 1316818
Great!!! Thanks. It didn't quite work, as I was already passing a configuration structure through
the LPVOID pParam, but you set me on the right track, I used:
::SetDlgItemText( AfxGetMainWnd() ->m_hWnd, IDC_STATUSBAR, "My Text");

Thanks again.
Eoin.

0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
function returning CString in a regular win32 DLL 8 201
Strange date stored 22 177
Question regarding Copy/Paste 16 98
Increment column based of a FK 8 53
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

697 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question