Click here to Skip to main content
15,891,033 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Packing and running files with protection Pin
Andrew Walker6-Aug-03 15:13
Andrew Walker6-Aug-03 15:13 
GeneralRe: Packing and running files with protection Pin
Kayembi7-Aug-03 0:20
Kayembi7-Aug-03 0:20 
GeneralMFC picture control Pin
rapace6-Aug-03 13:20
rapace6-Aug-03 13:20 
GeneralRe: MFC picture control Pin
zeki yugnak6-Aug-03 13:43
zeki yugnak6-Aug-03 13:43 
GeneralRe: MFC picture control Pin
rapace6-Aug-03 13:51
rapace6-Aug-03 13:51 
GeneralCreating MHT archives Pin
DarrollWalsh6-Aug-03 12:47
DarrollWalsh6-Aug-03 12:47 
QuestionHow to use Windows XP 'fade to black and white' screen? Pin
ckr6-Aug-03 11:38
ckr6-Aug-03 11:38 
GeneralProblem with ShowWindow() and losing focus Pin
s_k6-Aug-03 11:17
s_k6-Aug-03 11:17 
Hi, I have MFC application with splitter window that divides client area to two views, both are CListView-derived classes. Because I want to keep columns to have stable proportions all the time, I'm catching CMyListView::OnSize() and executing this code:

void CMyFileView::OnSize(UINT nType, int cx, int cy)
{
int my_cx = cx;
INT iWidth = 0;
RECT viewRect;
::ZeroMemory(&viewRect, sizeof(RECT));
GetClientRect(&viewRect);
INT iViewLen = viewRect.right - viewRect.left;
CMultiColumnSortListView::OnSize(nType, cx, cy);
// disable horizontal scroll bar
GetListCtrl().ShowScrollBar(SB_HORZ, FALSE);
INT iColWidth = 0;
if (cx != old_cx)
{
GetListCtrl().ShowWindow(SW_HIDE);
for (INT i = 0; i < (COLUMN_NUM - 1); i++)
{
iColWidth = viewRect.right * COLUMN_WIDTHS[i];
iWidth += iColWidth;
GetListCtrl().SetColumnWidth(i, (viewRect.right * COLUMN_WIDTHS[i]));
}
GetListCtrl().SetColumnWidth((COLUMN_NUM - 1), (iViewLen - iWidth));
GetListCtrl().ShowWindow(SW_SHOW);
}
}
old_cx = cx;
}

I call ShowWindow() in order to stop flickering, it helped. The problem is, calling ShowWindow() deselectes selected item (selected before with SetItemState()). I tried to call SetItemState() again after ShowWindow(SW_SHOW), but it doesn't work as expected, it highlights item, but it doesn't select and focus it 100% (it just draw grey rectangle aroung the item, but doesn't display dark blue rectangle which appears in normal case).

Does somebody know what to do to select and focus the item again successfully?

Thanks for any suggestion.
GeneralMouse X.Y in WM_NOTIFY: LVN_ITEMACTIVATE Pin
Mike Doner6-Aug-03 8:59
Mike Doner6-Aug-03 8:59 
GeneralRe: Mouse X.Y in WM_NOTIFY: LVN_ITEMACTIVATE Pin
Chunhua Liu6-Aug-03 11:37
Chunhua Liu6-Aug-03 11:37 
GeneralRe: Mouse X.Y in WM_NOTIFY: LVN_ITEMACTIVATE Pin
jhwurmbach6-Aug-03 22:01
jhwurmbach6-Aug-03 22:01 
QuestionCreate a report in VC6? Pin
_skidrow_vn_6-Aug-03 8:48
_skidrow_vn_6-Aug-03 8:48 
GeneralCString toupper Pin
keegan6-Aug-03 8:38
keegan6-Aug-03 8:38 
GeneralRe: CString toupper Pin
Michael P Butler6-Aug-03 9:14
Michael P Butler6-Aug-03 9:14 
GeneralRe: CString toupper Pin
keegan6-Aug-03 9:23
keegan6-Aug-03 9:23 
QuestionHow to generate random number? Pin
DaveE9th6-Aug-03 8:38
DaveE9th6-Aug-03 8:38 
AnswerRe: How to generate random number? Pin
David Crow6-Aug-03 10:21
David Crow6-Aug-03 10:21 
GeneralRe: How to generate random number? Pin
DaveE9th6-Aug-03 10:58
DaveE9th6-Aug-03 10:58 
GeneralRe: How to generate random number? Pin
Chunhua Liu6-Aug-03 11:31
Chunhua Liu6-Aug-03 11:31 
GeneralRe: How to generate random number? Pin
David Crow7-Aug-03 2:44
David Crow7-Aug-03 2:44 
Generalpassword Pin
rapace6-Aug-03 8:28
rapace6-Aug-03 8:28 
GeneralRe: password Pin
rapace6-Aug-03 8:30
rapace6-Aug-03 8:30 
GeneralRe: password Pin
Maximilien6-Aug-03 8:31
Maximilien6-Aug-03 8:31 
GeneralRe: password Pin
rapace6-Aug-03 9:22
rapace6-Aug-03 9:22 
GeneralRe: password Pin
Maximilien6-Aug-03 10:16
Maximilien6-Aug-03 10:16 

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.