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

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'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_J/97+CXC`49JU^I_1(5/H]1V:/8R?Z&MOM1JZ&U-XR*->G.QE5DO



MNNVZ:H+]5*58D3Q"R+?C\RJB=A`JE+X"'/$2DXD3.\'%=YUUT :F80[117QC
MXJN$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$<-!6;W/$HC+U2R/ RPM ED"?U+?B;,\_U&WHV1>

M,\S0&XBV'U\VS^O=:#A(\WD%_AA&LQ+*QT][*->[S<\XD`7S^V5PGP`U5O-D
M615!-H9R&=J!X>#K
MFM].L_C$7*H +*M\ 3YQ 8D8'X.'Y3%ARV2;_>%AL_Z=D=;$1;7RR]X$'8[1
M[*%<%<DB+RI,2YU 6>5!46#IR>4"PKR(DV(,0H$S#R5X6QW332,U-S;I3K4U

MO\Q/E;P%O:/O)A, L.;)%9B.6TA\F/"[AL.\9HS[5MOB"'K>]71$-S>!VUV;

MWSU'J TB!8&6'!'!Q%=[ EO0'*DX*7(\"!$"N,%$$I-;$;WQ9&HXG =2P3.8

MA:Y-0(2F102A "F=D%*0 364N#CZICAA1+Y%"E281_X*$R' IA:U;]B/6B`.


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


MP]]02P$"%``4````"``-4EXO!X5#JXL'``""(```"P`````````!`"`` ($`

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