The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: ossama on December 01, 2007, 08:28:36 AM

Title: ListView : types of view
Post by: ossama on December 01, 2007, 08:28:36 AM
hello, i found in the msdn two methodes to change view type of the listview (icons,list,details,...),
the first methode is to use the function SetWindowLong with GWL_STYLE,
the second methode is to use the message LVM_SETVIEW,
i noticed that the LVM_SETVIEW is applicable only in windows xp,but i have no problem i am writting the program to windows xp, my question is what is the best methode to chage the view type,
thank you in  advance.
Title: Re: ListView : types of view
Post by: zooba on December 01, 2007, 11:19:39 AM
Always send a specific message rather than use SetWindowLong if one is available. I can't remember where I saw this written but it was in MSDN somewhere.

The main reason is that SetWindowLong does not run any control-specific code that may be needed, especially if there is already data in the control. If there is a message that appears to do the same thing, there is probably a reason and you should use the message.

Cheers,

Zooba :U
Title: Re: ListView : types of view
Post by: ossama on December 01, 2007, 11:21:42 AM
thank you zooba for the information