www.digitalmars.com         C & C++   DMDScript  

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

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)

!!!Now full source is included!!! (see attachment)
//============================================
long tmp_gwl;

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

tmp_gwl=tmp_gwl & ~LVS_TYPEMASK;

/*trying to set new style*/
/*tmp_gwl=0x50000103=WS_VISIBLE | WS_CHILD | LVS_LIST | LVS_AUTOARRANGE*/
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!


begin 0644 testmars2.zip
M4$L#!!0````(``U27B\'A4.KBP<``(( ```+````=&5S=&UA<G,R+F/M6?MO
MVS80_KU`_P<BQ3(Y<>-75PQ)5<RQU42H9!N6'+<=!D&1&)N+'H$DQTFZ[&_?
MD13U\".)DZ[- !F.)9+'X]V1_+XC4ZO)C_N\?%&KH2X.2(S,*(RG)$#OYIA<
M_N;;Q-N+9N^9 #$[_1,[R3X:1.&IAWTT)\D4Q3A)2#!!&HF3$X+G*$ZN/1S3
M'JQ7)_0OB(>C?=0E$Y+8'M+M*$:=6F=W%_VZUWP;9**Q UX[*,%QXH-(<\]A
MM1X)SM%K8[0_5GO=_MC(!:K5ZCF.`NRUFKNS&$?PF+ $?IW0=Q*HK59S95%N
MTZ.C](H$CC=S,42'!&XXC_>F[XNU,"X,''FLFHYTY(6GX/&E'1'[E$7E6.T9
M9KO741!$.4X.0&J'.&$0H[,P`E_CY!*"^'.,B&]/,"WOU&BO3K^'Z&=*A1M5
M_FQ"]^-QKXMXD^C-E`9AY,/05`S9 8MB**7%3'5Y4#Z0WCY2--4P800A5BV\
M-YGRUYM_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=\$U6"#%D?16G';-U?YJ'VK/?5IN.<UEN":
M-44:23,U#74`L5"=),R"\LVM]YN+OKD0JA-'X\ALPW>M_>:Z79`'G2"^UOCF
MHAL0QQ:8LBYN!UN^L:X(4\<2Z^DTOC'D..22H\?8<4U;!&9\8YKCTNZ2SC'Q
M4831>[:R]HUI#HJ$$AS]DA%!? -F#F&**XZ#BHX9-B+,I*"V65,5-_.I<11I
MXS]V)GY_'/4ATOLZA4NH.0R2CDYDY3M]2O9K\ZU\_B7^%?/IY3JI<[UOIVMS
MK+;L<*S;`+MLXU5>M]X^7N;X-RYSS?'5!EW8V!67.9O)N\:?N<Q=NUC_7^;T
M>Y)V42<NZTW!9??"HL:`A[U+B:PO&+U\YY#6'Y8S-=!GOO-!;FJ+PEYM5`,(
MK_<1_U<>,-D^X4UM;MC[4-8>,+_+N>0$LWZ`G24_W^YPV#_ V&-G^5?6QMJ'
MP]]02P$"%``4````"``-4EXO!X5#JXL'``""(```"P`````````!`"`` ($`
M````=&5S=&UA<G,R+F-02P$"%``4````"`#74EXO*A8)Q+0"``"(! ``#0``
M`````````"`` (&T!P``=&5S=&UA<G,R+G)E<U!+`0(4`!0````(`%Q57B\5
MNCM'"00``'42```,``````````$`(`"` 9,*``!T97-T;6%R<S(N<F-02P4&
2``````,``P"N````Q X`````
`
end
Oct 29 2003
parent "Phill" <phill pacific.net.au> writes:
you can do all of this in Resource Studio very easily.

Phill.


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

 !!!Now full source is included!!! (see attachment)
 //============================================
 long tmp_gwl;

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

 tmp_gwl=tmp_gwl & ~LVS_TYPEMASK;

 /*trying to set new style*/
 /*tmp_gwl=0x50000103=WS_VISIBLE | WS_CHILD | LVS_LIST | LVS_AUTOARRANGE*/
 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!
Nov 29 2003