15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


CPropertyPage Edit Control Problem

Karen Fura -- kfura@pop.seanet.com
Thursday, November 21, 1996

Environment: VC++ 4.0, Win95

I have a multiline edit control on a property page.  The
property sheet has multiple pages.  When this page with
the edit control receives focus, all the text is selected
(no text was previously selected.  I don't want this behavior.

Using Spy++ I can see the edit control receives a WM_GETDLGCODE 
message.  One of the flags that is set is DLGC_HASSETSEL.  The next 
message the edit control receives is EM_SETSEL with arguments
specifying all the text is to be selected. It seems to me that
the DLGC_HASSETSEL flag governs whether the EM_SETSEL message is 
set. Why is this happening?  I have not been able to understand 
how the DLGC_HASSETSEL flag is set.  I would appreciate any pointers.

I have MSDN.
Karen T. Fura
kfura@levetate.com
Levetate Design Systems
Seattle, WA




Edith Russo -- edith@accessone.com
Sunday, November 24, 1996

This doesn't answer your question but I'm assuming that it's the default 
behavior for Win95.  I don't like it either, so this is how I got around 
the problem, but I have a feeling you already knew this part:

I created a handler for the first control on the property page for the 
EN_SETFOCUS msg to change the selection to none:

( (CEdit*)GetDlgItem( IDC_OCCUPATION ) )->SetSel( 0, 0 );

----------
From: 	Karen Fura[SMTP:kfura@pop.seanet.com]
Sent: 	Thursday, November 21, 1996 2:57 PM
To: 	mfc-l@netcom.com
Subject: 	CPropertyPage Edit Control Problem

Environment: VC++ 4.0, Win95

I have a multiline edit control on a property page.  The
property sheet has multiple pages.  When this page with
the edit control receives focus, all the text is selected
(no text was previously selected.  I don't want this behavior.

Using Spy++ I can see the edit control receives a WM_GETDLGCODE
message.  One of the flags that is set is DLGC_HASSETSEL.  The next
message the edit control receives is EM_SETSEL with arguments
specifying all the text is to be selected. It seems to me that
the DLGC_HASSETSEL flag governs whether the EM_SETSEL message is
set. Why is this happening?  I have not been able to understand
how the DLGC_HASSETSEL flag is set.  I would appreciate any pointers.

I have MSDN.
Karen T. Fura
kfura@levetate.com
Levetate Design Systems
Seattle, WA





begin 600 WINMAIL.DAT
M>)\^(AL-`0:0" `$```````!``$``0>0!@`(````Y 0```````#H``$-@ 0`
M`@````(``@`!!) &``P!```!````# ````,``# #````"P`/#@`````"`?\/
M`0```#\`````````@2L?I+ZC$!F=;@#=`0]4`@````!M9F,M;$!N971C;VTN
M8V]M`%--5% `;69C+6Q ;F5T8V]M+F-O;0``'@`", $````%````4TU44 ``
M```>``,P`0```!$```!M9F,M;$!N971C;VTN8V]M``````,`%0P!`````P#^
M#P8````>``$P`0```!,````G;69C+6Q ;F5T8V]M+F-O;2<```(!"S !````
M%@```%--5% Z349#+4Q 3D540T]-+D-/30````,``#D`````"P! .@$````"
M`?8/`0````0````````#/RP!"( '`!@```!)4$TN36EC`!X,`0````4```!33510````
M`!X`'PP!````% ```&5D:71H0&%C8V5S)S=&5M`H,S=P+D!Q,"@'T*@ C/"=D[\18/,C4U`H *
M@0VQ"V#@;F0AA('$*4!/ (FD"("!B=05 22$1L1F1L1:&\'X"#09V\;H;$#8'5N9!ZS$U!O`F"_
M$^ B,!T3(O ?L![@82 `7PG@(5 =\1PQ&[!L%A!AX&1Y(&MN!]$B@PJQ_'0Z
M"H\:'"?E(- %`":@_Q/0(_ ED!& (^ DD!_T'L+\9FD1H 5 !: ", -@`R!K
M'.$D%7 $D'0FT"@09P,KX2N514Y?4T54D$9/0U4%\&US'@%_(F 1<1D0'N >
MPA&P))!C:QS#+[%N`B!E)]8GY2@1,H!#160><"HI1V$1P$1L9TD3T3*021A$
M0U\O("\P4$%4($E/3B I-- M/E4&8'0&8&PRD# B,# =-- [,;P*]"%0,3@P
MP0+1:2TQ-#0-\ S0\S@#"UDQ-B@``V 3T##0?" M.B("?E'L)9RQ808R'0
MQR5@!" "$&-UPA/0>!Y1!" PE F MS(F,6!BY'==@1-091_!
M_6(P;%SQ8X4@J63P`C B=#4?ABXQO%4`D!WQ4W#^>5;A*D$#D1&P,#1@KV&S
M(2605TU?1R[P1$Q@1T-/1$4IQ@>!0F-28R-L
MHE](0?93+N$NX$Q;M#%08P)M+/=J?V%H&Q%%;%!PM%^C(Y%69QW 0T%S)^5S
M+8!C_0:0>1WB8GXOL1^ 9=DSD/]J,B]P+Z('@!X37_EP/&[3[R-1)6 $H 0@
M=Q[0(?(N9/]TIW)&&Q%V%D#!7K$FT'@"NQL"$8!P+8 #`!D0/R"R_R5#,6 ?
M8C\1`:!>$2^Q(]'_!) 3P"L1*<8C`GK?>^5OE/4@HW<(8&PJP8" 87$',/<3
MT!NQ+<%O"X 3T!&@:#VS)24%X$1.:#8^Y%0@H/\_0B?E/^0DD"5@`9 3T$Q)
MSDR+U7 @!Y!I9P.@$Z2W=@8&8!Y ="205T%!,;Q?4O]4#U4<)^45,0"4$ ,`
M$! ``````P`1$ ````! ```#T``0``
/``4```!213H@`````(WT
`
end




Kevin Tarn -- kevin@earth.pln.com.tw
Tuesday, November 26, 1996

Did you change the tab order of the edit control in the property page ? If 
the edit control has the first tab order, then it will receive EM_SETSEL 
message when the property page get the focus.


Kevin Tarn
kevin@pln.com.tw

----------

Environment: VC++ 4.0, Win95

I have a multiline edit control on a property page.  The
property sheet has multiple pages.  When this page with
the edit control receives focus, all the text is selected
(no text was previously selected.  I don't want this behavior.

Using Spy++ I can see the edit control receives a WM_GETDLGCODE
message.  One of the flags that is set is DLGC_HASSETSEL.  The next
message the edit control receives is EM_SETSEL with arguments
specifying all the text is to be selected. It seems to me that
the DLGC_HASSETSEL flag governs whether the EM_SETSEL message is
set. Why is this happening?  I have not been able to understand
how the DLGC_HASSETSEL flag is set.  I would appreciate any pointers.

I have MSDN.
Karen T. Fura
kfura@levetate.com
Levetate Design Systems
Seattle, WA






| Вернуться в корень Архива |