www.digitalmars.com         C & C++   DMDScript  

c++.windows.32-bits - Problem with setting ListView styles

reply Denis Troshin<weiv mail.ru> writes:
The following piece of code does not work on DMC:
(It works fine with other compilers - BCC 5.02, LCC-win32)

//============================================
long tmp_gwl;

/*getting current listview style*/
/*tmp_gwl=0x50000000=WS_VISIBLE | WS_CHILD | LVS_ICON*/
tmp_gwl=GetWindowLong(hlistview, GWL_STYLE);

tmp_gwl=tmp_gwl & ~LVS_TYPEMASK;

/*trying to set new style*/
/*tmp_gwl=0x50000003=WS_VISIBLE | WS_CHILD | LVS_LIST*/
tmp_gwl=tmp_gwl | LVS_LIST;
SetWindowLong(hlistview, GWL_STYLE, tmp_gwl);
//============================================
If I use GetWindowLong after these lines, it returns
the style I was trying to set,
but visually there will be no changes!
Oct 29 2003
next sibling parent "Walter" <walter digitalmars.com> writes:
If you could reproduce the problem in a standalone example, that would be
most helpful.

www.digitalmars.com/faq.html#error


"Denis Troshin" <weiv mail.ru> wrote in message
news:bnp9p1$1g1e$1 digitaldaemon.com...
 The following piece of code does not work on DMC:
 (It works fine with other compilers - BCC 5.02, LCC-win32)

 //============================================
 long tmp_gwl;

 /*getting current listview style*/
 /*tmp_gwl=0x50000000=WS_VISIBLE | WS_CHILD | LVS_ICON*/
 tmp_gwl=GetWindowLong(hlistview, GWL_STYLE);

 tmp_gwl=tmp_gwl & ~LVS_TYPEMASK;

 /*trying to set new style*/
 /*tmp_gwl=0x50000003=WS_VISIBLE | WS_CHILD | LVS_LIST*/
 tmp_gwl=tmp_gwl | LVS_LIST;
 SetWindowLong(hlistview, GWL_STYLE, tmp_gwl);
 //============================================
 If I use GetWindowLong after these lines, it returns
 the style I was trying to set,
 but visually there will be no changes!

Oct 29 2003
prev sibling parent Jan Knepper <jan smartsoft.us> writes:
Are you sure you have:

EXETYPE		NT
SUBSYSTEM	WINDOWS,4.0

In your .def file???

And is you .def file part of your link command line???



Denis Troshin wrote:
 The following piece of code does not work on DMC:
 (It works fine with other compilers - BCC 5.02, LCC-win32)
 
 //============================================
 long tmp_gwl;
 
 /*getting current listview style*/
 /*tmp_gwl=0x50000000=WS_VISIBLE | WS_CHILD | LVS_ICON*/
 tmp_gwl=GetWindowLong(hlistview, GWL_STYLE);
 
 tmp_gwl=tmp_gwl & ~LVS_TYPEMASK;
 
 /*trying to set new style*/
 /*tmp_gwl=0x50000003=WS_VISIBLE | WS_CHILD | LVS_LIST*/
 tmp_gwl=tmp_gwl | LVS_LIST;
 SetWindowLong(hlistview, GWL_STYLE, tmp_gwl);
 //============================================
 If I use GetWindowLong after these lines, it returns
 the style I was trying to set,
 but visually there will be no changes!
 
 

-- ManiaC++ Jan Knepper Smartsoft, LLC 88 Petersburg Road Petersburg, NJ 08270 U.S.A. http://www.smartsoft.us/ Phone : 609-628-4260 FAX : 609-628-1267 In God we Trust -- all others must submit an X.509 certificate. -- Charles Forsythe <forsythe alum.mit.edu>
Oct 29 2003