Re: Solved: No border on dynamically created CListCtrl in W2K (fine on XP)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I note that at no time had you previously posted that you called ModifyStyle(Ex). The
answer would have been obvious.

Keep in mind when asking questions

(a) ask the question you have in mind
(b) provide ALL the information about the problem
(c) provide a suitable code example.

You gave a partial code example (horrendously incomplete, in retrospect). It is not
surprising that, given the rather incomplete information, that nobody had ever seen your
problem. You'd never described your problem! You waved your hands in a vague way about
some unspecified code.
joe

On Sat, 2 Dec 2006 13:56:44 -0500, "bob" <bob@xxxxxxxxxx> wrote:

I think I finally got it. It works on 2 different W2K machines so I'm
assuming that I'll be OK.
The key seems to be SWP_FRAMECHANGED flag in ModifyStyle(Ex). So, after the
control is created I call ModifyStyle() and provide the flag to force
WM_NCCALCSIZE to be send to the control. Dialogs must be doing that too
although I'm not certain about it. I also had to remove WS_BORDER so the
control does not have a 'double' border under XP (but this is another
story). My current code to create the control is as follows:

DWORD dwStyle = LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER |
LVS_ALIGNLEFT | WS_TABSTOP;
DWORD dwExStyle = WS_EX_CLIENTEDGE;
BOOL bRet = m_pwndList->CreateEx(dwExStyle, dwStyle, rect, this, IDC_LIST);
m_pwndList->ModifyStyle(WS_BORDER, 0, SWP_SHOWWINDOW | SWP_FRAMECHANGED);

It works fine now on both XP and W2K.
Many thanks to all of you who tried to help me.
Bob


"bob" <bob@xxxxxxxxxx> wrote in message
news:u75BhYbFHHA.5104@xxxxxxxxxxxxxxxxxxxxxxx
I've run into this weird problem with CListCtrl in report view. I need to
create the list dynamically using new() and Create() in OnInitDialog().
The problem is that on W2K the list appears without a border when it is
empty or not completely filled with items. When the number of items is
greater than can be shown (i.e. a scrollbar appears on the right side) the
border is displayed fine.

The same code works fine on XP.

And, of course, lists - empty or filled - placed on dialogs at design time
have always worked fine for me. I used Spy++ to compare window styles of
list controls created in a dialog editor with styles of the dynamically
created one and did not see any differences.

Has anyone run into this problem? I'd appreciate _any_suggestions.

Thanks,
Bob


Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Interpol "configured to reject your mail" re Paul Gieschen (Heropoules/Vensel)
    ... Most republicons have so little mind, that control is basic and simple, just ... for the government and was equipped with a spray to put a sleeping ... wonder what else is sacred these people might torture. ...
    (soc.retirement)
  • The Doors Of Perception: Why Americans Will Believe Almost Anything
    ... invisible government which is the true ruling power of our country. ... This is a logical result of the way in which our democratic society is ... pull the wires that control the public mind." ... of media control arose historically, the reader might be more apt to ...
    (sci.med)
  • Re: Another reason why genocide is the answer...
    ... Gee, just who is that we control over there, would you ... > a nice uninteruppted weapons flow. ... Never mind the fact that the odds are ... If middle east didn't have oil, 99.99% of all americans including the people ...
    (rec.sport.paintball)
  • Re: HAARP: Is Mind located in Tsunami Wave Function?
    ... The speculations about HAARP mass mind control cannot be far ... > This control is at its worse around the globe right here in the USA. ... and any other form of technology which uses electromagnetic transfer, ... Another web site devoted to synthetic telepathy and subliminal, ...
    (sci.physics)
  • Re: Dream GUI toolkit (Was: GUI programming.)
    ... > the designer or programmer thought he was being 'artistic'. ... > designer control over how the buttons are arranged. ... Similar, in my mind, to a drum track or synth arpeggio. ... Certainly drum tracks and auto layout are faster and ...
    (comp.programming)