You are on page 1of 6

II-1

Learn Visual Basic 6.0

Appendix II. Common Dialog Box Constants


CommonDialog Control Constants
File Open/Sa e Dialog Box Flags Constant Value cdlOFNReadOnly 0x1 cdlOFNOver ri!e"ro#p! cdlOFN&ideReadOnly cdlOFNNoChange(ir cdlOFN&elp*%!!on cdlOFNNo+alida!e cdlOFNAllo ,%l!iselec! cdlOFN-x!ension(ifferen! 0x$ 0x' 0x) 0x10 0x100 0x$00 0x'00 Description Checks Read-Only check box for Open and Save As dialog boxes. Ca%ses !he Save As dialog box !o genera!e a #essage box if !he selec!ed file already exis!s. &ides !he Read-Only check box. Se!s !he c%rren! direc!ory !o ha! i! as hen !he dialog box as invoked. Ca%ses !he dialog box !o display !he &elp b%!!on. Allo s invalid charac!ers in !he re!%rned filena#e. Allo s !he File Na#e lis! box !o have #%l!iple selec!ions. .he ex!ension of !he re!%rned filena#e is differen! fro# !he ex!ension se! by !he (efa%l!-x! proper!y. /ser can en!er only valid pa!h na#es. /ser can en!er only na#es of exis!ing files. Se!s !he dialog box !o ask if !he %ser an!s !o crea!e a file !ha! doesn0! c%rren!ly exis!.

cdlOFN"a!h,%s!-xis! cdlOFNFile,%s!-xis! cdlOFNCrea!e"ro#p!

0x)00 0x1000 0x$000

II-2

Learn Visual Basic 6.0

File Open/Sa e Dialog Box Flags !continued" Constant Value Description cdlOFNShareA are 0x'000 Sharing viola!ion errors ill be ignored. cdlOFNNoReadOnlyRe!%rn 0x)000 .he re!%rned file doesn0! have !he Read-Only a!!rib%!e se! and on0! be in a ri!e-pro!ec!ed direc!ory. cdlOFN-xplorer 0x000)000 /se !he -xplorer-like Open A File dialog box !e#pla!e. 12indo s 34 only.5 cdlOFNNo(ereference6inks 0x00100000 (o no! dereference shor!c%!s 1shell links5 defa%l!7 choosing a shor!c%! ca%ses i! !o be dereferenced by !he shell. 12indo s 34 only.5 cdlOFN6ongNa#es 0x00$00000 /se 6ong filena#es. 12indo s 34 only.5 Color Dialog Box Flags Constant cdlCCR8*9ni! cdlCCF%llOpen cdlCC"reven!F%llOpen cdlCC&elp*%!!on Fonts Dialog Box Flags Constant cdlCFScreenFon!s cdlCF"rin!erFon!s cdlCF*o!h cdlCF&elp*%!!on cdlCF-ffec!s cdlCFApply cdlCFANS9Only cdlCFNo+ec!orFon!s Value 0x1 0x$ 0x' 0x) Value 0x1 0x$ 0x: 0x' 0x100 0x$00 0x'00 0x)00 Description Se!s ini!ial color val%e for !he dialog box. -n!ire dialog box is displayed7 incl%ding !he (efine C%s!o# Colors sec!ion. (isables !he (efine C%s!o# Colors sec!ion of !he dialog box. (ialog box displays a &elp b%!!on. Description (ialog box lis!s only screen fon!s s%ppor!ed by !he sys!e#. (ialog box lis!s only fon!s s%ppor!ed by !he prin!er. (ialog box lis!s available screen and prin!er fon!s. (ialog box displays a &elp b%!!on. (ialog box enables s!rikeo%!7 %nderline7 and color effec!s. (ialog box enables !he Apply b%!!on. (ialog box allo s only a selec!ion of fon!s !ha! %se !he 2indo s charac!er se!. (ialog box sho%ld no! allo vec!or-fon! selec!ions.

Common Dialog Box Constants


Fonts Dialog Box Flags !continued" Constant Value cdlCFNoSi#%la!ions 0x1000 cdlCF6i#i!Si;e cdlCFFixed"i!chOnly cdlCF2<S92<8 cdlCFForceFon!-xis! cdlCFScalableOnly cdlCF..Only cdlCFNoFaceSel cdlCFNoS!yleSel cdlCFNoSi;eSel #rinter Dialog Box Flags Constant cdl"(All"ages cdl"(Colla!e cdl"((isable"rin!.oFile cdl"(&ide"rin!.oFile cdl"(No"ageN%#s cdl"(NoSelec!ion cdl"(No2arning cdl"("ageN%#s cdl"("rin!Se!%p 0x$000 0x'000 0x)000 0x10000 0x$0000 0x'0000 0x)0000 0x100000 0x$00000 Value 0x0 0x10 0x)0000 0x100000 0x) 0x' 0x)0 0x$ 0x'0

II-3

Description (ialog box sho%ld no! allo graphic device in!erface 18(95 (ialog box sho%ld selec! only fon! si;es i!hin !he range specified by !he ,in and ,ax proper!ies. (ialog box sho%ld selec! only fixed-pi!ch fon!s. (ialog box sho%ld allo only !he selec!ion of fon!s available !o bo!h !he screen and prin!er. An error dialog box is displayed if a %ser selec!s a fon! or s!yle !ha! doesn0! exis!. (ialog box sho%ld allo only !he selec!ion of scalable fon!s. (ialog box sho%ld allo only !he selec!ion of .r%e.ype fon!s. No fon! na#e selec!ed. No fon! s!yle selec!ed. No fon! si;e selec!ed. Description Re!%rns or se!s s!a!e of All "ages op!ion b%!!on. Re!%rns or se!s s!a!e of Colla!e check box. (isables !he "rin! .o File check box. .he "rin! .o File check box isn0! displayed. Re!%rns or se!s !he s!a!e of !he "ages op!ion b%!!on. (isables !he Selec!ion op!ion b%!!on. "reven!s a arning #essage hen !here is no defa%l! prin!er. Re!%rns or se!s !he s!a!e of !he "ages op!ion b%!!on. (isplays !he "rin! Se!%p dialog box ra!her !han !he "rin! dialog box.

II-4

Learn Visual Basic 6.0


Description Re!%rns or se!s !he s!a!e of !he "rin! .o File check box. Re!%rns a device con!ex! for !he prin!er selec!ion val%e re!%rned in !he h(C proper!y of !he dialog box. Re!%rns defa%l! prin!er na#e. Re!%rns an infor#a!ion con!ex! for !he prin!er selec!ion val%e re!%rned in !he h(C proper!y of !he dialog box. Re!%rns or se!s !he s!a!e of !he Selec!ion op!ion b%!!on. (ialog box displays !he &elp b%!!on. Se!s s%ppor! for #%l!iple copies ac!ion= depends %pon he!her or no! prin!er s%ppor!s #%l!iple copies.

#rinter Dialog Box Flags !continued" Constant Value cdl"("rin!.oFile 0x$0 cdl"(Re!%rn(C 0x100

cdl"(Re!%rn(efa%l! cdl"(Re!%rn9C

0x'00 0x$00

cdl"(Selec!ion cdl"(&elp*%!!on cdl"(/se(ev,odeCopies

0x1 0x)00 0x'0000

Common Dialog Box Constants CommonDialog $rror Constants


Constant cdlAlloc cdlCancel cdl(ialogFail%re cdlFindResFail%re cdl&elp cdl9ni!iali;a!ion cdl6oadResFail%re cdl6ockResFail%re cdl,e#AllocFail%re cdl,e#6ockFail%re cdlNoFon!s cdl*%ffer.ooS#all cdl9nvalidFileNa#e cdlS%bclassFail%re cdlCrea!e9CFail%re cdl(nd#,is#a!ch cdl8e!(ev,odeFail cdl9ni!Fail%re cdl6oad(rvFail%re Value >&?FF0> >&?FF:> >&)000> >&?FF3> >&?F-F> >&?FF(> >&?FF)> >&?FF?> >&?FF@> >&?FF4> >&4FF-> >&'FFC> >&'FF(> >&'FF-> >&@FF4> >&@FF@> >&@FFA> >&@FF3> >&@FF*>

II-5

Description Co%ldn0! alloca!e #e#ory for FileNa#e or Fil!er proper!y. Cancel as selec!ed. .he f%nc!ion failed !o load !he dialog box. .he f%nc!ion failed !o load a specified reso%rce. Call !o 2indo s &elp failed. .he f%nc!ion failed d%ring ini!iali;a!ion. .he f%nc!ion failed !o load a specified s!ring. .he f%nc!ion failed !o lock a specified reso%rce. .he f%nc!ion as %nable !o alloca!e #e#ory for in!ernal da!a s!r%c!%res. .he f%nc!ion as %nable !o lock !he #e#ory associa!ed i!h a handle. No fon!s exis!. .he b%ffer a! hich !he #e#ber lps!rFile poin!s is !oo s#all. Filena#e is invalid. An a!!e#p! !o s%bclass a lis! box failed d%e !o ins%fficien! #e#ory. .he "rin!(lg f%nc!ion failed hen i! a!!e#p!ed !o crea!e an infor#a!ion con!ex!. (a!a in !he (ev,ode and (evNa#es da!a s!r%c!%res describe ! o differen! prin!ers. .he prin!er device driver failed !o ini!iali;e a (ev,ode da!a s!r%c!%re. .he "rin!(lg f%nc!ion failed d%ring ini!iali;a!ion. .he "rin!(lg f%nc!ion failed !o load !he specified prin!er0s device driver.

II-6

Learn Visual Basic 6.0

CommonDialog $rror Constants !continued"


Constant cdlNo(efa%l!"rn cdlNo(evices cdl"arseFail%re cdl"rin!erCodes cdl"rin!erNo!Fo%nd cdlRe!(efFail%re cdlSe!%pFail%re Value >&@FF?> >&@FF)>

>&@FF(> >&@FFF> >&@FF'> >&@FFC> >&@FF->

Description A defa%l! prin!er doesn0! exis!. No prin!er device drivers ere fo%nd. .he Co##on(ialog f%nc!ion failed !o parse !he s!rings in !he AdevicesB sec!ion of 29N.9N9. .he "(Re!%rn(efa%l! flag as se!7 b%! ei!her !he h(ev,ode or h(evNa#es field as non;ero. .he AdevicesB sec!ion of 29N.9N9 doesn0! con!ain an en!ry for !he reC%es!ed prin!er. .he "(Re!%rn(efa%l! flag as se!7 b%! ei!her !he h(ev,ode or h(evNa#es field as non;ero. Failed !o load reC%ired reso%rces.

You might also like