Click here to Skip to main content
15,907,001 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Setting Background Colour of a text Pin
Antony M Kancidrowski21-Jan-05 4:51
Antony M Kancidrowski21-Jan-05 4:51 
GeneralFolder List Pin
act_x21-Jan-05 3:55
act_x21-Jan-05 3:55 
GeneralRe: Folder List Pin
Maximilien21-Jan-05 4:38
Maximilien21-Jan-05 4:38 
GeneralRe: Folder List Pin
act_x21-Jan-05 5:25
act_x21-Jan-05 5:25 
GeneralRe: Folder List Pin
wb21-Jan-05 7:06
wb21-Jan-05 7:06 
GeneralRe: Folder List Pin
Anonymous21-Jan-05 8:05
Anonymous21-Jan-05 8:05 
GeneralRe: Folder List Pin
David Crow21-Jan-05 10:02
David Crow21-Jan-05 10:02 
General[Q] Updating an control inside other control handler problem... Pin
rbid21-Jan-05 3:31
rbid21-Jan-05 3:31 
Hello,

Setting the edit box text via SetWindowText does not work inmediatelly if you set it from one of the handlers of your dialog. Instead, the update will happen only after the handler ends its run.
void CDemoDlg::OnNewBnClicked()
{
    m_newBtn.EnableWindow(FALSE);
    GetDlgItem(IDC_STATUS_EDIT)->SetWindowText("New"); <font color=#AA0000>// Change here to IDC_STATUS_STATIC</font>
    ...
    <font color=#AA0000>// Some code that takes few msec to end</font>
    ...
    m_newBtn.EnableWindow(TRUE);
}


If I replace the Edit Control with a static control, the text is updated inmediatelly. (Before the button control is enabled)

I guess that the answer is the use of SendMessage and PostMessage.

Is there a way to update an edit control inmediatelly and not wait till the handler ends?

Any hint? (I need an edit control there)

Another example:
void CDemoDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
    HWND hwnd = pScrollBar->GetSafeHwnd();
    if (hwnd == m_mainCursorSliderCtrl.GetSafeHwnd())
    {
        int pos = m_mainCursorSliderCtrl.GetPos();
        if (pos != m_mainCursorPosition)
        {
            CString text;
            m_mainCursorPosition = pos;
            text.Format("Main:%d", pos)
            GetDlgItem(IDC_STATUS_EDIT)->SetWindowText(text);
            GetDlgItem(IDC_STATUS_STATIC)->SetWindowText(text);
            UpdateListControlData();
            }
        }

    }

    CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}

The list control and IDC_STATUS_EDIT is update only when the slider-bar stops, while the IDC_STATUS_STATIC is updated on real-time.



-- Ricky Marek (AKA: rbid)
-- "Things are only impossible until they are not" --- Jean-Luc Picard

My articles
QuestionHow to create nested directories? Pin
Monisankar21-Jan-05 3:04
Monisankar21-Jan-05 3:04 
AnswerRe: How to create nested directories? Pin
Chris Losinger21-Jan-05 3:23
professionalChris Losinger21-Jan-05 3:23 
GeneralCapturing Screen shots from a Dll Pin
mcsherry21-Jan-05 2:34
mcsherry21-Jan-05 2:34 
GeneralRe: Capturing Screen shots from a Dll Pin
mcsherry21-Jan-05 4:11
mcsherry21-Jan-05 4:11 
GeneralRe: Capturing Screen shots from a Dll Pin
Antony M Kancidrowski21-Jan-05 4:43
Antony M Kancidrowski21-Jan-05 4:43 
QuestionProtect against Spy-Software? Pin
FreewareFire21-Jan-05 2:13
FreewareFire21-Jan-05 2:13 
AnswerRe: Protect against Spy-Software? Pin
Antony M Kancidrowski21-Jan-05 4:33
Antony M Kancidrowski21-Jan-05 4:33 
GeneralRe: Protect against Spy-Software? Pin
FreewareFire21-Jan-05 5:56
FreewareFire21-Jan-05 5:56 
GeneralList all registry values in a key Pin
jonavon blakly21-Jan-05 1:55
jonavon blakly21-Jan-05 1:55 
GeneralRe: List all registry values in a key Pin
Antony M Kancidrowski21-Jan-05 4:40
Antony M Kancidrowski21-Jan-05 4:40 
QuestionRead the files or folders of a text file and display their icons? Pin
lillah21-Jan-05 0:24
lillah21-Jan-05 0:24 
AnswerRe: Read the files or folders of a text file and display their icons? Pin
David Crow21-Jan-05 10:12
David Crow21-Jan-05 10:12 
GeneralRe: Read the files or folders of a text file and display their icons? Pin
lillah21-Jan-05 12:34
lillah21-Jan-05 12:34 
GeneralCString to std::string Pin
Patrik Mueller21-Jan-05 0:10
Patrik Mueller21-Jan-05 0:10 
GeneralRe: CString to std::string Pin
Mircea Puiu21-Jan-05 0:32
Mircea Puiu21-Jan-05 0:32 
GeneralRe: CString to std::string Pin
Patrik Mueller21-Jan-05 0:53
Patrik Mueller21-Jan-05 0:53 
GeneralRe: CString to std::string Pin
Mircea Puiu21-Jan-05 1:09
Mircea Puiu21-Jan-05 1:09 

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.