Setting Views in List View

Can I have the full source code to change to different Views for a list view...

my implementation of :


      DWORD dwNewStyle = LVS_SMALLICON;
      DWORD dwOldStyle = GetWindowLong(m_hWnd, GWL_STYLE);
      dwNewStyle |= (dwOldStyle &=~LVS_TYPEMASK);
      SetWindowLong(m_hWnd, GWL_STYLE, dwNewStyle);

doesnt seem to do anything. I insert this codes to a bunch of buttons which represent the different views. I change the variable dwNewStyle to support the 4 views.

Thanks..
load_o_crapAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ZoppoCommented:
Hi load_o_crap,

Just use CWnd::ModifyStyle() to change it, i.e.:

CWnd* pList = GetDlgItem( IDC_LIST1 );
// change to SmallIcon view
pList->ModifyStyle( LVS_TYPEMASK, LVS_SMALLICON );


hope that helps,

ZOPPO
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
load_o_crapAuthor Commented:
cool!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.