SetWindowRedraw (hwndList, FALSE); no flashing and re-painting

Source: Internet
Author: User

HWND hwndList = GetDlgItem (hwnd, IDC_PROCESSMODULELIST );
SetWindowRedraw (hwndList, FALSE );
ComboBox_ResetContent (hwndList );

CToolhelp thProcesses (TH32CS_SNAPPROCESS );
PROCESSENTRY32 pe = {sizeof (pe )};
BOOL fOk = thProcesses. ProcessFirst (& pe );
For (; fOk = thProcesses. ProcessNext (& pe )){
TCHAR sz [1024];

// Place the process name (without its path) & ID in the list
PCTSTR pszExeFile = _ tcsrchr (pe. szExeFile, TEXT ('//'));
If (pszExeFile = NULL) pszExeFile = pe. szExeFile;
Else pszExeFile ++; // Skip over the slash
Wsprintf (sz, TEXT ("% s (0x % 08X)"), pszExeFile, pe. th32ProcessID );
Int n = ComboBox_AddString (hwndList, sz );

// Associate the process ID with the added item
ComboBox_SetItemData (hwndList, n, pe. th32ProcessID );
}
ComboBox_SetCurSel (hwndList, 0); // Select the first entry

// Simulate the user selecting this first item so that
// Results pane shows something interesting
FORWARD_WM_COMMAND (hwnd, IDC_PROCESSMODULELIST,
HwndList, CBN_SELCHANGE, SendMessage );

SetWindowRedraw (hwndList, TRUE );
InvalidateRect (hwndList, NULL, FALSE );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.