ShlObj.h 213 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313
  1. //===========================================================================
  2. //
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. //
  5. // File: shlobj.h
  6. //
  7. //===========================================================================
  8. #ifndef _SHLOBJ_H_
  9. #define _SHLOBJ_H_
  10. #ifndef _WINRESRC_
  11. #ifndef _WIN32_IE
  12. #define _WIN32_IE 0x0501
  13. #else
  14. #if (_WIN32_IE < 0x0400) && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0500)
  15. #error _WIN32_IE setting conflicts with _WIN32_WINNT setting
  16. #endif
  17. #endif
  18. #endif
  19. #ifndef SNDMSG
  20. #ifdef __cplusplus
  21. #define SNDMSG ::SendMessage
  22. #else
  23. #define SNDMSG SendMessage
  24. #endif
  25. #endif // ifndef SNDMSG
  26. //
  27. // Define API decoration for direct importing of DLL references.
  28. //
  29. #ifndef WINSHELLAPI
  30. #if defined(_SHELL32_)
  31. #define WINSHELLAPI
  32. #else
  33. #define WINSHELLAPI DECLSPEC_IMPORT
  34. #endif
  35. #endif // WINSHELLAPI
  36. #ifndef SHSTDAPI
  37. #if defined(_SHELL32_)
  38. #define SHSTDAPI STDAPI
  39. #define SHSTDAPI_(type) STDAPI_(type)
  40. #else
  41. #define SHSTDAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  42. #define SHSTDAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  43. #endif
  44. #endif // SHSTDAPI
  45. #ifndef SHDOCAPI
  46. #if defined(_SHDOCVW_)
  47. #define SHDOCAPI STDAPI
  48. #define SHDOCAPI_(type) STDAPI_(type)
  49. #else
  50. #define SHDOCAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  51. #define SHDOCAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  52. #endif
  53. #endif // SHDOCAPI
  54. // shell32 APIs that are also exported from shdocvw
  55. #ifndef SHSTDDOCAPI
  56. #if defined(_SHDOCVW_) || defined(_SHELL32_)
  57. #define SHSTDDOCAPI STDAPI
  58. #define SHSTDDOCAPI_(type) STDAPI_(type)
  59. #else
  60. #define SHSTDDOCAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  61. #define SHSTDDOCAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  62. #endif
  63. #endif // SHSTDDOCAPI
  64. #ifndef BROWSEUIAPI
  65. #if defined(_BROWSEUI_)
  66. #define BROWSEUIAPI STDAPI
  67. #define BROWSEUIAPI_(type) STDAPI_(type)
  68. #else
  69. #define BROWSEUIAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  70. #define BROWSEUIAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  71. #endif // defined(_BROWSEUI_)
  72. #endif // BROWSEUIAPI
  73. // shell32 APIs that are also exported from shfolder
  74. #ifndef SHFOLDERAPI
  75. #if defined(_SHFOLDER_) || defined(_SHELL32_)
  76. #define SHFOLDERAPI STDAPI
  77. #else
  78. #define SHFOLDERAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  79. #endif
  80. #endif
  81. #include <ole2.h>
  82. #ifndef _PRSHT_H_
  83. #include <prsht.h>
  84. #endif
  85. #ifndef _INC_COMMCTRL
  86. #include <commctrl.h> // for LPTBBUTTON
  87. #endif
  88. #ifndef INITGUID
  89. #include <shlguid.h>
  90. #endif /* !INITGUID */
  91. #include <pshpack1.h> /* Assume byte packing throughout */
  92. #ifdef __cplusplus
  93. extern "C" { /* Assume C declarations for C++ */
  94. #endif /* __cplusplus */
  95. #include <shtypes.h>
  96. #include <shobjidl.h>
  97. //===========================================================================
  98. //
  99. // Task allocator API
  100. //
  101. // All the shell extensions MUST use the task allocator (see OLE 2.0
  102. // programming guild for its definition) when they allocate or free
  103. // memory objects (mostly ITEMIDLIST) that are returned across any
  104. // shell interfaces. There are two ways to access the task allocator
  105. // from a shell extension depending on whether or not it is linked with
  106. // OLE32.DLL or not (purely for efficiency).
  107. //
  108. // (1) A shell extension which calls any OLE API (i.e., linked with
  109. // OLE32.DLL) should call OLE's task allocator (by retrieving
  110. // the task allocator by calling CoGetMalloc API).
  111. //
  112. // (2) A shell extension which does not call any OLE API (i.e., not linked
  113. // with OLE32.DLL) should call the shell task allocator API (defined
  114. // below), so that the shell can quickly loads it when OLE32.DLL is not
  115. // loaded by any application at that point.
  116. //
  117. // Notes:
  118. // In next version of Windowso release, SHGetMalloc will be replaced by
  119. // the following macro.
  120. //
  121. // #define SHGetMalloc(ppmem) CoGetMalloc(MEMCTX_TASK, ppmem)
  122. //
  123. //===========================================================================
  124. SHSTDAPI SHGetMalloc(LPMALLOC * ppMalloc);
  125. #if (_WIN32_IE >= 0x0601)
  126. SHSTDAPI_(void *) SHAlloc(SIZE_T cb);
  127. SHSTDAPI_(void) SHFree(void * pv);
  128. #endif // (_WIN32_IE >= 0x0601)
  129. //===========================================================================
  130. //
  131. // IContextMenu interface
  132. //
  133. // [OverView]
  134. //
  135. // The shell uses the IContextMenu interface in following three cases.
  136. //
  137. // case-1: The shell is loading context menu extensions.
  138. //
  139. // When the user clicks the right mouse button on an item within the shell's
  140. // name space (i.g., file, directory, server, work-group, etc.), it creates
  141. // the default context menu for its type, then loads context menu extensions
  142. // that are registered for that type (and its base type) so that they can
  143. // add extra menu items. Those context menu extensions are registered at
  144. // HKCR\{ProgID}\shellex\ContextMenuHandlers.
  145. //
  146. // case-2: The shell is retrieving a context menu of sub-folders in extended
  147. // name-space.
  148. //
  149. // When the explorer's name space is extended by name space extensions,
  150. // the shell calls their IShellFolder::GetUIObjectOf to get the IContextMenu
  151. // objects when it creates context menus for folders under those extended
  152. // name spaces.
  153. //
  154. // case-3: The shell is loading non-default drag and drop handler for directories.
  155. //
  156. // When the user performed a non-default drag and drop onto one of file
  157. // system folders (i.e., directories), it loads shell extensions that are
  158. // registered at HKCR\{ProgID}\DragDropHandlers.
  159. //
  160. //
  161. // [Member functions]
  162. //
  163. //
  164. // IContextMenu::QueryContextMenu
  165. //
  166. // This member function may insert one or more menuitems to the specified
  167. // menu (hmenu) at the specified location (indexMenu which is never be -1).
  168. // The IDs of those menuitem must be in the specified range (idCmdFirst and
  169. // idCmdLast). It returns the maximum menuitem ID offset (ushort) in the
  170. // 'code' field (low word) of the scode.
  171. //
  172. // The uFlags specify the context. It may have one or more of following
  173. // flags.
  174. //
  175. // CMF_DEFAULTONLY: This flag is passed if the user is invoking the default
  176. // action (typically by double-clicking, case 1 and 2 only). Context menu
  177. // extensions (case 1) should not add any menu items, and returns NOERROR.
  178. //
  179. // CMF_VERBSONLY: The explorer passes this flag if it is constructing
  180. // a context menu for a short-cut object (case 1 and case 2 only). If this
  181. // flag is passed, it should not add any menu-items that is not appropriate
  182. // from a short-cut.
  183. // A good example is the "Delete" menuitem, which confuses the user
  184. // because it is not clear whether it deletes the link source item or the
  185. // link itself.
  186. //
  187. // CMF_EXPLORER: The explorer passes this flag if it has the left-side pane
  188. // (case 1 and 2 only). Context menu extensions should ignore this flag.
  189. //
  190. // High word (16-bit) are reserved for context specific communications
  191. // and the rest of flags (13-bit) are reserved by the system.
  192. //
  193. //
  194. // IContextMenu::InvokeCommand
  195. //
  196. // This member is called when the user has selected one of menuitems that
  197. // are inserted by previous QueryContextMenu member. In this case, the
  198. // LOWORD(lpici->lpVerb) contains the menuitem ID offset (menuitem ID -
  199. // idCmdFirst).
  200. //
  201. // This member function may also be called programmatically. In such a case,
  202. // lpici->lpVerb specifies the canonical name of the command to be invoked,
  203. // which is typically retrieved by GetCommandString member previously.
  204. //
  205. // Parameters in lpci:
  206. // cbSize -- Specifies the size of this structure (sizeof(*lpci))
  207. // hwnd -- Specifies the owner window for any message/dialog box.
  208. // fMask -- Specifies whether or not dwHotkey/hIcon paramter is valid.
  209. // lpVerb -- Specifies the command to be invoked.
  210. // lpParameters -- Parameters (optional)
  211. // lpDirectory -- Working directory (optional)
  212. // nShow -- Specifies the flag to be passed to ShowWindow (SW_*).
  213. // dwHotKey -- Hot key to be assigned to the app after invoked (optional).
  214. // hIcon -- Specifies the icon (optional).
  215. // hMonitor -- Specifies the default monitor (optional).
  216. //
  217. //
  218. // IContextMenu::GetCommandString
  219. //
  220. // This member function is called by the explorer either to get the
  221. // canonical (language independent) command name (uFlags == GCS_VERB) or
  222. // the help text ((uFlags & GCS_HELPTEXT) != 0) for the specified command.
  223. // The retrieved canonical string may be passed to its InvokeCommand
  224. // member function to invoke a command programmatically. The explorer
  225. // displays the help texts in its status bar; therefore, the length of
  226. // the help text should be reasonably short (<40 characters).
  227. //
  228. // Parameters:
  229. // idCmd -- Specifies menuitem ID offset (from idCmdFirst)
  230. // uFlags -- Either GCS_VERB or GCS_HELPTEXT
  231. // pwReserved -- Reserved (must pass NULL when calling, must ignore when called)
  232. // pszName -- Specifies the string buffer.
  233. // cchMax -- Specifies the size of the string buffer.
  234. //
  235. //===========================================================================
  236. // QueryContextMenu uFlags
  237. #define CMF_NORMAL 0x00000000
  238. #define CMF_DEFAULTONLY 0x00000001
  239. #define CMF_VERBSONLY 0x00000002
  240. #define CMF_EXPLORE 0x00000004
  241. #define CMF_NOVERBS 0x00000008
  242. #define CMF_CANRENAME 0x00000010
  243. #define CMF_NODEFAULT 0x00000020
  244. #define CMF_INCLUDESTATIC 0x00000040
  245. #define CMF_EXTENDEDVERBS 0x00000100 // rarely used verbs
  246. #define CMF_RESERVED 0xffff0000 // View specific
  247. // GetCommandString uFlags
  248. #define GCS_VERBA 0x00000000 // canonical verb
  249. #define GCS_HELPTEXTA 0x00000001 // help text (for status bar)
  250. #define GCS_VALIDATEA 0x00000002 // validate command exists
  251. #define GCS_VERBW 0x00000004 // canonical verb (unicode)
  252. #define GCS_HELPTEXTW 0x00000005 // help text (unicode version)
  253. #define GCS_VALIDATEW 0x00000006 // validate command exists (unicode)
  254. #define GCS_UNICODE 0x00000004 // for bit testing - Unicode string
  255. #ifdef UNICODE
  256. #define GCS_VERB GCS_VERBW
  257. #define GCS_HELPTEXT GCS_HELPTEXTW
  258. #define GCS_VALIDATE GCS_VALIDATEW
  259. #else
  260. #define GCS_VERB GCS_VERBA
  261. #define GCS_HELPTEXT GCS_HELPTEXTA
  262. #define GCS_VALIDATE GCS_VALIDATEA
  263. #endif
  264. #define CMDSTR_NEWFOLDERA "NewFolder"
  265. #define CMDSTR_VIEWLISTA "ViewList"
  266. #define CMDSTR_VIEWDETAILSA "ViewDetails"
  267. #define CMDSTR_NEWFOLDERW L"NewFolder"
  268. #define CMDSTR_VIEWLISTW L"ViewList"
  269. #define CMDSTR_VIEWDETAILSW L"ViewDetails"
  270. #ifdef UNICODE
  271. #define CMDSTR_NEWFOLDER CMDSTR_NEWFOLDERW
  272. #define CMDSTR_VIEWLIST CMDSTR_VIEWLISTW
  273. #define CMDSTR_VIEWDETAILS CMDSTR_VIEWDETAILSW
  274. #else
  275. #define CMDSTR_NEWFOLDER CMDSTR_NEWFOLDERA
  276. #define CMDSTR_VIEWLIST CMDSTR_VIEWLISTA
  277. #define CMDSTR_VIEWDETAILS CMDSTR_VIEWDETAILSA
  278. #endif
  279. #define CMIC_MASK_HOTKEY SEE_MASK_HOTKEY
  280. #define CMIC_MASK_ICON SEE_MASK_ICON
  281. #define CMIC_MASK_FLAG_NO_UI SEE_MASK_FLAG_NO_UI
  282. #define CMIC_MASK_UNICODE SEE_MASK_UNICODE
  283. #define CMIC_MASK_NO_CONSOLE SEE_MASK_NO_CONSOLE
  284. #define CMIC_MASK_HASLINKNAME SEE_MASK_HASLINKNAME
  285. #define CMIC_MASK_FLAG_SEP_VDM SEE_MASK_FLAG_SEPVDM
  286. #define CMIC_MASK_HASTITLE SEE_MASK_HASTITLE
  287. #define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK
  288. #if (_WIN32_IE >= 0x0603)
  289. #define CMIC_MASK_NOZONECHECKS SEE_MASK_NOZONECHECKS
  290. #endif // (_WIN32_IE >= 0x0603)
  291. #if (_WIN32_IE >= 0x0501)
  292. #define CMIC_MASK_SHIFT_DOWN 0x10000000
  293. #define CMIC_MASK_CONTROL_DOWN 0x40000000
  294. #endif // (_WIN32_IE >= 0x501)
  295. #if (_WIN32_IE >= 0x0560)
  296. #define CMIC_MASK_FLAG_LOG_USAGE SEE_MASK_FLAG_LOG_USAGE
  297. #define CMIC_MASK_NOZONECHECKS SEE_MASK_NOZONECHECKS
  298. #endif // (_WIN32_IE >= 0x560)
  299. #if (_WIN32_IE >= 0x0400)
  300. #define CMIC_MASK_PTINVOKE 0x20000000
  301. #endif
  302. #include <pshpack8.h>
  303. //NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor
  304. typedef struct _CMINVOKECOMMANDINFO {
  305. DWORD cbSize; // sizeof(CMINVOKECOMMANDINFO)
  306. DWORD fMask; // any combination of CMIC_MASK_*
  307. HWND hwnd; // might be NULL (indicating no owner window)
  308. LPCSTR lpVerb; // either a string or MAKEINTRESOURCE(idOffset)
  309. LPCSTR lpParameters; // might be NULL (indicating no parameter)
  310. LPCSTR lpDirectory; // might be NULL (indicating no specific directory)
  311. int nShow; // one of SW_ values for ShowWindow() API
  312. DWORD dwHotKey;
  313. HANDLE hIcon;
  314. } CMINVOKECOMMANDINFO, *LPCMINVOKECOMMANDINFO;
  315. typedef struct _CMInvokeCommandInfoEx {
  316. DWORD cbSize; // must be sizeof(CMINVOKECOMMANDINFOEX)
  317. DWORD fMask; // any combination of CMIC_MASK_*
  318. HWND hwnd; // might be NULL (indicating no owner window)
  319. LPCSTR lpVerb; // either a string or MAKEINTRESOURCE(idOffset)
  320. LPCSTR lpParameters; // might be NULL (indicating no parameter)
  321. LPCSTR lpDirectory; // might be NULL (indicating no specific directory)
  322. int nShow; // one of SW_ values for ShowWindow() API
  323. DWORD dwHotKey;
  324. HANDLE hIcon;
  325. LPCSTR lpTitle; // For CreateProcess-StartupInfo.lpTitle
  326. LPCWSTR lpVerbW; // Unicode verb (for those who can use it)
  327. LPCWSTR lpParametersW; // Unicode parameters (for those who can use it)
  328. LPCWSTR lpDirectoryW; // Unicode directory (for those who can use it)
  329. LPCWSTR lpTitleW; // Unicode title (for those who can use it)
  330. #if (_WIN32_IE >= 0x0400)
  331. POINT ptInvoke; // Point where it's invoked
  332. #endif
  333. } CMINVOKECOMMANDINFOEX, *LPCMINVOKECOMMANDINFOEX;
  334. #include <poppack.h> /* Return to byte packing */
  335. #undef INTERFACE
  336. #define INTERFACE IContextMenu
  337. DECLARE_INTERFACE_(IContextMenu, IUnknown)
  338. {
  339. // *** IUnknown methods ***
  340. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  341. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  342. STDMETHOD_(ULONG,Release) (THIS) PURE;
  343. STDMETHOD(QueryContextMenu)(THIS_
  344. HMENU hmenu,
  345. UINT indexMenu,
  346. UINT idCmdFirst,
  347. UINT idCmdLast,
  348. UINT uFlags) PURE;
  349. STDMETHOD(InvokeCommand)(THIS_
  350. LPCMINVOKECOMMANDINFO lpici) PURE;
  351. STDMETHOD(GetCommandString)(THIS_
  352. UINT_PTR idCmd,
  353. UINT uType,
  354. UINT * pwReserved,
  355. LPSTR pszName,
  356. UINT cchMax) PURE;
  357. };
  358. typedef IContextMenu * LPCONTEXTMENU;
  359. //
  360. // IContextMenu2 (IContextMenu with one new member)
  361. //
  362. // IContextMenu2::HandleMenuMsg
  363. //
  364. // This function is called, if the client of IContextMenu is aware of
  365. // IContextMenu2 interface and receives one of following messages while
  366. // it is calling TrackPopupMenu (in the window proc of hwnd):
  367. // WM_INITPOPUP, WM_DRAWITEM and WM_MEASUREITEM
  368. // The callee may handle these messages to draw owner draw menuitems.
  369. //
  370. #undef INTERFACE
  371. #define INTERFACE IContextMenu2
  372. DECLARE_INTERFACE_(IContextMenu2, IContextMenu)
  373. {
  374. // *** IUnknown methods ***
  375. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  376. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  377. STDMETHOD_(ULONG,Release) (THIS) PURE;
  378. // *** IContextMenu methods ***
  379. STDMETHOD(QueryContextMenu)(THIS_
  380. HMENU hmenu,
  381. UINT indexMenu,
  382. UINT idCmdFirst,
  383. UINT idCmdLast,
  384. UINT uFlags) PURE;
  385. STDMETHOD(InvokeCommand)(THIS_
  386. LPCMINVOKECOMMANDINFO lpici) PURE;
  387. STDMETHOD(GetCommandString)(THIS_
  388. UINT_PTR idCmd,
  389. UINT uType,
  390. UINT * pwReserved,
  391. LPSTR pszName,
  392. UINT cchMax) PURE;
  393. // *** IContextMenu2 methods ***
  394. STDMETHOD(HandleMenuMsg)(THIS_
  395. UINT uMsg,
  396. WPARAM wParam,
  397. LPARAM lParam) PURE;
  398. };
  399. typedef IContextMenu2 * LPCONTEXTMENU2;
  400. //
  401. // IContextMenu3 (IContextMenu with one new member)
  402. //
  403. // IContextMenu3::HandleMenuMsg2
  404. //
  405. // This function is called, if the client of IContextMenu is aware of
  406. // IContextMenu3 interface and receives a menu message while
  407. // it is calling TrackPopupMenu (in the window proc of hwnd):
  408. //
  409. #undef INTERFACE
  410. #define INTERFACE IContextMenu3
  411. DECLARE_INTERFACE_(IContextMenu3, IContextMenu2)
  412. {
  413. // *** IUnknown methods ***
  414. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  415. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  416. STDMETHOD_(ULONG,Release) (THIS) PURE;
  417. // *** IContextMenu methods ***
  418. STDMETHOD(QueryContextMenu)(THIS_
  419. HMENU hmenu,
  420. UINT indexMenu,
  421. UINT idCmdFirst,
  422. UINT idCmdLast,
  423. UINT uFlags) PURE;
  424. STDMETHOD(InvokeCommand)(THIS_
  425. LPCMINVOKECOMMANDINFO lpici) PURE;
  426. STDMETHOD(GetCommandString)(THIS_
  427. UINT_PTR idCmd,
  428. UINT uType,
  429. UINT * pwReserved,
  430. LPSTR pszName,
  431. UINT cchMax) PURE;
  432. // *** IContextMenu2 methods ***
  433. STDMETHOD(HandleMenuMsg)(THIS_
  434. UINT uMsg,
  435. WPARAM wParam,
  436. LPARAM lParam) PURE;
  437. // *** IContextMenu3 methods ***
  438. STDMETHOD(HandleMenuMsg2)(THIS_
  439. UINT uMsg,
  440. WPARAM wParam,
  441. LPARAM lParam,
  442. LRESULT* plResult) PURE;
  443. };
  444. typedef IContextMenu3 * LPCONTEXTMENU3;
  445. #if (_WIN32_IE >= 0x0500)
  446. #undef INTERFACE
  447. #define INTERFACE IPersistFolder3
  448. #define CSIDL_FLAG_PFTI_TRACKTARGET CSIDL_FLAG_DONT_VERIFY
  449. // DESCRIPTION: PERSIST_FOLDER_TARGET_INFO
  450. // This stucture is used for Folder Shortcuts which allow the shell to
  451. // have a file system folder act like another area in the name space.
  452. // One of pidlTargetFolder, szTargetParsingName, or csidl needs to
  453. // specify the destination name space.
  454. //
  455. // pidlTargetFolder: This is a full pidl to the target folder. Can be NULL in the IPersistFolder3::InitializeEx()
  456. // call but not in the GetFolderTargetInfo() return structure.
  457. // szTargetParsingName: Empty string if not specified. Ortherwise, it is the parsible name
  458. // to the target. This name can be parsed by IShellFolder::
  459. // ParsedName() from the desktop.
  460. // szNetworkProvider: Can be an empty string. If not empty, it specifies the type of network
  461. // provider that will be used when binding to the target. This is used
  462. // for performance optimizations for the WNet APIs.
  463. // dwAttributes: -1 if not known. These are the SFGAO_ flags for IShellFolder::GetAttributesOf()
  464. // csidl: This is -1 if it's not used. This can be used instead of pidlTargetFolder or
  465. // szTargetParsingName to indicate the TargetFolder. See the list of CSIDL_ folders
  466. // below. CSIDL_FLAG_PFTI_TRACKTARGET means that the IShellFolder's target folder
  467. // should change if the user changes the target of the underlying CSIDL value.
  468. // You can also pass CSIDL_FLAG_CREATE to indicate that the target folder
  469. // should be created if it does not exist. No other CSIDL_FLAG_* values are supported.
  470. #include <pshpack8.h>
  471. typedef struct
  472. {
  473. LPITEMIDLIST pidlTargetFolder; // pidl for the folder we want to intiailize
  474. WCHAR szTargetParsingName[MAX_PATH]; // optional parsing name for the target
  475. WCHAR szNetworkProvider[MAX_PATH]; // optional network provider
  476. DWORD dwAttributes; // optional FILE_ATTRIBUTES_ flags (-1 if not used)
  477. int csidl; // optional folder index (SHGetFolderPath()) -1 if not used
  478. } PERSIST_FOLDER_TARGET_INFO;
  479. #include <poppack.h> /* Return to byte packing */
  480. // DESCRIPTION: IPersistFolder3
  481. // This interface is implemented by an IShellFolder object that wants non-default
  482. // handling of Folder Shortcuts. In general, shell name space extensions should use
  483. // pidlRoot (the alias pidl) as their location in the name space and pass it to public
  484. // APIs, such as ShellExecute(). The one exception is that pidlTarget should be used
  485. // when sending ChangeNotifies or registering to listen for change notifies
  486. // (see SFVM_GETNOTIFY).
  487. //
  488. // InitializeEx: This method initializes an IShellFolder and specifies where
  489. // it is rooted in the name space.
  490. // pbc: May be NULL.
  491. // pidlRoot: This is the same parameter as IPersistFolder::Initialize(). Caller allocates
  492. // and frees this parameter.
  493. // ppfti: May be NULL, in which case this is the same as a call to IPersistFolder::Initialize().
  494. // Otherwise this is a Folder Shortcut and this structure specifies the target
  495. // folder and it's attributes.
  496. // GetFolderTargetInfo: This is used by the caller to find information about
  497. // the folder shortcut. This structure may not be initialized by the caller,
  498. // so the callee needs to initialize every member. The callee allocates
  499. // pidlTargetFolder and the caller will free it. Filling in pidlTargetFolder is
  500. // ALWAYS required.
  501. DECLARE_INTERFACE_(IPersistFolder3, IPersistFolder2)
  502. {
  503. // *** IUnknown methods ***
  504. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  505. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  506. STDMETHOD_(ULONG,Release)(THIS) PURE;
  507. // *** IPersist methods ***
  508. STDMETHOD(GetClassID)(THIS_ LPCLSID lpClassID) PURE;
  509. // *** IPersistFolder methods ***
  510. STDMETHOD(Initialize)(THIS_ LPCITEMIDLIST pidl) PURE;
  511. // *** IPersistFolder2 methods ***
  512. STDMETHOD(GetCurFolder)(THIS_ LPITEMIDLIST *ppidl) PURE;
  513. // *** IPersistFolder3 methods ***
  514. STDMETHOD(InitializeEx)(THIS_ IBindCtx *pbc, LPCITEMIDLIST pidlRoot, const PERSIST_FOLDER_TARGET_INFO *ppfti) PURE;
  515. STDMETHOD(GetFolderTargetInfo)(THIS_ PERSIST_FOLDER_TARGET_INFO *ppfti) PURE;
  516. };
  517. #endif
  518. //
  519. //===========================================================================
  520. //
  521. // IExtractIcon interface
  522. //
  523. // This interface is used in two different places in the shell.
  524. //
  525. // Case-1: Icons of sub-folders for the scope-pane of the explorer.
  526. //
  527. // It is used by the explorer to get the "icon location" of
  528. // sub-folders from each shell folders. When the user expands a folder
  529. // in the scope pane of the explorer, the explorer does following:
  530. // (1) binds to the folder (gets IShellFolder),
  531. // (2) enumerates its sub-folders by calling its EnumObjects member,
  532. // (3) calls its GetUIObjectOf member to get IExtractIcon interface
  533. // for each sub-folders.
  534. // In this case, the explorer uses only IExtractIcon::GetIconLocation
  535. // member to get the location of the appropriate icon. An icon location
  536. // always consists of a file name (typically DLL or EXE) and either an icon
  537. // resource or an icon index.
  538. //
  539. //
  540. // Case-2: Extracting an icon image from a file
  541. //
  542. // It is used by the shell when it extracts an icon image
  543. // from a file. When the shell is extracting an icon from a file,
  544. // it does following:
  545. // (1) creates the icon extraction handler object (by getting its CLSID
  546. // under the {ProgID}\shell\ExtractIconHanler key and calling
  547. // CoCreateInstance requesting for IExtractIcon interface).
  548. // (2) Calls IExtractIcon::GetIconLocation.
  549. // (3) Then, calls IExtractIcon::ExtractIcon with the location/index pair.
  550. // (4) If (3) returns NOERROR, it uses the returned icon.
  551. // (5) Otherwise, it recursively calls this logic with new location
  552. // assuming that the location string contains a fully qualified path name.
  553. //
  554. // From extension programmer's point of view, there are only two cases
  555. // where they provide implementations of IExtractIcon:
  556. // Case-1) providing explorer extensions (i.e., IShellFolder).
  557. // Case-2) providing per-instance icons for some types of files.
  558. //
  559. // Because Case-1 is described above, we'll explain only Case-2 here.
  560. //
  561. // When the shell is about display an icon for a file, it does following:
  562. // (1) Finds its ProgID and ClassID.
  563. // (2) If the file has a ClassID, it gets the icon location string from the
  564. // "DefaultIcon" key under it. The string indicates either per-class
  565. // icon (e.g., "FOOBAR.DLL,2") or per-instance icon (e.g., "%1,1").
  566. // (3) If a per-instance icon is specified, the shell creates an icon
  567. // extraction handler object for it, and extracts the icon from it
  568. // (which is described above).
  569. //
  570. // It is important to note that the shell calls IExtractIcon::GetIconLocation
  571. // first, then calls IExtractIcon::Extract. Most application programs
  572. // that support per-instance icons will probably store an icon location
  573. // (DLL/EXE name and index/id) rather than an icon image in each file.
  574. // In those cases, a programmer needs to implement only the GetIconLocation
  575. // member and it Extract member simply returns S_FALSE. They need to
  576. // implement Extract member only if they decided to store the icon images
  577. // within files themselved or some other database (which is very rare).
  578. //
  579. //
  580. //
  581. // [Member functions]
  582. //
  583. //
  584. // IExtractIcon::GetIconLocation
  585. //
  586. // This function returns an icon location.
  587. //
  588. // Parameters:
  589. // uFlags [in] -- Specifies if it is opened or not (GIL_OPENICON or 0)
  590. // szIconFile [out] -- Specifies the string buffer buffer for a location name.
  591. // cchMax [in] -- Specifies the size of szIconFile (almost always MAX_PATH)
  592. // piIndex [out] -- Sepcifies the address of UINT for the index.
  593. // pwFlags [out] -- Returns GIL_* flags
  594. // Returns:
  595. // NOERROR, if it returns a valid location; S_FALSE, if the shell use a
  596. // default icon.
  597. //
  598. // Notes: The location may or may not be a path to a file. The caller can
  599. // not assume anything unless the subsequent Extract member call returns
  600. // S_FALSE.
  601. //
  602. // if the returned location is not a path to a file, GIL_NOTFILENAME should
  603. // be set in the returned flags.
  604. //
  605. // IExtractIcon::Extract
  606. //
  607. // This function extracts an icon image from a specified file.
  608. //
  609. // Parameters:
  610. // pszFile [in] -- Specifies the icon location (typically a path to a file).
  611. // nIconIndex [in] -- Specifies the icon index.
  612. // phiconLarge [out] -- Specifies the HICON variable for large icon.
  613. // phiconSmall [out] -- Specifies the HICON variable for small icon.
  614. // nIconSize [in] -- Specifies the size icon required (size of large icon)
  615. // LOWORD is the requested large icon size
  616. // HIWORD is the requested small icon size
  617. // Returns:
  618. // NOERROR, if it extracted the from the file.
  619. // S_FALSE, if the caller should extract from the file specified in the
  620. // location.
  621. //
  622. //===========================================================================
  623. // GetIconLocation() input flags
  624. #define GIL_OPENICON 0x0001 // allows containers to specify an "open" look
  625. #define GIL_FORSHELL 0x0002 // icon is to be displayed in a ShellFolder
  626. #define GIL_ASYNC 0x0020 // this is an async extract, return E_PENDING
  627. #define GIL_DEFAULTICON 0x0040 // get the default icon location if the final one takes too long to get
  628. #define GIL_FORSHORTCUT 0x0080 // the icon is for a shortcut to the object
  629. // GetIconLocation() return flags
  630. #define GIL_SIMULATEDOC 0x0001 // simulate this document icon for this
  631. #define GIL_PERINSTANCE 0x0002 // icons from this class are per instance (each file has its own)
  632. #define GIL_PERCLASS 0x0004 // icons from this class per class (shared for all files of this type)
  633. #define GIL_NOTFILENAME 0x0008 // location is not a filename, must call ::ExtractIcon
  634. #define GIL_DONTCACHE 0x0010 // this icon should not be cached
  635. #undef INTERFACE
  636. #define INTERFACE IExtractIconA
  637. DECLARE_INTERFACE_(IExtractIconA, IUnknown) // exic
  638. {
  639. // *** IUnknown methods ***
  640. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  641. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  642. STDMETHOD_(ULONG,Release) (THIS) PURE;
  643. // *** IExtractIcon methods ***
  644. STDMETHOD(GetIconLocation)(THIS_
  645. UINT uFlags,
  646. LPSTR szIconFile,
  647. UINT cchMax,
  648. int * piIndex,
  649. UINT * pwFlags) PURE;
  650. STDMETHOD(Extract)(THIS_
  651. LPCSTR pszFile,
  652. UINT nIconIndex,
  653. HICON *phiconLarge,
  654. HICON *phiconSmall,
  655. UINT nIconSize) PURE;
  656. };
  657. typedef IExtractIconA * LPEXTRACTICONA;
  658. #undef INTERFACE
  659. #define INTERFACE IExtractIconW
  660. DECLARE_INTERFACE_(IExtractIconW, IUnknown) // exic
  661. {
  662. // *** IUnknown methods ***
  663. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  664. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  665. STDMETHOD_(ULONG,Release) (THIS) PURE;
  666. // *** IExtractIcon methods ***
  667. STDMETHOD(GetIconLocation)(THIS_
  668. UINT uFlags,
  669. LPWSTR szIconFile,
  670. UINT cchMax,
  671. int * piIndex,
  672. UINT * pwFlags) PURE;
  673. STDMETHOD(Extract)(THIS_
  674. LPCWSTR pszFile,
  675. UINT nIconIndex,
  676. HICON *phiconLarge,
  677. HICON *phiconSmall,
  678. UINT nIconSize) PURE;
  679. };
  680. typedef IExtractIconW * LPEXTRACTICONW;
  681. #ifdef UNICODE
  682. #define IExtractIcon IExtractIconW
  683. #define IExtractIconVtbl IExtractIconWVtbl
  684. #define LPEXTRACTICON LPEXTRACTICONW
  685. #else
  686. #define IExtractIcon IExtractIconA
  687. #define IExtractIconVtbl IExtractIconAVtbl
  688. #define LPEXTRACTICON LPEXTRACTICONA
  689. #endif
  690. //===========================================================================
  691. //
  692. // IShellIcon Interface
  693. //
  694. // used to get a icon index for a IShellFolder object.
  695. //
  696. // this interface can be implemented by a IShellFolder, as a quick way to
  697. // return the icon for a object in the folder.
  698. //
  699. // a instance of this interface is only created once for the folder, unlike
  700. // IExtractIcon witch is created once for each object.
  701. //
  702. // if a ShellFolder does not implement this interface, the standard
  703. // GetUIObject(....IExtractIcon) method will be used to get a icon
  704. // for all objects.
  705. //
  706. // the following standard imagelist indexs can be returned:
  707. //
  708. // 0 document (blank page) (not associated)
  709. // 1 document (with stuff on the page)
  710. // 2 application (exe, com, bat)
  711. // 3 folder (plain)
  712. // 4 folder (open)
  713. //
  714. // IShellIcon:GetIconOf(pidl, flags, lpIconIndex)
  715. //
  716. // pidl object to get icon for.
  717. // flags GIL_* input flags (GIL_OPEN, ...)
  718. // lpIconIndex place to return icon index.
  719. //
  720. // returns:
  721. // NOERROR, if lpIconIndex contains the correct system imagelist index.
  722. // S_FALSE, if unable to get icon for this object, go through
  723. // GetUIObject, IExtractIcon, methods.
  724. //
  725. //===========================================================================
  726. #undef INTERFACE
  727. #define INTERFACE IShellIcon
  728. DECLARE_INTERFACE_(IShellIcon, IUnknown) // shi
  729. {
  730. // *** IUnknown methods ***
  731. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  732. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  733. STDMETHOD_(ULONG,Release) (THIS) PURE;
  734. // *** IShellIcon methods ***
  735. STDMETHOD(GetIconOf)(THIS_ LPCITEMIDLIST pidl, UINT flags,
  736. LPINT lpIconIndex) PURE;
  737. };
  738. typedef IShellIcon *LPSHELLICON;
  739. //===========================================================================
  740. //
  741. // IShellIconOverlayIdentifier
  742. //
  743. // Used to identify a file as a member of the group of files that have this specific
  744. // icon overlay
  745. //
  746. // Users can create new IconOverlayIdentifiers and place them in the following registry
  747. // location together with the Icon overlay image and their priority.
  748. // HKEY_LOCAL_MACHINE "Software\\Microsoft\\Windows\\CurrentVersion\\ShellIconOverlayIdentifiers"
  749. //
  750. // The shell will enumerate through all IconOverlayIdentifiers at start, and prioritize
  751. // them according to internal rules, in case the internal rules don't apply, we use their
  752. // input priority
  753. //
  754. // IShellIconOverlayIdentifier:IsMemberOf(LPCWSTR pwszPath, DWORD dwAttrib)
  755. // pwszPath full path of the file
  756. // dwAttrib attribute of this file
  757. //
  758. // returns:
  759. // S_OK, if the file is a member
  760. // S_FALSE, if the file is not a member
  761. // E_FAIL, if the operation failed due to bad WIN32_FIND_DATA
  762. //
  763. // IShellIconOverlayIdentifier::GetOverlayInfo(LPWSTR pwszIconFile, int * pIndex, DWORD * dwFlags) PURE;
  764. // pszIconFile the path of the icon file
  765. // pIndex Depend on the flags, this could contain the IconIndex
  766. // dwFlags defined below
  767. //
  768. // IShellIconOverlayIdentifier::GetPriority(int * pIPriority) PURE;
  769. // pIPriority the priority of this Overlay Identifier
  770. //
  771. //===========================================================================
  772. #undef INTERFACE
  773. #define INTERFACE IShellIconOverlayIdentifier
  774. DECLARE_INTERFACE_(IShellIconOverlayIdentifier, IUnknown)
  775. {
  776. // *** IUnknown methods ***
  777. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  778. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  779. STDMETHOD_(ULONG,Release) (THIS) PURE;
  780. // *** IShellIconOverlayIdentifier methods ***
  781. STDMETHOD (IsMemberOf)(THIS_ LPCWSTR pwszPath, DWORD dwAttrib) PURE;
  782. STDMETHOD (GetOverlayInfo)(THIS_ LPWSTR pwszIconFile, int cchMax, int * pIndex, DWORD * pdwFlags) PURE;
  783. STDMETHOD (GetPriority)(THIS_ int * pIPriority) PURE;
  784. };
  785. #define ISIOI_ICONFILE 0x00000001 // path is returned through pwszIconFile
  786. #define ISIOI_ICONINDEX 0x00000002 // icon index in pwszIconFile is returned through pIndex
  787. //===========================================================================
  788. //
  789. // IShellIconOverlayManager
  790. //
  791. // Used to return the icon overlay information including OverlayIndex, Image Index or Priority for an IShellFolder object.
  792. //
  793. // IShellIconOverlayManager:GetFileOverlayInfo(LPCWSTR pwszPath, DWORD dwAttrib, int * pIndex, DWORD dwflags)
  794. // pwszPath full path of the file
  795. // dwAttrib attribute of this file
  796. // pIndex pointer to the Icon Index in the system image list
  797. // pOverlayIndex pointer to the OverlayIndex in the system image list
  798. // pPriority pointer to the Priority of this overlay
  799. // IShellIconOverlayManager:GetReservedOverlayInfo(LPCWSTR pwszPath, DWORD dwAttrib, int * pIndex, DWORD dwflags, int iReservedID)
  800. // iReservedID reserved icon overlay id
  801. // returns:
  802. // S_OK, if the index of an Overlay is found
  803. // S_FALSE, if no Overlay exists for this file
  804. // E_FAIL, if lpfd is bad
  805. // IShellIconOverlayManager:RefreshOverlayImages(DWORD dwFlags)
  806. // This will refresh the overlay cache, depends on the dwFlags passed in
  807. // It will reload the icons into the imagelist, when passed SIOM_ICONINDEX
  808. // IShellIconOverlayManager::LoadNonloadedOverlayIdentifiers()
  809. // This method loads any registered overlay identifiers (handlers) that
  810. // are not currently loaded.
  811. // IShellIconOverlayManager::OverlayIndexFromImageIndex(int iImage, int *piIndex, BOOL fAdd)
  812. // iImage existing shell image list index to look for
  813. // piIndex returned overlay index
  814. // fAdd Add image if not already present?
  815. //===========================================================================
  816. #if (_WIN32_IE >= 0x0601)
  817. #undef INTERFACE
  818. #define INTERFACE IShellIconOverlayManager
  819. DECLARE_INTERFACE_(IShellIconOverlayManager, IUnknown)
  820. {
  821. // *** IUnknown methods ***
  822. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  823. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  824. STDMETHOD_(ULONG,Release) (THIS) PURE;
  825. // *** IShellIconOverlayManager methods ***
  826. STDMETHOD(GetFileOverlayInfo)(THIS_ LPCWSTR pwszPath, DWORD dwAttrib, int * pIndex, DWORD dwflags) PURE;
  827. STDMETHOD(GetReservedOverlayInfo)(THIS_ LPCWSTR pwszPath, DWORD dwAttrib, int * pIndex, DWORD dwflags, int iReservedID) PURE;
  828. STDMETHOD(RefreshOverlayImages)(THIS_ DWORD dwFlags) PURE;
  829. STDMETHOD(LoadNonloadedOverlayIdentifiers)(THIS) PURE;
  830. STDMETHOD(OverlayIndexFromImageIndex)(THIS_ int iImage, int * piIndex, BOOL fAdd) PURE;
  831. };
  832. #define SIOM_OVERLAYINDEX 1
  833. #define SIOM_ICONINDEX 2
  834. // #define SIOM_PRIORITY 3
  835. #define SIOM_RESERVED_SHARED 0
  836. #define SIOM_RESERVED_LINK 1
  837. #define SIOM_RESERVED_SLOWFILE 2
  838. #endif // (_WIN32_IE >= 0x0601)
  839. //===========================================================================
  840. //
  841. // IShellIconOverlay
  842. //
  843. // Used to return the icon overlay index or its icon index for an IShellFolder object,
  844. // this is always implemented with IShellFolder
  845. //
  846. // IShellIconOverlay:GetOverlayIndex(LPCITEMIDLIST pidl, DWORD * pdwIndex)
  847. // pidl object to identify icon overlay for.
  848. // pdwIndex the Overlay Index in the system image list
  849. //
  850. // IShellIconOverlay:GetOverlayIconIndex(LPCITEMIDLIST pidl, DWORD * pdwIndex)
  851. // pdwIconIndex the Overlay Icon index in the system image list
  852. // This method is only used for those who are interested in seeing the real bits
  853. // of the Overlay Icon
  854. //
  855. // returns:
  856. // S_OK, if the index of an Overlay is found
  857. // S_FALSE, if no Overlay exists for this file
  858. // E_FAIL, if pidl is bad
  859. //
  860. //===========================================================================
  861. #undef INTERFACE
  862. #define INTERFACE IShellIconOverlay
  863. DECLARE_INTERFACE_(IShellIconOverlay, IUnknown)
  864. {
  865. // *** IUnknown methods ***
  866. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  867. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  868. STDMETHOD_(ULONG,Release) (THIS) PURE;
  869. // *** IShellIconOverlay methods ***
  870. STDMETHOD(GetOverlayIndex)(THIS_ LPCITEMIDLIST pidl, int * pIndex) PURE;
  871. STDMETHOD(GetOverlayIconIndex)(THIS_ LPCITEMIDLIST pidl, int * pIconIndex) PURE;
  872. };
  873. #define OI_ASYNC 0xFFFFEEEE
  874. //-------------------------------------------------------------------------
  875. //
  876. // SHGetIconOverlayIndex
  877. //
  878. // This function takes the path and icon/res id to the icon and convert it into
  879. // an overlay index in the system image list.
  880. // Note: there are totally only 15 slots for system image overlays, some of which
  881. // was reserved by the system, or taken by the overlayidentifiers, so it's possible
  882. // that this function would fail and return -1;
  883. //
  884. // To get the default overlays in the system, such as the share hand, link shortcut
  885. // and slow files, pass NULL as the file name, then the IDO_SHGIOI_* flags as the icon index
  886. //-------------------------------------------------------------------------
  887. #define IDO_SHGIOI_SHARE 0x0FFFFFFF
  888. #define IDO_SHGIOI_LINK 0x0FFFFFFE
  889. #define IDO_SHGIOI_SLOWFILE 0x0FFFFFFFD
  890. SHSTDAPI_(int) SHGetIconOverlayIndexA(LPCSTR pszIconPath, int iIconIndex);
  891. SHSTDAPI_(int) SHGetIconOverlayIndexW(LPCWSTR pszIconPath, int iIconIndex);
  892. #ifdef UNICODE
  893. #define SHGetIconOverlayIndex SHGetIconOverlayIndexW
  894. #else
  895. #define SHGetIconOverlayIndex SHGetIconOverlayIndexA
  896. #endif // !UNICODE
  897. #if (_WIN32_IE >= 0x0400)
  898. // IShellLinkDataList::GetFlags()/SetFlags()
  899. typedef enum {
  900. SLDF_HAS_ID_LIST = 0x00000001, // Shell link saved with ID list
  901. SLDF_HAS_LINK_INFO = 0x00000002, // Shell link saved with LinkInfo
  902. SLDF_HAS_NAME = 0x00000004,
  903. SLDF_HAS_RELPATH = 0x00000008,
  904. SLDF_HAS_WORKINGDIR = 0x00000010,
  905. SLDF_HAS_ARGS = 0x00000020,
  906. SLDF_HAS_ICONLOCATION = 0x00000040,
  907. SLDF_UNICODE = 0x00000080, // the strings are unicode
  908. SLDF_FORCE_NO_LINKINFO = 0x00000100, // don't create a LINKINFO (make a dumb link)
  909. SLDF_HAS_EXP_SZ = 0x00000200, // the link contains expandable env strings
  910. SLDF_RUN_IN_SEPARATE = 0x00000400, // Run the 16-bit target exe in a separate VDM/WOW
  911. SLDF_HAS_LOGO3ID = 0x00000800, // this link is a special Logo3/MSICD link
  912. SLDF_HAS_DARWINID = 0x00001000, // this link is a special Darwin link
  913. SLDF_RUNAS_USER = 0x00002000, // Run this link as a different user
  914. SLDF_HAS_EXP_ICON_SZ = 0x00004000, // contains expandable env string for icon path
  915. SLDF_NO_PIDL_ALIAS = 0x00008000, // don't ever resolve to a logical location
  916. SLDF_FORCE_UNCNAME = 0x00010000, // make GetPath() prefer the UNC name to the local name
  917. SLDF_RUN_WITH_SHIMLAYER = 0x00020000, // Launch the target of this link w/ shim layer active
  918. SLDF_RESERVED = 0x80000000, // Reserved-- so we can use the low word as an index value in the future
  919. } SHELL_LINK_DATA_FLAGS;
  920. typedef struct tagDATABLOCKHEADER
  921. {
  922. DWORD cbSize; // Size of this extra data block
  923. DWORD dwSignature; // signature of this extra data block
  924. } DATABLOCK_HEADER, *LPDATABLOCK_HEADER, *LPDBLIST;
  925. typedef struct {
  926. #ifdef __cplusplus
  927. DATABLOCK_HEADER dbh;
  928. #else
  929. DATABLOCK_HEADER;
  930. #endif
  931. WORD wFillAttribute; // fill attribute for console
  932. WORD wPopupFillAttribute; // fill attribute for console popups
  933. COORD dwScreenBufferSize; // screen buffer size for console
  934. COORD dwWindowSize; // window size for console
  935. COORD dwWindowOrigin; // window origin for console
  936. DWORD nFont;
  937. DWORD nInputBufferSize;
  938. COORD dwFontSize;
  939. UINT uFontFamily;
  940. UINT uFontWeight;
  941. WCHAR FaceName[LF_FACESIZE];
  942. UINT uCursorSize;
  943. BOOL bFullScreen;
  944. BOOL bQuickEdit;
  945. BOOL bInsertMode;
  946. BOOL bAutoPosition;
  947. UINT uHistoryBufferSize;
  948. UINT uNumberOfHistoryBuffers;
  949. BOOL bHistoryNoDup;
  950. COLORREF ColorTable[ 16 ];
  951. } NT_CONSOLE_PROPS, *LPNT_CONSOLE_PROPS;
  952. #define NT_CONSOLE_PROPS_SIG 0xA0000002
  953. // This is a FE Console property
  954. typedef struct {
  955. #ifdef __cplusplus
  956. DATABLOCK_HEADER dbh;
  957. #else
  958. DATABLOCK_HEADER;
  959. #endif
  960. UINT uCodePage;
  961. } NT_FE_CONSOLE_PROPS, *LPNT_FE_CONSOLE_PROPS;
  962. #define NT_FE_CONSOLE_PROPS_SIG 0xA0000004
  963. #if (_WIN32_IE >= 0x0500)
  964. typedef struct {
  965. #ifdef __cplusplus
  966. DATABLOCK_HEADER dbh;
  967. #else
  968. DATABLOCK_HEADER;
  969. #endif
  970. CHAR szDarwinID[MAX_PATH]; // ANSI darwin ID associated with link
  971. WCHAR szwDarwinID[MAX_PATH]; // UNICODE darwin ID associated with link
  972. } EXP_DARWIN_LINK, *LPEXP_DARWIN_LINK;
  973. #define EXP_DARWIN_ID_SIG 0xA0000006
  974. #define EXP_LOGO3_ID_SIG 0xA0000007
  975. #endif
  976. #define EXP_SPECIAL_FOLDER_SIG 0xA0000005 // LPEXP_SPECIAL_FOLDER
  977. typedef struct
  978. {
  979. DWORD cbSize; // Size of this extra data block
  980. DWORD dwSignature; // signature of this extra data block
  981. DWORD idSpecialFolder; // special folder id this link points into
  982. DWORD cbOffset; // ofset into pidl from SLDF_HAS_ID_LIST for child
  983. } EXP_SPECIAL_FOLDER, *LPEXP_SPECIAL_FOLDER;
  984. typedef struct
  985. {
  986. DWORD cbSize; // Size of this extra data block
  987. DWORD dwSignature; // signature of this extra data block
  988. CHAR szTarget[ MAX_PATH ]; // ANSI target name w/EXP_SZ in it
  989. WCHAR swzTarget[ MAX_PATH ]; // UNICODE target name w/EXP_SZ in it
  990. } EXP_SZ_LINK, *LPEXP_SZ_LINK;
  991. #define EXP_SZ_LINK_SIG 0xA0000001 // LPEXP_SZ_LINK (target)
  992. #define EXP_SZ_ICON_SIG 0xA0000007 // LPEXP_SZ_LINK (icon)
  993. #undef INTERFACE
  994. #define INTERFACE IShellLinkDataList
  995. DECLARE_INTERFACE_(IShellLinkDataList, IUnknown)
  996. {
  997. // *** IUnknown methods ***
  998. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  999. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1000. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1001. // *** IShellLinkDataList methods ***
  1002. STDMETHOD(AddDataBlock)(THIS_ void * pDataBlock) PURE;
  1003. STDMETHOD(CopyDataBlock)(THIS_ DWORD dwSig, void **ppDataBlock) PURE;
  1004. STDMETHOD(RemoveDataBlock)(THIS_ DWORD dwSig) PURE;
  1005. STDMETHOD(GetFlags)(THIS_ DWORD *pdwFlags) PURE;
  1006. STDMETHOD(SetFlags)(THIS_ DWORD dwFlags) PURE;
  1007. };
  1008. #endif // (_WIN32_IE >= 0x0400)
  1009. #if (_WIN32_IE >= 0x0500)
  1010. #undef INTERFACE
  1011. #define INTERFACE IResolveShellLink
  1012. DECLARE_INTERFACE_(IResolveShellLink, IUnknown)
  1013. {
  1014. // *** IUnknown methods ***
  1015. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1016. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1017. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1018. // *** IResolveShellLink methods ***
  1019. STDMETHOD(ResolveShellLink)(THIS_ IUnknown* punk, HWND hwnd, DWORD fFlags) PURE;
  1020. };
  1021. #endif // (_WIN32_IE >= 0x0500)
  1022. #ifdef _INC_SHELLAPI /* for LPSHELLEXECUTEINFO */
  1023. //===========================================================================
  1024. //
  1025. // IShellExecuteHook Interface
  1026. //
  1027. //===========================================================================
  1028. #undef INTERFACE
  1029. #define INTERFACE IShellExecuteHookA
  1030. DECLARE_INTERFACE_(IShellExecuteHookA, IUnknown) // shexhk
  1031. {
  1032. // *** IUnknown methods ***
  1033. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1034. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1035. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1036. // *** IShellExecuteHookA methods ***
  1037. STDMETHOD(Execute)(THIS_ LPSHELLEXECUTEINFOA pei) PURE;
  1038. };
  1039. #undef INTERFACE
  1040. #define INTERFACE IShellExecuteHookW
  1041. DECLARE_INTERFACE_(IShellExecuteHookW, IUnknown) // shexhk
  1042. {
  1043. // *** IUnknown methods ***
  1044. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1045. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1046. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1047. // *** IShellExecuteHookW methods ***
  1048. STDMETHOD(Execute)(THIS_ LPSHELLEXECUTEINFOW pei) PURE;
  1049. };
  1050. #ifdef UNICODE
  1051. #define IShellExecuteHook IShellExecuteHookW
  1052. #define IShellExecuteHookVtbl IShellExecuteHookWVtbl
  1053. #else
  1054. #define IShellExecuteHook IShellExecuteHookA
  1055. #define IShellExecuteHookVtbl IShellExecuteHookAVtbl
  1056. #endif
  1057. #endif
  1058. //===========================================================================
  1059. //
  1060. // IURLSearchHook Interface
  1061. //
  1062. //===========================================================================
  1063. #undef INTERFACE
  1064. #define INTERFACE IURLSearchHook
  1065. DECLARE_INTERFACE_(IURLSearchHook, IUnknown)
  1066. {
  1067. // *** IUnknown methods ***
  1068. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1069. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1070. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1071. // *** IURLSearchHook methods ***
  1072. STDMETHOD(Translate)(THIS_ LPWSTR lpwszSearchURL, DWORD cchBufferSize) PURE;
  1073. };
  1074. #undef INTERFACE
  1075. #define INTERFACE ISearchContext
  1076. DECLARE_INTERFACE_(ISearchContext, IUnknown)
  1077. {
  1078. // *** IUnknown methods ***
  1079. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1080. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1081. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1082. // *** ISearchContext methods ***
  1083. STDMETHOD(GetSearchUrl)(THIS_ BSTR * pbstrSearchUrl) PURE;
  1084. STDMETHOD(GetSearchText)(THIS_ BSTR * pbstrSearchText) PURE;
  1085. STDMETHOD(GetSearchStyle)(THIS_ DWORD * pdwSearchStyle) PURE;
  1086. };
  1087. #undef INTERFACE
  1088. #define INTERFACE IURLSearchHook2
  1089. DECLARE_INTERFACE_(IURLSearchHook2, IURLSearchHook)
  1090. {
  1091. // *** IURLSearchHook2 methods ***
  1092. STDMETHOD(TranslateWithSearchContext)(THIS_ LPWSTR lpwszSearchURL, DWORD cchBufferSize, ISearchContext * pSearchContext) PURE;
  1093. };
  1094. //===========================================================================
  1095. //
  1096. // INewShortcutHook Interface
  1097. //
  1098. //===========================================================================
  1099. #undef INTERFACE
  1100. #define INTERFACE INewShortcutHookA
  1101. DECLARE_INTERFACE_(INewShortcutHookA, IUnknown) // nshhk
  1102. {
  1103. // *** IUnknown methods ***
  1104. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1105. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1106. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1107. // *** INewShortcutHook methods ***
  1108. STDMETHOD(SetReferent)(THIS_ LPCSTR pcszReferent, HWND hwnd) PURE;
  1109. STDMETHOD(GetReferent)(THIS_ LPSTR pszReferent, int cchReferent) PURE;
  1110. STDMETHOD(SetFolder)(THIS_ LPCSTR pcszFolder) PURE;
  1111. STDMETHOD(GetFolder)(THIS_ LPSTR pszFolder, int cchFolder) PURE;
  1112. STDMETHOD(GetName)(THIS_ LPSTR pszName, int cchName) PURE;
  1113. STDMETHOD(GetExtension)(THIS_ LPSTR pszExtension, int cchExtension) PURE;
  1114. };
  1115. #undef INTERFACE
  1116. #define INTERFACE INewShortcutHookW
  1117. DECLARE_INTERFACE_(INewShortcutHookW, IUnknown) // nshhk
  1118. {
  1119. // *** IUnknown methods ***
  1120. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1121. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1122. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1123. // *** INewShortcutHook methods ***
  1124. STDMETHOD(SetReferent)(THIS_ LPCWSTR pcszReferent, HWND hwnd) PURE;
  1125. STDMETHOD(GetReferent)(THIS_ LPWSTR pszReferent, int cchReferent) PURE;
  1126. STDMETHOD(SetFolder)(THIS_ LPCWSTR pcszFolder) PURE;
  1127. STDMETHOD(GetFolder)(THIS_ LPWSTR pszFolder, int cchFolder) PURE;
  1128. STDMETHOD(GetName)(THIS_ LPWSTR pszName, int cchName) PURE;
  1129. STDMETHOD(GetExtension)(THIS_ LPWSTR pszExtension, int cchExtension) PURE;
  1130. };
  1131. #ifdef UNICODE
  1132. #define INewShortcutHook INewShortcutHookW
  1133. #define INewShortcutHookVtbl INewShortcutHookWVtbl
  1134. #else
  1135. #define INewShortcutHook INewShortcutHookA
  1136. #define INewShortcutHookVtbl INewShortcutHookAVtbl
  1137. #endif
  1138. //===========================================================================
  1139. //
  1140. // ICopyHook Interface
  1141. //
  1142. // The copy hook is called whenever file system directories are
  1143. // copy/moved/deleted/renamed via the shell. It is also called by the shell
  1144. // on changes of status of printers.
  1145. //
  1146. // Clients register their id under STRREG_SHEX_COPYHOOK for file system hooks
  1147. // and STRREG_SHEx_PRNCOPYHOOK for printer hooks.
  1148. // the CopyCallback is called prior to the action, so the hook has the chance
  1149. // to allow, deny or cancel the operation by returning the falues:
  1150. // IDYES - means allow the operation
  1151. // IDNO - means disallow the operation on this file, but continue with
  1152. // any other operations (eg. batch copy)
  1153. // IDCANCEL - means disallow the current operation and cancel any pending
  1154. // operations
  1155. //
  1156. // arguments to the CopyCallback
  1157. // hwnd - window to use for any UI
  1158. // wFunc - what operation is being done
  1159. // wFlags - and flags (FOF_*) set in the initial call to the file operation
  1160. // pszSrcFile - name of the source file
  1161. // dwSrcAttribs - file attributes of the source file
  1162. // pszDestFile - name of the destiation file (for move and renames)
  1163. // dwDestAttribs - file attributes of the destination file
  1164. //
  1165. //
  1166. //===========================================================================
  1167. #ifndef FO_MOVE //these need to be kept in sync with the ones in shellapi.h
  1168. // file operations
  1169. #define FO_MOVE 0x0001
  1170. #define FO_COPY 0x0002
  1171. #define FO_DELETE 0x0003
  1172. #define FO_RENAME 0x0004
  1173. #define FOF_MULTIDESTFILES 0x0001
  1174. #define FOF_CONFIRMMOUSE 0x0002
  1175. #define FOF_SILENT 0x0004 // don't create progress/report
  1176. #define FOF_RENAMEONCOLLISION 0x0008
  1177. #define FOF_NOCONFIRMATION 0x0010 // Don't prompt the user.
  1178. #define FOF_WANTMAPPINGHANDLE 0x0020 // Fill in SHFILEOPSTRUCT.hNameMappings
  1179. // Must be freed using SHFreeNameMappings
  1180. #define FOF_ALLOWUNDO 0x0040
  1181. #define FOF_FILESONLY 0x0080 // on *.*, do only files
  1182. #define FOF_SIMPLEPROGRESS 0x0100 // means don't show names of files
  1183. #define FOF_NOCONFIRMMKDIR 0x0200 // don't confirm making any needed dirs
  1184. #define FOF_NOERRORUI 0x0400 // don't put up error UI
  1185. #define FOF_NOCOPYSECURITYATTRIBS 0x0800 // dont copy NT file Security Attributes
  1186. #define FOF_NORECURSION 0x1000 // don't recurse into directories.
  1187. #if (_WIN32_IE >= 0x500)
  1188. #define FOF_NO_CONNECTED_ELEMENTS 0x2000 // don't operate on connected file elements.
  1189. #define FOF_WANTNUKEWARNING 0x4000 // during delete operation, warn if nuking instead of recycling (partially overrides FOF_NOCONFIRMATION)
  1190. #endif // _WIN32_IE >= 0x500
  1191. #if (_WIN32_WINNT >= 0x0501)
  1192. #define FOF_NORECURSEREPARSE 0x8000 // treat reparse points as objects, not containers
  1193. #endif // (_WIN32_WINNT >= 0x501)
  1194. typedef WORD FILEOP_FLAGS;
  1195. // printer operations
  1196. #define PO_DELETE 0x0013 // printer is being deleted
  1197. #define PO_RENAME 0x0014 // printer is being renamed
  1198. #define PO_PORTCHANGE 0x0020 // port this printer connected to is being changed
  1199. // if this id is set, the strings received by
  1200. // the copyhook are a doubly-null terminated
  1201. // list of strings. The first is the printer
  1202. // name and the second is the printer port.
  1203. #define PO_REN_PORT 0x0034 // PO_RENAME and PO_PORTCHANGE at same time.
  1204. // no POF_ flags currently defined
  1205. typedef UINT PRINTEROP_FLAGS;
  1206. #endif // FO_MOVE
  1207. #undef INTERFACE
  1208. #define INTERFACE ICopyHookA
  1209. DECLARE_INTERFACE_(ICopyHookA, IUnknown) // sl
  1210. {
  1211. // *** IUnknown methods ***
  1212. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1213. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1214. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1215. // *** ICopyHook methods ***
  1216. STDMETHOD_(UINT,CopyCallback) (THIS_ HWND hwnd, UINT wFunc, UINT wFlags, LPCSTR pszSrcFile, DWORD dwSrcAttribs,
  1217. LPCSTR pszDestFile, DWORD dwDestAttribs) PURE;
  1218. };
  1219. typedef ICopyHookA * LPCOPYHOOKA;
  1220. #undef INTERFACE
  1221. #define INTERFACE ICopyHookW
  1222. DECLARE_INTERFACE_(ICopyHookW, IUnknown) // sl
  1223. {
  1224. // *** IUnknown methods ***
  1225. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1226. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1227. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1228. // *** ICopyHook methods ***
  1229. STDMETHOD_(UINT,CopyCallback) (THIS_ HWND hwnd, UINT wFunc, UINT wFlags, LPCWSTR pszSrcFile, DWORD dwSrcAttribs,
  1230. LPCWSTR pszDestFile, DWORD dwDestAttribs) PURE;
  1231. };
  1232. typedef ICopyHookW * LPCOPYHOOKW;
  1233. #ifdef UNICODE
  1234. #define ICopyHook ICopyHookW
  1235. #define ICopyHookVtbl ICopyHookWVtbl
  1236. #define LPCOPYHOOK LPCOPYHOOKW
  1237. #else
  1238. #define ICopyHook ICopyHookA
  1239. #define ICopyHookVtbl ICopyHookAVtbl
  1240. #define LPCOPYHOOK LPCOPYHOOKA
  1241. #endif
  1242. //===========================================================================
  1243. //
  1244. // IFileViewerSite Interface
  1245. //
  1246. //===========================================================================
  1247. #undef INTERFACE
  1248. #define INTERFACE IFileViewerSite
  1249. DECLARE_INTERFACE_(IFileViewerSite, IUnknown)
  1250. {
  1251. // *** IUnknown methods ***
  1252. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1253. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1254. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1255. // *** IFileViewerSite methods ***
  1256. STDMETHOD(SetPinnedWindow) (THIS_ HWND hwnd) PURE;
  1257. STDMETHOD(GetPinnedWindow) (THIS_ HWND *phwnd) PURE;
  1258. };
  1259. typedef IFileViewerSite * LPFILEVIEWERSITE;
  1260. //===========================================================================
  1261. //
  1262. // IFileViewer Interface
  1263. //
  1264. // Implemented in a FileViewer component object. Used to tell a
  1265. // FileViewer to PrintTo or to view, the latter happening though
  1266. // ShowInitialize and Show. The filename is always given to the
  1267. // viewer through IPersistFile.
  1268. //
  1269. //===========================================================================
  1270. #include <pshpack8.h>
  1271. typedef struct
  1272. {
  1273. // Stuff passed into viewer (in)
  1274. DWORD cbSize; // Size of structure for future expansion...
  1275. HWND hwndOwner; // who is the owner window.
  1276. int iShow; // The show command
  1277. // Passed in and updated (in/Out)
  1278. DWORD dwFlags; // flags
  1279. RECT rect; // Where to create the window may have defaults
  1280. IUnknown *punkRel; // Relese this interface when window is visible
  1281. // Stuff that might be returned from viewer (out)
  1282. OLECHAR strNewFile[MAX_PATH]; // New File to view.
  1283. } FVSHOWINFO, *LPFVSHOWINFO;
  1284. #include <poppack.h> /* Return to byte packing */
  1285. // Define File View Show Info Flags.
  1286. #define FVSIF_RECT 0x00000001 // The rect variable has valid data.
  1287. #define FVSIF_PINNED 0x00000002 // We should Initialize pinned
  1288. #define FVSIF_NEWFAILED 0x08000000 // The new file passed back failed
  1289. // to be viewed.
  1290. #define FVSIF_NEWFILE 0x80000000 // A new file to view has been returned
  1291. #define FVSIF_CANVIEWIT 0x40000000 // The viewer can view it.
  1292. #undef INTERFACE
  1293. #define INTERFACE IFileViewerA
  1294. DECLARE_INTERFACE(IFileViewerA)
  1295. {
  1296. // *** IUnknown methods ***
  1297. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1298. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1299. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1300. // *** IFileViewer methods ***
  1301. STDMETHOD(ShowInitialize) (THIS_ LPFILEVIEWERSITE lpfsi) PURE;
  1302. STDMETHOD(Show) (THIS_ LPFVSHOWINFO pvsi) PURE;
  1303. STDMETHOD(PrintTo) (THIS_ LPSTR pszDriver, BOOL fSuppressUI) PURE;
  1304. };
  1305. typedef IFileViewerA * LPFILEVIEWERA;
  1306. #undef INTERFACE
  1307. #define INTERFACE IFileViewerW
  1308. DECLARE_INTERFACE(IFileViewerW)
  1309. {
  1310. // *** IUnknown methods ***
  1311. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1312. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1313. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1314. // *** IFileViewer methods ***
  1315. STDMETHOD(ShowInitialize) (THIS_ LPFILEVIEWERSITE lpfsi) PURE;
  1316. STDMETHOD(Show) (THIS_ LPFVSHOWINFO pvsi) PURE;
  1317. STDMETHOD(PrintTo) (THIS_ LPWSTR pszDriver, BOOL fSuppressUI) PURE;
  1318. };
  1319. typedef IFileViewerW * LPFILEVIEWERW;
  1320. #ifdef UNICODE
  1321. #define IFileViewer IFileViewerW
  1322. #define LPFILEVIEWER LPFILEVIEWERW
  1323. #else
  1324. #define IFileViewer IFileViewerA
  1325. #define LPFILEVIEWER LPFILEVIEWERA
  1326. #endif
  1327. //==========================================================================
  1328. //
  1329. // IShellBrowser/IShellView/IShellFolder interface
  1330. //
  1331. // These three interfaces are used when the shell communicates with
  1332. // name space extensions. The shell (explorer) provides IShellBrowser
  1333. // interface, and extensions implements IShellFolder and IShellView
  1334. // interfaces.
  1335. //
  1336. //==========================================================================
  1337. //--------------------------------------------------------------------------
  1338. //
  1339. // Command/menuitem IDs
  1340. //
  1341. // The explorer dispatches WM_COMMAND messages based on the range of
  1342. // command/menuitem IDs. All the IDs of menuitems that the view (right
  1343. // pane) inserts must be in FCIDM_SHVIEWFIRST/LAST (otherwise, the explorer
  1344. // won't dispatch them). The view should not deal with any menuitems
  1345. // in FCIDM_BROWSERFIRST/LAST (otherwise, it won't work with the future
  1346. // version of the shell).
  1347. //
  1348. // FCIDM_SHVIEWFIRST/LAST for the right pane (IShellView)
  1349. // FCIDM_BROWSERFIRST/LAST for the explorer frame (IShellBrowser)
  1350. // FCIDM_GLOBAL/LAST for the explorer's submenu IDs
  1351. //
  1352. //--------------------------------------------------------------------------
  1353. #define FCIDM_SHVIEWFIRST 0x0000
  1354. #define FCIDM_SHVIEWLAST 0x7fff
  1355. #define FCIDM_BROWSERFIRST 0xa000
  1356. #define FCIDM_BROWSERLAST 0xbf00
  1357. #define FCIDM_GLOBALFIRST 0x8000
  1358. #define FCIDM_GLOBALLAST 0x9fff
  1359. //
  1360. // Global submenu IDs and separator IDs
  1361. //
  1362. #define FCIDM_MENU_FILE (FCIDM_GLOBALFIRST+0x0000)
  1363. #define FCIDM_MENU_EDIT (FCIDM_GLOBALFIRST+0x0040)
  1364. #define FCIDM_MENU_VIEW (FCIDM_GLOBALFIRST+0x0080)
  1365. #define FCIDM_MENU_VIEW_SEP_OPTIONS (FCIDM_GLOBALFIRST+0x0081)
  1366. #define FCIDM_MENU_TOOLS (FCIDM_GLOBALFIRST+0x00c0) // for Win9x compat
  1367. #define FCIDM_MENU_TOOLS_SEP_GOTO (FCIDM_GLOBALFIRST+0x00c1) // for Win9x compat
  1368. #define FCIDM_MENU_HELP (FCIDM_GLOBALFIRST+0x0100)
  1369. #define FCIDM_MENU_FIND (FCIDM_GLOBALFIRST+0x0140)
  1370. #define FCIDM_MENU_EXPLORE (FCIDM_GLOBALFIRST+0x0150)
  1371. #define FCIDM_MENU_FAVORITES (FCIDM_GLOBALFIRST+0x0170)
  1372. //--------------------------------------------------------------------------
  1373. // control IDs known to the view
  1374. //--------------------------------------------------------------------------
  1375. #define FCIDM_TOOLBAR (FCIDM_BROWSERFIRST + 0)
  1376. #define FCIDM_STATUS (FCIDM_BROWSERFIRST + 1)
  1377. #if (_WIN32_IE >= 0x0400)
  1378. //--------------------------------------------------------------------------
  1379. //
  1380. // The resource id of the offline cursor
  1381. // This cursor is avaialble in shdocvw.dll
  1382. #define IDC_OFFLINE_HAND 103
  1383. //
  1384. //--------------------------------------------------------------------------
  1385. #endif
  1386. // SBCMDID_GETPANE - not necessarily in order
  1387. #define PANE_NONE -1
  1388. #define PANE_ZONE 1
  1389. #define PANE_OFFLINE 2
  1390. #define PANE_PRINTER 3
  1391. #define PANE_SSL 4
  1392. #define PANE_NAVIGATION 5
  1393. #define PANE_PROGRESS 6
  1394. #define PANE_PRIVACY 7
  1395. //-------------------------------------------------------------------------
  1396. // ICommDlgBrowser interface
  1397. //
  1398. // ICommDlgBrowser interface is the interface that is provided by the new
  1399. // common dialog window to hook and modify the behavior of IShellView. When
  1400. // a default view is created, it queries its parent IShellBrowser for the
  1401. // ICommDlgBrowser interface. If supported, it calls out to that interface
  1402. // in several cases that need to behave differently in a dialog.
  1403. //
  1404. // Member functions:
  1405. //
  1406. // ICommDlgBrowser::OnDefaultCommand()
  1407. // Called when the user double-clicks in the view or presses Enter. The
  1408. // browser should return S_OK if it processed the action itself, S_FALSE
  1409. // to let the view perform the default action.
  1410. //
  1411. // ICommDlgBrowser::OnStateChange(ULONG uChange)
  1412. // Called when some states in the view change. 'uChange' is one of the
  1413. // CDBOSC_* values. This call is made after the state (selection, focus,
  1414. // etc) has changed. There is no return value.
  1415. //
  1416. // ICommDlgBrowser::IncludeObject(LPCITEMIDLIST pidl)
  1417. // Called when the view is enumerating objects. 'pidl' is a relative
  1418. // IDLIST. The browser should return S_OK to include the object in the
  1419. // view, S_FALSE to hide it
  1420. //
  1421. //-------------------------------------------------------------------------
  1422. #define CDBOSC_SETFOCUS 0x00000000
  1423. #define CDBOSC_KILLFOCUS 0x00000001
  1424. #define CDBOSC_SELCHANGE 0x00000002
  1425. #define CDBOSC_RENAME 0x00000003
  1426. #define CDBOSC_STATECHANGE 0x00000004
  1427. #undef INTERFACE
  1428. #define INTERFACE ICommDlgBrowser
  1429. DECLARE_INTERFACE_(ICommDlgBrowser, IUnknown)
  1430. {
  1431. // *** IUnknown methods ***
  1432. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1433. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1434. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1435. // *** ICommDlgBrowser methods ***
  1436. STDMETHOD(OnDefaultCommand) (THIS_ struct IShellView * ppshv) PURE;
  1437. STDMETHOD(OnStateChange) (THIS_ struct IShellView * ppshv,
  1438. ULONG uChange) PURE;
  1439. STDMETHOD(IncludeObject) (THIS_ struct IShellView * ppshv,
  1440. LPCITEMIDLIST pidl) PURE;
  1441. };
  1442. typedef ICommDlgBrowser * LPCOMMDLGBROWSER;
  1443. //-------------------------------------------------------------------------
  1444. // ICommDlgBrowser2 interface
  1445. //
  1446. // Member functions:
  1447. //
  1448. // ICommDlgBrowser2::Notify(IShellView *pshv, DWORD dwNotfyType)
  1449. // Called when the view is wants to notify common dialog when an event
  1450. // occurrs.
  1451. //
  1452. // CDB2N_CONTEXTMENU_START indicates the context menu has started.
  1453. // CDB2N_CONTEXTMENU_DONE indicates the context menu has completed.
  1454. //
  1455. // ICommDlgBrowser2::GetDefaultMenuText(IShellView *pshv,
  1456. // WCHAR *pszText, INT cchMax)
  1457. // Called when the view wants to get the default context menu text.
  1458. // pszText points to buffer and cchMax specifies the size of the
  1459. // buffer in characters. The browser on return has filled the buffer
  1460. // with the default context menu text. The Shell will call this method
  1461. // with at least a buffer size of MAX_PATH. The browser should return
  1462. // S_OK if it returned a new default menu text, S_FALSE to let the view
  1463. // to use the normal default menu text.
  1464. //
  1465. // ICommDlgBrowser2::GetViewFlags(DWORD *pdwFlags)
  1466. // Called when the view wants to determine if special customization needs to
  1467. // be done for the common dialog browser. For example View calls this function to
  1468. // determin if all files(hidden and system)needs to be shown. If the GetViewFlags returns a DWORD with
  1469. // CDB2GVF_SHOWALLFILES flag set then it will show all the files.
  1470. //-------------------------------------------------------------------------
  1471. #define CDB2N_CONTEXTMENU_DONE 0x00000001
  1472. #define CDB2N_CONTEXTMENU_START 0x00000002
  1473. //GetViewFlags
  1474. #define CDB2GVF_SHOWALLFILES 0x00000001
  1475. #undef INTERFACE
  1476. #define INTERFACE ICommDlgBrowser2
  1477. DECLARE_INTERFACE_(ICommDlgBrowser2, IUnknown)
  1478. {
  1479. // *** IUnknown methods ***
  1480. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1481. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1482. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1483. // *** ICommDlgBrowser methods ***
  1484. STDMETHOD(OnDefaultCommand) (THIS_ struct IShellView * ppshv) PURE;
  1485. STDMETHOD(OnStateChange) (THIS_ struct IShellView * ppshv,
  1486. ULONG uChange) PURE;
  1487. STDMETHOD(IncludeObject) (THIS_ struct IShellView * ppshv,
  1488. LPCITEMIDLIST pidl) PURE;
  1489. // *** ICommDlgBrowser2 methods ***
  1490. STDMETHOD(Notify) (THIS_ struct IShellView * ppshv,
  1491. DWORD dwNotifyType) PURE;
  1492. STDMETHOD(GetDefaultMenuText) (THIS_ struct IShellView * ppshv,
  1493. WCHAR *pszText, INT cchMax) PURE;
  1494. STDMETHOD(GetViewFlags)(THIS_ DWORD *pdwFlags) PURE;
  1495. };
  1496. typedef ICommDlgBrowser2 * LPCOMMDLGBROWSER2;
  1497. //
  1498. // function assumes the size of the buffer (MAX_PATH). The pidl
  1499. // should point to a file system object.
  1500. SHSTDAPI_(BOOL) SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath);
  1501. SHSTDAPI_(BOOL) SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath);
  1502. #ifdef UNICODE
  1503. #define SHGetPathFromIDList SHGetPathFromIDListW
  1504. #else
  1505. #define SHGetPathFromIDList SHGetPathFromIDListA
  1506. #endif // !UNICODE
  1507. #if (_WIN32_IE >= 0x0601)
  1508. SHSTDAPI_(int) SHCreateDirectory(HWND hwnd, LPCWSTR pszPath);
  1509. #endif // (_WIN32_IE >= 0x0601)
  1510. SHSTDAPI_(int) SHCreateDirectoryExA(HWND hwnd, LPCSTR pszPath, SECURITY_ATTRIBUTES *psa);
  1511. SHSTDAPI_(int) SHCreateDirectoryExW(HWND hwnd, LPCWSTR pszPath, SECURITY_ATTRIBUTES *psa);
  1512. #ifdef UNICODE
  1513. #define SHCreateDirectoryEx SHCreateDirectoryExW
  1514. #else
  1515. #define SHCreateDirectoryEx SHCreateDirectoryExA
  1516. #endif // !UNICODE
  1517. SHSTDAPI SHOpenFolderAndSelectItems(LPCITEMIDLIST pidlFolder, UINT cidl, LPCITEMIDLIST *apidl, DWORD dwFlags);
  1518. #if (_WIN32_IE >= 0x0601)
  1519. SHSTDAPI SHCreateShellItem(LPCITEMIDLIST pidlParent, IShellFolder *psfParent, LPCITEMIDLIST pidl, IShellItem **ppsi);
  1520. #endif // (_WIN32_IE >= 0x0601)
  1521. //-------------------------------------------------------------------------
  1522. //
  1523. // SHGetSpecialFolderLocation
  1524. //
  1525. // Caller should use SHGetMalloc to obtain an allocator that can free the pidl
  1526. //
  1527. //
  1528. //-------------------------------------------------------------------------
  1529. //
  1530. // registry entries for special paths are kept in :
  1531. #define REGSTR_PATH_SPECIAL_FOLDERS REGSTR_PATH_EXPLORER TEXT("\\Shell Folders")
  1532. #define CSIDL_DESKTOP 0x0000 // <desktop>
  1533. #define CSIDL_INTERNET 0x0001 // Internet Explorer (icon on desktop)
  1534. #define CSIDL_PROGRAMS 0x0002 // Start Menu\Programs
  1535. #define CSIDL_CONTROLS 0x0003 // My Computer\Control Panel
  1536. #define CSIDL_PRINTERS 0x0004 // My Computer\Printers
  1537. #define CSIDL_PERSONAL 0x0005 // My Documents
  1538. #define CSIDL_FAVORITES 0x0006 // <user name>\Favorites
  1539. #define CSIDL_STARTUP 0x0007 // Start Menu\Programs\Startup
  1540. #define CSIDL_RECENT 0x0008 // <user name>\Recent
  1541. #define CSIDL_SENDTO 0x0009 // <user name>\SendTo
  1542. #define CSIDL_BITBUCKET 0x000a // <desktop>\Recycle Bin
  1543. #define CSIDL_STARTMENU 0x000b // <user name>\Start Menu
  1544. #define CSIDL_MYDOCUMENTS 0x000c // logical "My Documents" desktop icon
  1545. #define CSIDL_MYMUSIC 0x000d // "My Music" folder
  1546. #define CSIDL_MYVIDEO 0x000e // "My Videos" folder
  1547. #define CSIDL_DESKTOPDIRECTORY 0x0010 // <user name>\Desktop
  1548. #define CSIDL_DRIVES 0x0011 // My Computer
  1549. #define CSIDL_NETWORK 0x0012 // Network Neighborhood (My Network Places)
  1550. #define CSIDL_NETHOOD 0x0013 // <user name>\nethood
  1551. #define CSIDL_FONTS 0x0014 // windows\fonts
  1552. #define CSIDL_TEMPLATES 0x0015
  1553. #define CSIDL_COMMON_STARTMENU 0x0016 // All Users\Start Menu
  1554. #define CSIDL_COMMON_PROGRAMS 0X0017 // All Users\Start Menu\Programs
  1555. #define CSIDL_COMMON_STARTUP 0x0018 // All Users\Startup
  1556. #define CSIDL_COMMON_DESKTOPDIRECTORY 0x0019 // All Users\Desktop
  1557. #define CSIDL_APPDATA 0x001a // <user name>\Application Data
  1558. #define CSIDL_PRINTHOOD 0x001b // <user name>\PrintHood
  1559. #ifndef CSIDL_LOCAL_APPDATA
  1560. #define CSIDL_LOCAL_APPDATA 0x001c // <user name>\Local Settings\Applicaiton Data (non roaming)
  1561. #endif // CSIDL_LOCAL_APPDATA
  1562. #define CSIDL_ALTSTARTUP 0x001d // non localized startup
  1563. #define CSIDL_COMMON_ALTSTARTUP 0x001e // non localized common startup
  1564. #define CSIDL_COMMON_FAVORITES 0x001f
  1565. #ifndef _SHFOLDER_H_
  1566. #define CSIDL_INTERNET_CACHE 0x0020
  1567. #define CSIDL_COOKIES 0x0021
  1568. #define CSIDL_HISTORY 0x0022
  1569. #define CSIDL_COMMON_APPDATA 0x0023 // All Users\Application Data
  1570. #define CSIDL_WINDOWS 0x0024 // GetWindowsDirectory()
  1571. #define CSIDL_SYSTEM 0x0025 // GetSystemDirectory()
  1572. #define CSIDL_PROGRAM_FILES 0x0026 // C:\Program Files
  1573. #define CSIDL_MYPICTURES 0x0027 // C:\Program Files\My Pictures
  1574. #endif // _SHFOLDER_H_
  1575. #define CSIDL_PROFILE 0x0028 // USERPROFILE
  1576. #define CSIDL_SYSTEMX86 0x0029 // x86 system directory on RISC
  1577. #define CSIDL_PROGRAM_FILESX86 0x002a // x86 C:\Program Files on RISC
  1578. #ifndef _SHFOLDER_H_
  1579. #define CSIDL_PROGRAM_FILES_COMMON 0x002b // C:\Program Files\Common
  1580. #endif // _SHFOLDER_H_
  1581. #define CSIDL_PROGRAM_FILES_COMMONX86 0x002c // x86 Program Files\Common on RISC
  1582. #define CSIDL_COMMON_TEMPLATES 0x002d // All Users\Templates
  1583. #ifndef _SHFOLDER_H_
  1584. #define CSIDL_COMMON_DOCUMENTS 0x002e // All Users\Documents
  1585. #define CSIDL_COMMON_ADMINTOOLS 0x002f // All Users\Start Menu\Programs\Administrative Tools
  1586. #define CSIDL_ADMINTOOLS 0x0030 // <user name>\Start Menu\Programs\Administrative Tools
  1587. #endif // _SHFOLDER_H_
  1588. #define CSIDL_CONNECTIONS 0x0031 // Network and Dial-up Connections
  1589. #define CSIDL_COMMON_MUSIC 0x0035 // All Users\My Music
  1590. #define CSIDL_COMMON_PICTURES 0x0036 // All Users\My Pictures
  1591. #define CSIDL_COMMON_VIDEO 0x0037 // All Users\My Video
  1592. #define CSIDL_RESOURCES 0x0038 // Resource Direcotry
  1593. #ifndef _SHFOLDER_H_
  1594. #define CSIDL_RESOURCES_LOCALIZED 0x0039 // Localized Resource Direcotry
  1595. #endif // _SHFOLDER_H_
  1596. #define CSIDL_COMMON_OEM_LINKS 0x003a // Links to All Users OEM specific apps
  1597. #define CSIDL_CDBURN_AREA 0x003b // USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning
  1598. // unused 0x003c
  1599. #define CSIDL_COMPUTERSNEARME 0x003d // Computers Near Me (computered from Workgroup membership)
  1600. #ifndef _SHFOLDER_H_
  1601. #define CSIDL_FLAG_CREATE 0x8000 // combine with CSIDL_ value to force folder creation in SHGetFolderPath()
  1602. #endif // _SHFOLDER_H_
  1603. #define CSIDL_FLAG_DONT_VERIFY 0x4000 // combine with CSIDL_ value to return an unverified folder path
  1604. #define CSIDL_FLAG_NO_ALIAS 0x1000 // combine with CSIDL_ value to insure non-alias versions of the pidl
  1605. #define CSIDL_FLAG_PER_USER_INIT 0x0800 // combine with CSIDL_ value to indicate per-user init (eg. upgrade)
  1606. #define CSIDL_FLAG_MASK 0xFF00 // mask for all possible flag values
  1607. SHSTDAPI SHGetSpecialFolderLocation(HWND hwnd, int csidl, LPITEMIDLIST *ppidl);
  1608. #if (_WIN32_IE >= 0x0400)
  1609. SHSTDAPI_(void) SHFlushSFCache(void);
  1610. SHSTDAPI_(LPITEMIDLIST) SHCloneSpecialIDList(HWND hwnd, int csidl, BOOL fCreate);
  1611. SHSTDAPI_(BOOL) SHGetSpecialFolderPathA(HWND hwnd, LPSTR pszPath, int csidl, BOOL fCreate);
  1612. SHSTDAPI_(BOOL) SHGetSpecialFolderPathW(HWND hwnd, LPWSTR pszPath, int csidl, BOOL fCreate);
  1613. #ifdef UNICODE
  1614. #define SHGetSpecialFolderPath SHGetSpecialFolderPathW
  1615. #else
  1616. #define SHGetSpecialFolderPath SHGetSpecialFolderPathA
  1617. #endif // !UNICODE
  1618. #if (_WIN32_IE >= 0x0500)
  1619. typedef enum {
  1620. SHGFP_TYPE_CURRENT = 0, // current value for user, verify it exists
  1621. SHGFP_TYPE_DEFAULT = 1, // default value, may not exist
  1622. } SHGFP_TYPE;
  1623. SHFOLDERAPI SHGetFolderPathA(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPSTR pszPath);
  1624. SHFOLDERAPI SHGetFolderPathW(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath);
  1625. #ifdef UNICODE
  1626. #define SHGetFolderPath SHGetFolderPathW
  1627. #else
  1628. #define SHGetFolderPath SHGetFolderPathA
  1629. #endif // !UNICODE
  1630. SHSTDAPI SHGetFolderLocation(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPITEMIDLIST *ppidl);
  1631. SHFOLDERAPI SHGetFolderPathAndSubDirA(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPCSTR pszSubDir, LPSTR pszPath);
  1632. SHFOLDERAPI SHGetFolderPathAndSubDirW(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPCWSTR pszSubDir, LPWSTR pszPath);
  1633. #ifdef UNICODE
  1634. #define SHGetFolderPathAndSubDir SHGetFolderPathAndSubDirW
  1635. #else
  1636. #define SHGetFolderPathAndSubDir SHGetFolderPathAndSubDirA
  1637. #endif // !UNICODE
  1638. #endif // _WIN32_IE >= 0x0500
  1639. #endif // _WIN32_IE >= 0x0400
  1640. #if (_WIN32_IE >= 0x0500)
  1641. #define FCS_READ 0x00000001
  1642. #define FCS_FORCEWRITE 0x00000002
  1643. #define FCS_WRITE (FCS_READ | FCS_FORCEWRITE)
  1644. #define FCS_FLAG_DRAGDROP 2
  1645. // Mask which values have been retreived or being set.
  1646. #define FCSM_VIEWID 0x00000001
  1647. #define FCSM_WEBVIEWTEMPLATE 0x00000002
  1648. #define FCSM_INFOTIP 0x00000004
  1649. #define FCSM_CLSID 0x00000008
  1650. #define FCSM_ICONFILE 0x00000010
  1651. #define FCSM_LOGO 0x00000020
  1652. #define FCSM_FLAGS 0x00000040
  1653. #include <pshpack8.h>
  1654. // Used by SHGetSetFolderCustomSettingsA
  1655. typedef struct
  1656. {
  1657. DWORD dwSize;
  1658. DWORD dwMask; // IN/OUT Which Attributes to Get/Set
  1659. SHELLVIEWID* pvid; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1660. // The folder's WebView template path
  1661. LPSTR pszWebViewTemplate; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1662. DWORD cchWebViewTemplate; // IN - Specifies the size of the buffer pointed to by pszWebViewTemplate
  1663. // Ignored if dwReadWrite is FCS_READ
  1664. LPSTR pszWebViewTemplateVersion; // currently IN only
  1665. // Infotip for the folder
  1666. LPSTR pszInfoTip; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1667. DWORD cchInfoTip; // IN - Specifies the size of the buffer pointed to by pszInfoTip
  1668. // Ignored if dwReadWrite is FCS_READ
  1669. // CLSID that points to more info in the registry
  1670. CLSID* pclsid; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1671. // Other flags for the folder. Takes FCS_FLAG_* values
  1672. DWORD dwFlags; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1673. LPSTR pszIconFile; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1674. DWORD cchIconFile; // IN - Specifies the size of the buffer pointed to by pszIconFile
  1675. // Ignored if dwReadWrite is FCS_READ
  1676. int iIconIndex; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1677. LPSTR pszLogo; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1678. DWORD cchLogo; // IN - Specifies the size of the buffer pointed to by pszIconFile
  1679. // Ignored if dwReadWrite is FCS_READ
  1680. } SHFOLDERCUSTOMSETTINGSA, *LPSHFOLDERCUSTOMSETTINGSA;
  1681. // Used by SHGetSetFolderCustomSettingsW
  1682. typedef struct
  1683. {
  1684. DWORD dwSize;
  1685. DWORD dwMask; // IN/OUT Which Attributes to Get/Set
  1686. SHELLVIEWID* pvid; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1687. // The folder's WebView template path
  1688. LPWSTR pszWebViewTemplate; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1689. DWORD cchWebViewTemplate; // IN - Specifies the size of the buffer pointed to by pszWebViewTemplate
  1690. // Ignored if dwReadWrite is FCS_READ
  1691. LPWSTR pszWebViewTemplateVersion; // currently IN only
  1692. // Infotip for the folder
  1693. LPWSTR pszInfoTip; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1694. DWORD cchInfoTip; // IN - Specifies the size of the buffer pointed to by pszInfoTip
  1695. // Ignored if dwReadWrite is FCS_READ
  1696. // CLSID that points to more info in the registry
  1697. CLSID* pclsid; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1698. // Other flags for the folder. Takes FCS_FLAG_* values
  1699. DWORD dwFlags; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1700. LPWSTR pszIconFile; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1701. DWORD cchIconFile; // IN - Specifies the size of the buffer pointed to by pszIconFile
  1702. // Ignored if dwReadWrite is FCS_READ
  1703. int iIconIndex; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1704. LPWSTR pszLogo; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1705. DWORD cchLogo; // IN - Specifies the size of the buffer pointed to by pszIconFile
  1706. // Ignored if dwReadWrite is FCS_READ
  1707. } SHFOLDERCUSTOMSETTINGSW, *LPSHFOLDERCUSTOMSETTINGSW;
  1708. #include <poppack.h> /* Return to byte packing */
  1709. // Gets/Sets the Folder Custom Settings for pszPath based on dwReadWrite. dwReadWrite can be FCS_READ/FCS_WRITE/FCS_FORCEWRITE
  1710. SHSTDAPI SHGetSetFolderCustomSettingsA(LPSHFOLDERCUSTOMSETTINGSA pfcs, LPCSTR pszPath, DWORD dwReadWrite);
  1711. SHSTDAPI SHGetSetFolderCustomSettingsW(LPSHFOLDERCUSTOMSETTINGSW pfcs, LPCWSTR pszPath, DWORD dwReadWrite);
  1712. #ifdef UNICODE
  1713. #define SHFOLDERCUSTOMSETTINGS SHFOLDERCUSTOMSETTINGSW
  1714. #define SHGetSetFolderCustomSettings SHGetSetFolderCustomSettingsW
  1715. #define LPSHFOLDERCUSTOMSETTINGS LPSHFOLDERCUSTOMSETTINGSW
  1716. #else
  1717. #define SHFOLDERCUSTOMSETTINGS SHFOLDERCUSTOMSETTINGSA
  1718. #define SHGetSetFolderCustomSettings SHGetSetFolderCustomSettingsA
  1719. #define LPSHFOLDERCUSTOMSETTINGS LPSHFOLDERCUSTOMSETTINGSA
  1720. #endif
  1721. #endif // _WIN32_IE >= 0x0500
  1722. //-------------------------------------------------------------------------
  1723. //
  1724. // SHBrowseForFolder API
  1725. //
  1726. //
  1727. //-------------------------------------------------------------------------
  1728. typedef int (CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
  1729. #include <pshpack8.h>
  1730. typedef struct _browseinfoA {
  1731. HWND hwndOwner;
  1732. LPCITEMIDLIST pidlRoot;
  1733. LPSTR pszDisplayName; // Return display name of item selected.
  1734. LPCSTR lpszTitle; // text to go in the banner over the tree.
  1735. UINT ulFlags; // Flags that control the return stuff
  1736. BFFCALLBACK lpfn;
  1737. LPARAM lParam; // extra info that's passed back in callbacks
  1738. int iImage; // output var: where to return the Image index.
  1739. } BROWSEINFOA, *PBROWSEINFOA, *LPBROWSEINFOA;
  1740. typedef struct _browseinfoW {
  1741. HWND hwndOwner;
  1742. LPCITEMIDLIST pidlRoot;
  1743. LPWSTR pszDisplayName; // Return display name of item selected.
  1744. LPCWSTR lpszTitle; // text to go in the banner over the tree.
  1745. UINT ulFlags; // Flags that control the return stuff
  1746. BFFCALLBACK lpfn;
  1747. LPARAM lParam; // extra info that's passed back in callbacks
  1748. int iImage; // output var: where to return the Image index.
  1749. } BROWSEINFOW, *PBROWSEINFOW, *LPBROWSEINFOW;
  1750. #include <poppack.h> /* Return to byte packing */
  1751. #ifdef UNICODE
  1752. #define BROWSEINFO BROWSEINFOW
  1753. #define PBROWSEINFO PBROWSEINFOW
  1754. #define LPBROWSEINFO LPBROWSEINFOW
  1755. #else
  1756. #define BROWSEINFO BROWSEINFOA
  1757. #define PBROWSEINFO PBROWSEINFOA
  1758. #define LPBROWSEINFO LPBROWSEINFOA
  1759. #endif
  1760. // Browsing for directory.
  1761. #define BIF_RETURNONLYFSDIRS 0x0001 // For finding a folder to start document searching
  1762. #define BIF_DONTGOBELOWDOMAIN 0x0002 // For starting the Find Computer
  1763. #define BIF_STATUSTEXT 0x0004 // Top of the dialog has 2 lines of text for BROWSEINFO.lpszTitle and one line if
  1764. // this flag is set. Passing the message BFFM_SETSTATUSTEXTA to the hwnd can set the
  1765. // rest of the text. This is not used with BIF_USENEWUI and BROWSEINFO.lpszTitle gets
  1766. // all three lines of text.
  1767. #define BIF_RETURNFSANCESTORS 0x0008
  1768. #define BIF_EDITBOX 0x0010 // Add an editbox to the dialog
  1769. #define BIF_VALIDATE 0x0020 // insist on valid result (or CANCEL)
  1770. #define BIF_NEWDIALOGSTYLE 0x0040 // Use the new dialog layout with the ability to resize
  1771. // Caller needs to call OleInitialize() before using this API
  1772. #define BIF_USENEWUI (BIF_NEWDIALOGSTYLE | BIF_EDITBOX)
  1773. #define BIF_BROWSEINCLUDEURLS 0x0080 // Allow URLs to be displayed or entered. (Requires BIF_USENEWUI)
  1774. #define BIF_UAHINT 0x0100 // Add a UA hint to the dialog, in place of the edit box. May not be combined with BIF_EDITBOX
  1775. #define BIF_NONEWFOLDERBUTTON 0x0200 // Do not add the "New Folder" button to the dialog. Only applicable with BIF_NEWDIALOGSTYLE.
  1776. #define BIF_NOTRANSLATETARGETS 0x0400 // don't traverse target as shortcut
  1777. #define BIF_BROWSEFORCOMPUTER 0x1000 // Browsing for Computers.
  1778. #define BIF_BROWSEFORPRINTER 0x2000 // Browsing for Printers
  1779. #define BIF_BROWSEINCLUDEFILES 0x4000 // Browsing for Everything
  1780. #define BIF_SHAREABLE 0x8000 // sharable resources displayed (remote shares, requires BIF_USENEWUI)
  1781. // message from browser
  1782. #define BFFM_INITIALIZED 1
  1783. #define BFFM_SELCHANGED 2
  1784. #define BFFM_VALIDATEFAILEDA 3 // lParam:szPath ret:1(cont),0(EndDialog)
  1785. #define BFFM_VALIDATEFAILEDW 4 // lParam:wzPath ret:1(cont),0(EndDialog)
  1786. #define BFFM_IUNKNOWN 5 // provides IUnknown to client. lParam: IUnknown*
  1787. // messages to browser
  1788. #define BFFM_SETSTATUSTEXTA (WM_USER + 100)
  1789. #define BFFM_ENABLEOK (WM_USER + 101)
  1790. #define BFFM_SETSELECTIONA (WM_USER + 102)
  1791. #define BFFM_SETSELECTIONW (WM_USER + 103)
  1792. #define BFFM_SETSTATUSTEXTW (WM_USER + 104)
  1793. #define BFFM_SETOKTEXT (WM_USER + 105) // Unicode only
  1794. #define BFFM_SETEXPANDED (WM_USER + 106) // Unicode only
  1795. SHSTDAPI_(LPITEMIDLIST) SHBrowseForFolderA(LPBROWSEINFOA lpbi);
  1796. SHSTDAPI_(LPITEMIDLIST) SHBrowseForFolderW(LPBROWSEINFOW lpbi);
  1797. #ifdef UNICODE
  1798. #define SHBrowseForFolder SHBrowseForFolderW
  1799. #define BFFM_SETSTATUSTEXT BFFM_SETSTATUSTEXTW
  1800. #define BFFM_SETSELECTION BFFM_SETSELECTIONW
  1801. #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDW
  1802. #else
  1803. #define SHBrowseForFolder SHBrowseForFolderA
  1804. #define BFFM_SETSTATUSTEXT BFFM_SETSTATUSTEXTA
  1805. #define BFFM_SETSELECTION BFFM_SETSELECTIONA
  1806. #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDA
  1807. #endif
  1808. //-------------------------------------------------------------------------
  1809. //
  1810. // SHLoadInProc
  1811. //
  1812. // When this function is called, the shell calls CoCreateInstance
  1813. // (or equivalent) with CLSCTX_INPROC_SERVER and the specified CLSID
  1814. // from within the shell's process and release it immediately.
  1815. //
  1816. //-------------------------------------------------------------------------
  1817. SHSTDAPI SHLoadInProc(REFCLSID rclsid);
  1818. #if (_WIN32_IE >= 0x0600)
  1819. //-------------------------------------------------------------------------
  1820. //
  1821. // SHEnableServiceObject
  1822. //
  1823. // Like SHLoadInProc, but gives control over the object's lifetime
  1824. // via fEnable parameter. TRUE tells the shell to create the object
  1825. // and hold onto it, FALSE tells the shell to look for the previously
  1826. // created instance of the object and release it.
  1827. //
  1828. //-------------------------------------------------------------------------
  1829. SHSTDAPI SHEnableServiceObject(REFCLSID rclsid, BOOL fEnable);
  1830. #endif
  1831. //-------------------------------------------------------------------------
  1832. //
  1833. // Internet Shortcut Object
  1834. //
  1835. //-------------------------------------------------------------------------
  1836. // Cmds for CGID_ShortCut
  1837. enum {
  1838. ISHCUTCMDID_DOWNLOADICON = 0,
  1839. ISHCUTCMDID_INTSHORTCUTCREATE = 1,
  1840. };
  1841. #define CMDID_INTSHORTCUTCREATE ISHCUTCMDID_INTSHORTCUTCREATE
  1842. //
  1843. // Helper function which returns a IShellFolder interface to the desktop
  1844. // folder. This is equivalent to call CoCreateInstance with CLSID_ShellDesktop.
  1845. //
  1846. // CoCreateInstance(CLSID_Desktop, NULL,
  1847. // CLSCTX_INPROC, IID_IShellFolder, &pshf);
  1848. //
  1849. SHSTDAPI SHGetDesktopFolder(IShellFolder **ppshf);
  1850. // IShellFolder IBindCtx* parameters. the IUnknown for these are
  1851. // accessed through IBindCtx::RegisterObjectParam/GetObjectParam
  1852. // use this to provide the data needed create IDLists through
  1853. // IShellFolder::ParseDisplayName(). this data applies to the last element
  1854. // of the name that is parsed (c:\foo\bar.txt, data applies to bar.txt)
  1855. // this makes creating these IDLists much faster that suppling the name only
  1856. #define STR_FILE_SYS_BIND_DATA L"File System Bind Data"
  1857. #undef INTERFACE
  1858. #define INTERFACE IFileSystemBindData
  1859. DECLARE_INTERFACE_(IFileSystemBindData, IUnknown)
  1860. {
  1861. // *** IUnknown methods ***
  1862. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1863. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1864. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1865. // *** IFileSystemBindData methods ***
  1866. STDMETHOD(SetFindData)(THIS_ const WIN32_FIND_DATAW *pfd) PURE;
  1867. STDMETHOD(GetFindData)(THIS_ WIN32_FIND_DATAW *pfd) PURE;
  1868. };
  1869. #undef INTERFACE
  1870. #define INTERFACE IShellDetails
  1871. DECLARE_INTERFACE_(IShellDetails, IUnknown)
  1872. {
  1873. // *** IUnknown methods ***
  1874. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1875. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1876. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1877. // *** IShellDetails methods ***
  1878. STDMETHOD(GetDetailsOf)(THIS_ LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS *pDetails) PURE;
  1879. STDMETHOD(ColumnClick)(THIS_ UINT iColumn) PURE;
  1880. };
  1881. //-------------------------------------------------------------------------
  1882. //
  1883. // IObjMgr interface
  1884. //
  1885. //
  1886. // [Member functions]
  1887. //
  1888. // IObjMgr::Append(punk)
  1889. // This function adds an object to the end of a list of objects.
  1890. //
  1891. // IObjMgr::Remove(punk)
  1892. // This function removes an object from a list of objects.
  1893. //
  1894. // This is implemented by CLSID_ACLMulti so each AutoComplete List
  1895. // (CLSID_ACLHistory, CLSID_ACListISF, CLSID_ACLMRU) can be added.
  1896. // CLSID_ACLMulti's IEnumString will then be the union of the results
  1897. // from the COM Objects added.
  1898. //-------------------------------------------------------------------------
  1899. #undef INTERFACE
  1900. #define INTERFACE IObjMgr
  1901. DECLARE_INTERFACE_(IObjMgr, IUnknown)
  1902. {
  1903. // *** IUnknown methods ***
  1904. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1905. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1906. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1907. // *** IObjMgr specific methods ***
  1908. STDMETHOD(Append) (THIS_ IUnknown *punk) PURE;
  1909. STDMETHOD(Remove) (THIS_ IUnknown *punk) PURE;
  1910. };
  1911. //-------------------------------------------------------------------------
  1912. //
  1913. // ICurrentWorkingDirectory interface
  1914. //
  1915. //
  1916. // [Member functions]
  1917. //
  1918. // ICurrentWorkingDirectory::GetDirectory(LPWSTR pwzPath, DWORD cchSize)
  1919. // This function gets the Current Working Directory from a COM object that
  1920. // stores such state.
  1921. //
  1922. // ICurrentWorkingDirectory::SetDirectory(LPCWSTR pwzPath)
  1923. // This function sets the Current Working Directory of a COM object that
  1924. // stores such state.
  1925. //
  1926. // This function can be used generically. One COM object that implements it
  1927. // is CLSID_ACListISF so that the AutoComplete engine can complete relative
  1928. // paths. SetDirectory() will set the "Current Working Directory" and
  1929. // AutoComplete with then complete both absolute and relative paths.
  1930. // For Example, if ::SetDirectory(L"C:\Program Files") is called, then
  1931. // the user can AutoComplete "..\winnt". In order to set the current
  1932. // working directory for non-file system paths, "ftp://ftp.microsoft.com/" or
  1933. // "Control Panel" for example, use IPersistFolder.
  1934. //-------------------------------------------------------------------------
  1935. #undef INTERFACE
  1936. #define INTERFACE ICurrentWorkingDirectory
  1937. DECLARE_INTERFACE_(ICurrentWorkingDirectory, IUnknown)
  1938. {
  1939. // *** IUnknown methods ***
  1940. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1941. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1942. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1943. // *** ICurrentWorkingDirectory specific methods ***
  1944. STDMETHOD(GetDirectory) (THIS_ LPWSTR pwzPath, DWORD cchSize) PURE;
  1945. STDMETHOD(SetDirectory) (THIS_ LPCWSTR pwzPath) PURE;
  1946. };
  1947. //-------------------------------------------------------------------------
  1948. //
  1949. // IACList interface
  1950. //
  1951. //
  1952. // [Member functions]
  1953. //
  1954. // IObjMgr::Expand(LPCOLESTR)
  1955. // This function tells an autocomplete list to expand a specific string.
  1956. //
  1957. // If the user enters a multi-level path, AutoComplete (CLSID_AutoComplete)
  1958. // will use this interface to tell the "AutoComplete Lists" where to expand
  1959. // the results.
  1960. //
  1961. // For Example, if the user enters "C:\Program Files\Micros", AutoComplete
  1962. // first completely enumerate the "AutoComplete Lists" via IEnumString. Then it
  1963. // will call the "AutoComplete Lists" with IACList::Expand(L"C:\Program Files").
  1964. // It will then enumerate the IEnumString interface again to get results in
  1965. // that directory.
  1966. //-------------------------------------------------------------------------
  1967. #undef INTERFACE
  1968. #define INTERFACE IACList
  1969. DECLARE_INTERFACE_(IACList, IUnknown)
  1970. {
  1971. // *** IUnknown methods ***
  1972. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1973. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1974. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1975. // *** IACList specific methods ***
  1976. STDMETHOD(Expand) (THIS_ LPCOLESTR pszExpand) PURE;
  1977. };
  1978. //-------------------------------------------------------------------------
  1979. //
  1980. // IACList2 interface
  1981. //
  1982. // [Description]
  1983. // This interface exists to allow the caller to set filter criteria
  1984. // for an AutoComplete List. AutoComplete Lists generates the list of
  1985. // possible AutoComplete completions. CLSID_ACListISF is one AutoComplete
  1986. // List COM object that implements this interface.
  1987. //-------------------------------------------------------------------------
  1988. #undef INTERFACE
  1989. #define INTERFACE IACList2
  1990. typedef enum _tagAUTOCOMPLETELISTOPTIONS
  1991. {
  1992. ACLO_NONE = 0, // don't enumerate anything
  1993. ACLO_CURRENTDIR = 1, // enumerate current directory
  1994. ACLO_MYCOMPUTER = 2, // enumerate MyComputer
  1995. ACLO_DESKTOP = 4, // enumerate Desktop Folder
  1996. ACLO_FAVORITES = 8, // enumerate Favorites Folder
  1997. ACLO_FILESYSONLY = 16, // enumerate only the file system
  1998. ACLO_FILESYSDIRS = 32, // enumerate only the file system dirs, UNC shares, and UNC servers.
  1999. } AUTOCOMPLETELISTOPTIONS;
  2000. DECLARE_INTERFACE_(IACList2, IACList)
  2001. {
  2002. // *** IACList2 specific methods ***
  2003. STDMETHOD(SetOptions)(THIS_ DWORD dwFlag) PURE;
  2004. STDMETHOD(GetOptions)(THIS_ DWORD* pdwFlag) PURE;
  2005. };
  2006. /*-------------------------------------------------------------------------*\
  2007. INTERFACE: IProgressDialog
  2008. DESCRIPTION:
  2009. CLSID_ProgressDialog/IProgressDialog exist to allow a caller to create
  2010. a progress dialog, set it's title, animation, text lines, progress, and
  2011. it will do all the work of updating on a background thread, being modless,
  2012. handling the user cancelling the operation, and estimating the time remaining
  2013. until the operation completes.
  2014. USAGE:
  2015. This is how the dialog is used during operations that require progress
  2016. and the ability to cancel:
  2017. {
  2018. DWORD dwComplete, dwTotal;
  2019. IProgressDialog * ppd;
  2020. CoCreateInstance(CLSID_ProgressDialog, NULL, CLSCTX_INPROC_SERVER, IID_IProgressDialog, (void **)&ppd);
  2021. ppd->SetTitle(L"My Slow Operation"); // Set the title of the dialog.
  2022. ppd->SetAnimation(hInstApp, IDA_OPERATION_ANIMATION); // Set the animation to play.
  2023. ppd->StartProgressDialog(hwndParent, punk, PROGDLG_AUTOTIME, NULL); // Display and enable automatic estimated time remaining.
  2024. ppd->SetCancelMsg(L"Please wait while the current operation is cleaned up", NULL); // Will only be displayed if Cancel button is pressed.
  2025. dwComplete = 0;
  2026. dwTotal = CalcTotalUnitsToDo();
  2027. // Reset because CalcTotalUnitsToDo() took a long time and the estimated time
  2028. // is based on the time between ::StartProgressDialog() and the first
  2029. // ::SetProgress() call.
  2030. ppd->Timer(PDTIMER_RESET, NULL);
  2031. for (nIndex = 0; nIndex < nTotal; nIndex++)
  2032. {
  2033. if (TRUE == ppd->HasUserCancelled())
  2034. break;
  2035. ppd->SetLine(2, L"I'm processing item n", FALSE, NULL);
  2036. dwComplete += DoSlowOperation();
  2037. ppd->SetProgress(dwCompleted, dwTotal);
  2038. }
  2039. ppd->StopProgressDialog();
  2040. ppd->Release();
  2041. }
  2042. \*-------------------------------------------------------------------------*/
  2043. // Flags for IProgressDialog::StartProgressDialog() (dwFlags)
  2044. #define PROGDLG_NORMAL 0x00000000 // default normal progress dlg behavior
  2045. #define PROGDLG_MODAL 0x00000001 // the dialog is modal to its hwndParent (default is modeless)
  2046. #define PROGDLG_AUTOTIME 0x00000002 // automatically updates the "Line3" text with the "time remaining" (you cant call SetLine3 if you passs this!)
  2047. #define PROGDLG_NOTIME 0x00000004 // we dont show the "time remaining" if this is set. We need this if dwTotal < dwCompleted for sparse files
  2048. #define PROGDLG_NOMINIMIZE 0x00000008 // Do not have a minimize button in the caption bar.
  2049. #define PROGDLG_NOPROGRESSBAR 0x00000010 // Don't display the progress bar
  2050. // Time Actions (dwTimerAction)
  2051. #define PDTIMER_RESET 0x00000001 // Reset the timer so the progress will be calculated from now until the first ::SetProgress() is called so
  2052. // those this time will correspond to the values passed to ::SetProgress(). Only do this before ::SetProgress() is called.
  2053. #undef INTERFACE
  2054. #define INTERFACE IProgressDialog
  2055. DECLARE_INTERFACE_(IProgressDialog, IUnknown)
  2056. {
  2057. // *** IUnknown methods ***
  2058. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2059. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2060. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2061. // *** IProgressDialog specific methods
  2062. STDMETHOD(StartProgressDialog)(THIS_ HWND hwndParent, IUnknown * punkEnableModless, DWORD dwFlags, LPCVOID pvResevered) PURE;
  2063. STDMETHOD(StopProgressDialog)(THIS) PURE;
  2064. STDMETHOD(SetTitle)(THIS_ LPCWSTR pwzTitle) PURE;
  2065. STDMETHOD(SetAnimation)(THIS_ HINSTANCE hInstAnimation, UINT idAnimation) PURE;
  2066. STDMETHOD_(BOOL,HasUserCancelled) (THIS) PURE;
  2067. STDMETHOD(SetProgress)(THIS_ DWORD dwCompleted, DWORD dwTotal) PURE;
  2068. STDMETHOD(SetProgress64)(THIS_ ULONGLONG ullCompleted, ULONGLONG ullTotal) PURE;
  2069. STDMETHOD(SetLine)(THIS_ DWORD dwLineNum, LPCWSTR pwzString, BOOL fCompactPath, LPCVOID pvResevered) PURE;
  2070. STDMETHOD(SetCancelMsg)(THIS_ LPCWSTR pwzCancelMsg, LPCVOID pvResevered) PURE;
  2071. STDMETHOD(Timer)(THIS_ DWORD dwTimerAction, LPCVOID pvResevered) PURE;
  2072. };
  2073. //==========================================================================
  2074. // IInputObjectSite/IInputObject interfaces
  2075. //
  2076. // These interfaces allow us (or ISVs) to install/update external Internet
  2077. // Toolbar for IE and the shell. The frame will simply get the CLSID from
  2078. // registry (to be defined) and CoCreateInstance it.
  2079. //
  2080. //==========================================================================
  2081. //-------------------------------------------------------------------------
  2082. //
  2083. // IInputObjectSite interface
  2084. //
  2085. // A site implements this interface so the object can communicate
  2086. // focus change to it.
  2087. //
  2088. // [Member functions]
  2089. //
  2090. // IInputObjectSite::OnFocusChangeIS(punkObj, fSetFocus)
  2091. // Object (punkObj) is getting or losing the focus.
  2092. //
  2093. //-------------------------------------------------------------------------
  2094. #undef INTERFACE
  2095. #define INTERFACE IInputObjectSite
  2096. DECLARE_INTERFACE_(IInputObjectSite, IUnknown)
  2097. {
  2098. // *** IUnknown methods ***
  2099. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2100. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2101. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2102. // *** IInputObjectSite specific methods ***
  2103. STDMETHOD(OnFocusChangeIS)(THIS_ IUnknown* punkObj, BOOL fSetFocus) PURE;
  2104. };
  2105. //-------------------------------------------------------------------------
  2106. //
  2107. // IInputObject interface
  2108. //
  2109. // An object implements this interface so the site can communicate
  2110. // activation and accelerator events to it.
  2111. //
  2112. // [Member functions]
  2113. //
  2114. // IInputObject::UIActivateIO(fActivate, lpMsg)
  2115. // Activates or deactivates the object. lpMsg may be NULL. Returns
  2116. // S_OK if the activation succeeded.
  2117. //
  2118. // IInputObject::HasFocusIO()
  2119. // Returns S_OK if the object has the focus, S_FALSE if not.
  2120. //
  2121. // IInputObject::TranslateAcceleratorIO(lpMsg)
  2122. // Allow the object to process the message. Returns S_OK if the
  2123. // message was processed (eaten).
  2124. //
  2125. //-------------------------------------------------------------------------
  2126. #undef INTERFACE
  2127. #define INTERFACE IInputObject
  2128. DECLARE_INTERFACE_(IInputObject, IUnknown)
  2129. {
  2130. // *** IUnknown methods ***
  2131. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2132. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2133. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2134. // *** IInputObject specific methods ***
  2135. STDMETHOD(UIActivateIO)(THIS_ BOOL fActivate, LPMSG lpMsg) PURE;
  2136. STDMETHOD(HasFocusIO)(THIS) PURE;
  2137. STDMETHOD(TranslateAcceleratorIO)(THIS_ LPMSG lpMsg) PURE;
  2138. };
  2139. //==========================================================================
  2140. // IDockingWindowSite/IDockingWindow/IDockingWindowFrame interfaces
  2141. // IInputObjectSite/IInputObject interfaces
  2142. //
  2143. // These interfaces allow us (or ISVs) to install/update external Internet
  2144. // Toolbar for IE and the shell. The frame will simply get the CLSID from
  2145. // registry (to be defined) and CoCreateInstance it.
  2146. //
  2147. //==========================================================================
  2148. //-------------------------------------------------------------------------
  2149. //
  2150. // IDockingWindowSite interface
  2151. //
  2152. // A site implements this interface so the object can negotiate for
  2153. // and inquire about real estate on the site.
  2154. //
  2155. // [Member functions]
  2156. //
  2157. // IDockingWindowSite::GetBorderDW(punkObj, prcBorder)
  2158. // Site returns the bounding rectangle of the given source object
  2159. // (punkObj).
  2160. //
  2161. // IDockingWindowSite::RequestBorderSpaceDW(punkObj, pbw)
  2162. // Object requests that the site makes room for it, as specified in
  2163. // *pbw.
  2164. //
  2165. // IDockingWindowSite::SetBorderSpaceDW(punkObj, pbw)
  2166. // Object requests that the site set the border spacing to the size
  2167. // specified in *pbw.
  2168. //
  2169. //-------------------------------------------------------------------------
  2170. #undef INTERFACE
  2171. #define INTERFACE IDockingWindowSite
  2172. DECLARE_INTERFACE_(IDockingWindowSite, IOleWindow)
  2173. {
  2174. // *** IUnknown methods ***
  2175. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2176. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2177. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2178. // *** IOleWindow methods ***
  2179. STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2180. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2181. // *** IDockingWindowSite methods ***
  2182. STDMETHOD(GetBorderDW) (THIS_ IUnknown* punkObj, LPRECT prcBorder) PURE;
  2183. STDMETHOD(RequestBorderSpaceDW) (THIS_ IUnknown* punkObj, LPCBORDERWIDTHS pbw) PURE;
  2184. STDMETHOD(SetBorderSpaceDW) (THIS_ IUnknown* punkObj, LPCBORDERWIDTHS pbw) PURE;
  2185. };
  2186. //-------------------------------------------------------------------------
  2187. //
  2188. // IDockingWindowFrame interface
  2189. //
  2190. // [Member functions]
  2191. //
  2192. // IDockingWindowFrame::AddToolbar(punkSrc, pwszItem, dwReserved)
  2193. //
  2194. // IDockingWindowFrame::RemoveToolbar(punkSrc, dwRemoveFlags)
  2195. //
  2196. // IDockingWindowFrame::FindToolbar(pwszItem, riid, ppv)
  2197. //
  2198. //-------------------------------------------------------------------------
  2199. // flags for RemoveToolbar
  2200. #define DWFRF_NORMAL 0x0000
  2201. #define DWFRF_DELETECONFIGDATA 0x0001
  2202. // flags for AddToolbar
  2203. #define DWFAF_HIDDEN 0x0001 // add hidden
  2204. #undef INTERFACE
  2205. #define INTERFACE IDockingWindowFrame
  2206. DECLARE_INTERFACE_(IDockingWindowFrame, IOleWindow)
  2207. {
  2208. // *** IUnknown methods ***
  2209. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2210. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2211. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2212. // *** IOleWindow methods ***
  2213. STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2214. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2215. // *** IDockingWindowFrame methods ***
  2216. STDMETHOD(AddToolbar) (THIS_ IUnknown* punkSrc, LPCWSTR pwszItem, DWORD dwAddFlags) PURE;
  2217. STDMETHOD(RemoveToolbar) (THIS_ IUnknown* punkSrc, DWORD dwRemoveFlags) PURE;
  2218. STDMETHOD(FindToolbar) (THIS_ LPCWSTR pwszItem, REFIID riid, void **ppv) PURE;
  2219. };
  2220. #if (_WIN32_IE >= 0x0400)
  2221. //-------------------------------------------------------------------------
  2222. //
  2223. // IRunnableTask interface
  2224. //
  2225. // This is a free threaded interface used for putting items on a background
  2226. // scheduler for execution within the view. It allows a scheduler to start and
  2227. // stop tasks on as many worker threads as it deems necessary.
  2228. //
  2229. // Run(), Kill() and Suspend() may be called from different threads.
  2230. //
  2231. // [Member functions]
  2232. //
  2233. // IRunnableTask::Run(void)
  2234. // Initiate the task to run. This should return E_PENDING if the task
  2235. // has been suspended.
  2236. //
  2237. // IRunnableTask::Kill(void)
  2238. //
  2239. // IRunnableTask::Suspend(void)
  2240. //
  2241. // IRunnableTask::Resume(void)
  2242. //
  2243. // IRunnableTask::IsRunning(void)
  2244. //
  2245. //-------------------------------------------------------------------------
  2246. // Convenient state values
  2247. #define IRTIR_TASK_NOT_RUNNING 0
  2248. #define IRTIR_TASK_RUNNING 1
  2249. #define IRTIR_TASK_SUSPENDED 2
  2250. #define IRTIR_TASK_PENDING 3
  2251. #define IRTIR_TASK_FINISHED 4
  2252. #undef INTERFACE
  2253. #define INTERFACE IRunnableTask
  2254. DECLARE_INTERFACE_( IRunnableTask, IUnknown )
  2255. {
  2256. // *** IUnknown methods ***
  2257. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  2258. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  2259. STDMETHOD_(ULONG, Release)(THIS) PURE;
  2260. // *** IRunnableTask methods ***
  2261. STDMETHOD (Run)(THIS) PURE;
  2262. STDMETHOD (Kill)(THIS_ BOOL fWait ) PURE;
  2263. STDMETHOD (Suspend)(THIS) PURE;
  2264. STDMETHOD (Resume)(THIS) PURE;
  2265. STDMETHOD_(ULONG, IsRunning)(THIS) PURE;
  2266. };
  2267. typedef IRunnableTask * LPRUNNABLETASK;
  2268. #endif
  2269. #if (_WIN32_IE >= 0x0400)
  2270. #define TASKOWNERID GUID
  2271. #define REFTASKOWNERID REFGUID
  2272. // ---IShellTaskScheduler
  2273. // An interface for interacting with and controlling a task scheduler. This
  2274. // interface does not need to be free-threaded unless the items in the queue
  2275. // interact with the scheduler as well as the main execution thread on which the
  2276. // task scheduler was created.
  2277. // IShellTaskScheduler::AddTask()
  2278. // Adds Tasks to the scheduler's background queue. The TASKOWNERID allow particular types
  2279. // of tasks to be grouped so that they can be counted or removed. The lParam allows the task
  2280. // to be associated with a particular item (for example an item in a listview).
  2281. // IShellTaskScheduler::RemoveTasks()
  2282. // Removes tasks from the scheduler's queue. These can be sepcified in terms of their TASKOWNERID
  2283. // or their LPARAM, or both, or neither (TOID_NULL && ITSAT_DEFAULT_LPARAM results in all tasks being
  2284. // removed). If a task that matches is currently running and ITaskScheduler::Status() has been
  2285. // passeed ITSSFLAG_KILL_ON_DESTROY then the scheduler will attempt to kill the current task. The
  2286. // fWaitIfRunning parameter is then passed to IRunnableTask::Kill().
  2287. // IShellTaskScheduler::CountTasks()
  2288. // Counts the tasks in the queue depending upon the TASKOWNERID and the LPARAM passed. (TOID_NULL and
  2289. // ITSAT_DEFAULT_LPARAM will count all tasks in the queue)
  2290. // IShellTaskScheduler::Status()
  2291. // This sets the ReleaseStatus for the current task and the background thread timeout. When
  2292. // ITaskScheduler::RemoveTasks() is called and there is a task currently running that matches
  2293. // ITSSFLAG_COMPLETE_ON_DESTROY will cause TRUE to be passed to the task's IRunnableTask::Kill().
  2294. // The dwThreadTimeout parameter if not set to the default will cause the background thread to
  2295. // die if no new tasks have been added to the queue in the timeout period. The Thread will be
  2296. // recreated when the next new task is added.
  2297. ////////////////////////
  2298. // Status() flags,
  2299. // wait for the current task to complete before deleting the scheduler
  2300. #define ITSSFLAG_COMPLETE_ON_DESTROY 0x0000
  2301. // kill the current task (if there is one) when the task scheduler is deleted
  2302. #define ITSSFLAG_KILL_ON_DESTROY 0x0001
  2303. #define ITSSFLAG_SUPPORTS_TERMINATE 0x0002
  2304. #define ITSSFLAG_FLAGS_MASK 0x0003
  2305. // set the timeout for killing the thread when the object is terminated.
  2306. // this timeout can be used to stop the object from blocking the system
  2307. // indefinitely.
  2308. #define ITSSFLAG_THREAD_TERMINATE_TIMEOUT 0x0010
  2309. // set the timeout for threads that are idle in the thread pool
  2310. #define ITSSFLAG_THREAD_POOL_TIMEOUT 0x0020
  2311. // The default timeout passed to release Status to determine how long the thread
  2312. // can be asleep before the thread is expired
  2313. #define ITSS_THREAD_DESTROY_DEFAULT_TIMEOUT (60*1000)
  2314. // default, we won't kill it...
  2315. #define ITSS_THREAD_TERMINATE_TIMEOUT (INFINITE)
  2316. // there is no change to the thread timeout
  2317. #define ITSS_THREAD_TIMEOUT_NO_CHANGE (INFINITE - 1)
  2318. // the LPARAM allows task to be associated with items thus all tasks owned by a
  2319. // particular item can be accessed by passing a non default value for this parameter
  2320. #define ITSAT_DEFAULT_LPARAM 0xffffffff
  2321. // Task priorities
  2322. // ---------------
  2323. // This depends on the cooperation of tasks currently under execution. New tasks will
  2324. // be inserted in the queue in priority order. If a task of a low priority is currently
  2325. // under execution when a higher priority task is added, the scheduler will attempt
  2326. // to suspend the task currently under execution. It will be resumed when the other tasks
  2327. // have been completed.
  2328. #define ITSAT_DEFAULT_PRIORITY 0x10000000
  2329. #define ITSAT_MAX_PRIORITY 0x7fffffff
  2330. #define ITSAT_MIN_PRIORITY 0x00000000
  2331. #define TOID_NULL CLSID_NULL
  2332. #undef INTERFACE
  2333. #define INTERFACE IShellTaskScheduler
  2334. DECLARE_INTERFACE_( IShellTaskScheduler, IUnknown )
  2335. {
  2336. // *** IUnknown methods ***
  2337. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  2338. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  2339. STDMETHOD_(ULONG, Release)(THIS) PURE;
  2340. // *** IShellTaskScheduler methods ***
  2341. STDMETHOD (AddTask)(THIS_ IRunnableTask * pTask,
  2342. REFTASKOWNERID rtoid,
  2343. DWORD_PTR lParam,
  2344. DWORD dwPriority ) PURE;
  2345. STDMETHOD (RemoveTasks)(THIS_ REFTASKOWNERID rtoid,
  2346. DWORD_PTR lParam,
  2347. BOOL fWaitIfRunning ) PURE;
  2348. STDMETHOD_(UINT, CountTasks)(THIS_ REFTASKOWNERID rtoid) PURE;
  2349. STDMETHOD (Status)(THIS_ DWORD dwReleaseStatus, DWORD dwThreadTimeout ) PURE;
  2350. };
  2351. typedef IShellTaskScheduler * LPSHELLTASKSCHEDULER;
  2352. #if (_WIN32_IE >= 0x0501)
  2353. #define ITSSFLAG_TASK_PLACEINFRONT 0x00000001
  2354. #define ITSSFLAG_TASK_PLACEINBACK 0x00000002
  2355. #undef INTERFACE
  2356. #define INTERFACE IShellTaskScheduler2
  2357. DECLARE_INTERFACE_( IShellTaskScheduler2, IShellTaskScheduler )
  2358. {
  2359. // *** IUnknown methods ***
  2360. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  2361. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  2362. STDMETHOD_(ULONG, Release)(THIS) PURE;
  2363. // *** IShellTaskScheduler methods ***
  2364. STDMETHOD (AddTask)(THIS_ IRunnableTask * pTask,
  2365. REFTASKOWNERID rtoid,
  2366. DWORD_PTR lParam,
  2367. DWORD dwPriority ) PURE;
  2368. STDMETHOD (RemoveTasks)(THIS_ REFTASKOWNERID rtoid,
  2369. DWORD_PTR lParam,
  2370. BOOL fWaitIfRunning ) PURE;
  2371. STDMETHOD_(UINT, CountTasks)(THIS_ REFTASKOWNERID rtoid) PURE;
  2372. STDMETHOD (Status)(THIS_ DWORD dwReleaseStatus, DWORD dwThreadTimeout ) PURE;
  2373. // *** IShellTaskScheduler2 methods ***
  2374. STDMETHOD (AddTask2)(THIS_ IRunnableTask * pTask,
  2375. REFTASKOWNERID rtoid,
  2376. DWORD_PTR lParam,
  2377. DWORD dwPriority,
  2378. DWORD grfFlags ) PURE;
  2379. STDMETHOD (MoveTask)(THIS_ REFTASKOWNERID rtoid,
  2380. DWORD_PTR lParam,
  2381. DWORD dwPriority,
  2382. DWORD grfFlags ) PURE;
  2383. };
  2384. #endif // (_WIN32_IE >= 0x0501)
  2385. #endif // (_WIN32_IE >= 0x0400)
  2386. #if (_WIN32_IE >= 0x0400)
  2387. /* ***************** IThumbnailCapture
  2388. * CaptureThumbnail : takes an IHTMLDocument2 and returns a thumbnail of specified
  2389. * size as an hbitmap
  2390. */
  2391. #undef INTERFACE
  2392. #define INTERFACE IThumbnailCapture
  2393. DECLARE_INTERFACE_ ( IThumbnailCapture, IUnknown )
  2394. {
  2395. // *** IThumbnailCapture methods ***
  2396. STDMETHOD (CaptureThumbnail) ( THIS_ const SIZE * pMaxSize,
  2397. IUnknown * pHTMLDoc2,
  2398. HBITMAP * phbmThumbnail ) PURE;
  2399. };
  2400. typedef IThumbnailCapture * LPTHUMBNAILCAPTURE;
  2401. #endif
  2402. #if (_WIN32_IE >= 0x0500)
  2403. #include <pshpack8.h>
  2404. typedef struct _EnumImageStoreDATAtag
  2405. {
  2406. WCHAR szPath[MAX_PATH];
  2407. FILETIME ftTimeStamp;
  2408. } ENUMSHELLIMAGESTOREDATA, * PENUMSHELLIMAGESTOREDATA;
  2409. #include <poppack.h> /* Return to byte packing */
  2410. #undef INTERFACE
  2411. #define INTERFACE IEnumShellImageStore
  2412. DECLARE_INTERFACE_( IEnumShellImageStore, IUnknown )
  2413. {
  2414. STDMETHOD ( QueryInterface ) ( THIS_ REFIID riid, void **ppv ) PURE;
  2415. STDMETHOD_( ULONG, AddRef ) ( THIS ) PURE;
  2416. STDMETHOD_( ULONG, Release ) ( THIS ) PURE;
  2417. STDMETHOD ( Reset ) ( THIS ) PURE;
  2418. STDMETHOD ( Next ) ( THIS_ ULONG celt, PENUMSHELLIMAGESTOREDATA * prgElt, ULONG * pceltFetched ) PURE;
  2419. STDMETHOD ( Skip ) ( THIS_ ULONG celt ) PURE;
  2420. STDMETHOD ( Clone ) ( THIS_ IEnumShellImageStore ** ppEnum ) PURE;
  2421. };
  2422. typedef IEnumShellImageStore * LPENUMSHELLIMAGESTORE;
  2423. // flags used to determine the capabilities of the storage for the images
  2424. #define SHIMSTCAPFLAG_LOCKABLE 0x0001 // does the store require/support locking
  2425. #define SHIMSTCAPFLAG_PURGEABLE 0x0002 // does the store require dead items purging externally ?
  2426. #undef INTERFACE
  2427. #define INTERFACE IShellImageStore
  2428. // this interface is used to manipulate the Image cache. It can potentially be used
  2429. // in a free threaded manner in conjunction with the Lock parameter to Open and close
  2430. DECLARE_INTERFACE_( IShellImageStore, IUnknown )
  2431. {
  2432. STDMETHOD ( QueryInterface )( THIS_ REFIID riid, void **ppv ) PURE;
  2433. STDMETHOD_( ULONG, AddRef ) ( THIS ) PURE;
  2434. STDMETHOD_( ULONG, Release ) ( THIS ) PURE;
  2435. // if the lock parameter is used, then all other calls into
  2436. // open and/or create will block until the lock is released.
  2437. STDMETHOD ( Open ) ( THIS_ DWORD dwMode, DWORD * pdwLock ) PURE;
  2438. STDMETHOD ( Create ) ( THIS_ DWORD dwMode, DWORD * pdwLock ) PURE;
  2439. // if the lock is passed to either of these two methods, it releases the lock
  2440. // once the operation is complete.
  2441. STDMETHOD ( ReleaseLock ) ( THIS_ DWORD const * pdwLock ) PURE;
  2442. STDMETHOD ( Close ) ( THIS_ DWORD const * pdwLock ) PURE;
  2443. STDMETHOD ( Commit ) ( THIS_ DWORD const * pdwLock ) PURE;
  2444. STDMETHOD ( IsLocked ) ( THIS ) PURE;
  2445. STDMETHOD ( GetMode ) ( THIS_ DWORD * pdwMode ) PURE;
  2446. STDMETHOD ( GetCapabilities ) ( THIS_ DWORD * pdwCapMask ) PURE;
  2447. STDMETHOD ( AddEntry ) ( THIS_ LPCWSTR pszName, const FILETIME * pftTimeStamp, DWORD dwMode, HBITMAP hImage ) PURE;
  2448. STDMETHOD ( GetEntry ) ( THIS_ LPCWSTR pszName, DWORD dwMode, HBITMAP * phImage ) PURE;
  2449. STDMETHOD ( DeleteEntry ) ( THIS_ LPCWSTR pszName ) PURE;
  2450. STDMETHOD ( IsEntryInStore ) ( THIS_ LPCWSTR pszName, FILETIME * pftTimeStamp ) PURE;
  2451. STDMETHOD ( Enum ) ( THIS_ LPENUMSHELLIMAGESTORE * ppEnum ) PURE;
  2452. };
  2453. typedef IShellImageStore * LPSHELLIMAGESTORE;
  2454. #endif
  2455. #if (_WIN32_IE >= 0x0400)
  2456. //// IShellFolderBand
  2457. // Field mask
  2458. #define ISFB_MASK_STATE 0x00000001 // TRUE if dwStateMask and dwState is valid
  2459. #define ISFB_MASK_BKCOLOR 0x00000002 // TRUE if crBkgnd field is valid
  2460. #define ISFB_MASK_VIEWMODE 0x00000004 // TRUE if wViewMode field is valid
  2461. #define ISFB_MASK_SHELLFOLDER 0x00000008
  2462. #define ISFB_MASK_IDLIST 0x00000010
  2463. #define ISFB_MASK_COLORS 0x00000020 // TRUE if crXXXX fields are valid (except bkgnd)
  2464. #define ISFB_STATE_DEFAULT 0x00000000
  2465. #define ISFB_STATE_DEBOSSED 0x00000001
  2466. #define ISFB_STATE_ALLOWRENAME 0x00000002
  2467. #define ISFB_STATE_NOSHOWTEXT 0x00000004 // TRUE if _fNoShowText
  2468. #define ISFB_STATE_CHANNELBAR 0x00000010 // TRUE if we want NavigateTarget support
  2469. #define ISFB_STATE_QLINKSMODE 0x00000020 // TRUE if we want to turn off drag & drop onto content items
  2470. #define ISFB_STATE_FULLOPEN 0x00000040 // TRUE if band should maximize when opened
  2471. #define ISFB_STATE_NONAMESORT 0x00000080 // TRUE if band should _not_ sort icons by name
  2472. #define ISFB_STATE_BTNMINSIZE 0x00000100 // TRUE if band should report min thickness of button
  2473. #define ISFBVIEWMODE_SMALLICONS 0x0001
  2474. #define ISFBVIEWMODE_LARGEICONS 0x0002
  2475. #define ISFBVIEWMODE_LOGOS 0x0003
  2476. #include <pshpack8.h>
  2477. typedef struct {
  2478. DWORD dwMask; // [in] ISFB_MASK mask of valid fields from crBkgnd on
  2479. DWORD dwStateMask; // [in] ISFB_STATE mask of dwState bits being set/queried
  2480. DWORD dwState; // [in/out] ISFB_STATE bits
  2481. COLORREF crBkgnd; // [in/out]
  2482. COLORREF crBtnLt; // [in/out]
  2483. COLORREF crBtnDk; // [in/out]
  2484. WORD wViewMode; // [in/out]
  2485. WORD wAlign; // not used (yet)
  2486. IShellFolder * psf; // [out]
  2487. LPITEMIDLIST pidl; // [out]
  2488. } BANDINFOSFB, *PBANDINFOSFB;
  2489. #include <poppack.h> /* Return to byte packing */
  2490. #undef INTERFACE
  2491. #define INTERFACE IShellFolderBand
  2492. DECLARE_INTERFACE_(IShellFolderBand, IUnknown)
  2493. {
  2494. // *** IUnknown methods ***
  2495. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2496. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2497. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2498. // *** IShellFolderBand Methods ***
  2499. STDMETHOD(InitializeSFB)(THIS_ IShellFolder *psf, LPCITEMIDLIST pidl) PURE;
  2500. STDMETHOD(SetBandInfoSFB)(THIS_ PBANDINFOSFB pbi) PURE;
  2501. STDMETHOD(GetBandInfoSFB)(THIS_ PBANDINFOSFB pbi) PURE;
  2502. };
  2503. // Command Target IDs
  2504. enum {
  2505. SFBID_PIDLCHANGED,
  2506. };
  2507. //// IDeskBarClient
  2508. #undef INTERFACE
  2509. #define INTERFACE IDeskBarClient
  2510. DECLARE_INTERFACE_(IDeskBarClient, IOleWindow)
  2511. {
  2512. // *** IUnknown methods ***
  2513. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2514. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2515. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2516. // *** IOleWindow methods ***
  2517. STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2518. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2519. // *** IDeskBarClient methods ***
  2520. STDMETHOD(SetDeskBarSite) (THIS_ IUnknown* punkSite) PURE;
  2521. STDMETHOD(SetModeDBC) (THIS_ DWORD dwMode) PURE;
  2522. STDMETHOD(UIActivateDBC) (THIS_ DWORD dwState) PURE;
  2523. STDMETHOD(GetSize) (THIS_ DWORD dwWhich, LPRECT prc) PURE;
  2524. };
  2525. #define DBC_GS_IDEAL 0 // get the ideal size
  2526. #define DBC_GS_SIZEDOWN 1 // clip the height of a rect to a multiple of the rebar's integral size
  2527. #define DBC_HIDE 0 // Band is hidden (being destroyed)
  2528. #define DBC_SHOW 1 // Band is visible
  2529. #define DBC_SHOWOBSCURE 2 // Band is completely obscured
  2530. enum {
  2531. DBCID_EMPTY = 0, // bandsite is empty
  2532. DBCID_ONDRAG = 1, // (down)DragMoveEnter/Leave vaIn:I4:eDrag
  2533. DBCID_CLSIDOFBAR = 2, // clsid of bar inside
  2534. DBCID_RESIZE = 3, // resize from keyboard
  2535. DBCID_GETBAR = 4, // returns vaOut:VT_UNKNOWN of hosting dockbar (IDeskBar)
  2536. };
  2537. #endif // (_WIN32_IE > 0x0400)
  2538. #if (_WIN32_IE >= 0x400)
  2539. //
  2540. // We need to make sure that WININET.H is included before this interface is
  2541. // used because the COMPONENT structure uses INTERNET_MAX_URL_LENGTH
  2542. //
  2543. #ifdef _WININET_
  2544. //
  2545. // Flags and structures used by IActiveDesktop
  2546. //
  2547. typedef struct _tagWALLPAPEROPT
  2548. {
  2549. DWORD dwSize; // size of this Structure.
  2550. DWORD dwStyle; // WPSTYLE_* mentioned above
  2551. }
  2552. WALLPAPEROPT;
  2553. typedef WALLPAPEROPT *LPWALLPAPEROPT;
  2554. typedef const WALLPAPEROPT *LPCWALLPAPEROPT;
  2555. typedef struct _tagCOMPONENTSOPT
  2556. {
  2557. DWORD dwSize; //Size of this structure
  2558. BOOL fEnableComponents; //Enable components?
  2559. BOOL fActiveDesktop; // Active desktop enabled ?
  2560. }
  2561. COMPONENTSOPT;
  2562. typedef COMPONENTSOPT *LPCOMPONENTSOPT;
  2563. typedef const COMPONENTSOPT *LPCCOMPONENTSOPT;
  2564. typedef struct _tagCOMPPOS
  2565. {
  2566. DWORD dwSize; //Size of this structure
  2567. int iLeft; //Left of top-left corner in screen co-ordinates.
  2568. int iTop; //Top of top-left corner in screen co-ordinates.
  2569. DWORD dwWidth; // Width in pixels.
  2570. DWORD dwHeight; // Height in pixels.
  2571. int izIndex; // Indicates the Z-order of the component.
  2572. BOOL fCanResize; // Is the component resizeable?
  2573. BOOL fCanResizeX; // Resizeable in X-direction?
  2574. BOOL fCanResizeY; // Resizeable in Y-direction?
  2575. int iPreferredLeftPercent; //Left of top-left corner as percent of screen width
  2576. int iPreferredTopPercent; //Top of top-left corner as percent of screen height
  2577. }
  2578. COMPPOS;
  2579. typedef COMPPOS *LPCOMPPOS;
  2580. typedef const COMPPOS *LPCCOMPPOS;
  2581. typedef struct _tagCOMPSTATEINFO
  2582. {
  2583. DWORD dwSize; // Size of this structure.
  2584. int iLeft; // Left of the top-left corner in screen co-ordinates.
  2585. int iTop; // Top of top-left corner in screen co-ordinates.
  2586. DWORD dwWidth; // Width in pixels.
  2587. DWORD dwHeight; // Height in pixels.
  2588. DWORD dwItemState; // State of the component (full-screen mode or split-screen or normal state.
  2589. }
  2590. COMPSTATEINFO;
  2591. typedef COMPSTATEINFO *LPCOMPSTATEINFO;
  2592. typedef const COMPSTATEINFO *LPCCOMPSTATEINFO;
  2593. #define COMPONENT_TOP (0x3fffffff) // izOrder value meaning component is at the top
  2594. // iCompType values
  2595. #define COMP_TYPE_HTMLDOC 0
  2596. #define COMP_TYPE_PICTURE 1
  2597. #define COMP_TYPE_WEBSITE 2
  2598. #define COMP_TYPE_CONTROL 3
  2599. #define COMP_TYPE_CFHTML 4
  2600. #define COMP_TYPE_MAX 4
  2601. // The following is the COMPONENT structure used in IE4.01, IE4.0 and Memphis. It is kept here for compatibility
  2602. // reasons.
  2603. typedef struct _tagIE4COMPONENT
  2604. {
  2605. DWORD dwSize; //Size of this structure
  2606. DWORD dwID; //Reserved: Set it always to zero.
  2607. int iComponentType; //One of COMP_TYPE_*
  2608. BOOL fChecked; // Is this component enabled?
  2609. BOOL fDirty; // Had the component been modified and not yet saved to disk?
  2610. BOOL fNoScroll; // Is the component scrollable?
  2611. COMPPOS cpPos; // Width, height etc.,
  2612. WCHAR wszFriendlyName[MAX_PATH]; // Friendly name of component.
  2613. WCHAR wszSource[INTERNET_MAX_URL_LENGTH]; //URL of the component.
  2614. WCHAR wszSubscribedURL[INTERNET_MAX_URL_LENGTH]; //Subscrined URL
  2615. }
  2616. IE4COMPONENT;
  2617. typedef IE4COMPONENT *LPIE4COMPONENT;
  2618. typedef const IE4COMPONENT *LPCIE4COMPONENT;
  2619. //
  2620. // The following is the new NT5 component structure. Note that the initial portion of this component exactly
  2621. // matches the IE4COMPONENT structure. All new fields are added at the bottom and the dwSize field is used to
  2622. // distinguish between IE4COMPONENT and the new COMPONENT structures.
  2623. //
  2624. typedef struct _tagCOMPONENT
  2625. {
  2626. DWORD dwSize; //Size of this structure
  2627. DWORD dwID; //Reserved: Set it always to zero.
  2628. int iComponentType; //One of COMP_TYPE_*
  2629. BOOL fChecked; // Is this component enabled?
  2630. BOOL fDirty; // Had the component been modified and not yet saved to disk?
  2631. BOOL fNoScroll; // Is the component scrollable?
  2632. COMPPOS cpPos; // Width, height etc.,
  2633. WCHAR wszFriendlyName[MAX_PATH]; // Friendly name of component.
  2634. WCHAR wszSource[INTERNET_MAX_URL_LENGTH]; //URL of the component.
  2635. WCHAR wszSubscribedURL[INTERNET_MAX_URL_LENGTH]; //Subscrined URL
  2636. //New fields are added below. Everything above here must exactly match the IE4COMPONENT Structure.
  2637. DWORD dwCurItemState; // Current state of the Component.
  2638. COMPSTATEINFO csiOriginal; // Original state of the component when it was first added.
  2639. COMPSTATEINFO csiRestored; // Restored state of the component.
  2640. }
  2641. COMPONENT;
  2642. typedef COMPONENT *LPCOMPONENT;
  2643. typedef const COMPONENT *LPCCOMPONENT;
  2644. // Defines for dwCurItemState
  2645. #define IS_NORMAL 0x00000001
  2646. #define IS_FULLSCREEN 0x00000002
  2647. #define IS_SPLIT 0x00000004
  2648. #define IS_VALIDSIZESTATEBITS (IS_NORMAL | IS_SPLIT | IS_FULLSCREEN) // The set of IS_* state bits which define the "size" of the component - these bits are mutually exclusive.
  2649. #define IS_VALIDSTATEBITS (IS_NORMAL | IS_SPLIT | IS_FULLSCREEN | 0x80000000 | 0x40000000) // All of the currently defined IS_* bits.
  2650. ////////////////////////////////////////////
  2651. // Flags for IActiveDesktop::ApplyChanges()
  2652. #define AD_APPLY_SAVE 0x00000001
  2653. #define AD_APPLY_HTMLGEN 0x00000002
  2654. #define AD_APPLY_REFRESH 0x00000004
  2655. #define AD_APPLY_ALL (AD_APPLY_SAVE | AD_APPLY_HTMLGEN | AD_APPLY_REFRESH)
  2656. #define AD_APPLY_FORCE 0x00000008
  2657. #define AD_APPLY_BUFFERED_REFRESH 0x00000010
  2658. #define AD_APPLY_DYNAMICREFRESH 0x00000020
  2659. ////////////////////////////////////////////
  2660. // Flags for IActiveDesktop::GetWallpaperOptions()
  2661. // IActiveDesktop::SetWallpaperOptions()
  2662. #define WPSTYLE_CENTER 0
  2663. #define WPSTYLE_TILE 1
  2664. #define WPSTYLE_STRETCH 2
  2665. #define WPSTYLE_MAX 3
  2666. ////////////////////////////////////////////
  2667. // Flags for IActiveDesktop::ModifyComponent()
  2668. #define COMP_ELEM_TYPE 0x00000001
  2669. #define COMP_ELEM_CHECKED 0x00000002
  2670. #define COMP_ELEM_DIRTY 0x00000004
  2671. #define COMP_ELEM_NOSCROLL 0x00000008
  2672. #define COMP_ELEM_POS_LEFT 0x00000010
  2673. #define COMP_ELEM_POS_TOP 0x00000020
  2674. #define COMP_ELEM_SIZE_WIDTH 0x00000040
  2675. #define COMP_ELEM_SIZE_HEIGHT 0x00000080
  2676. #define COMP_ELEM_POS_ZINDEX 0x00000100
  2677. #define COMP_ELEM_SOURCE 0x00000200
  2678. #define COMP_ELEM_FRIENDLYNAME 0x00000400
  2679. #define COMP_ELEM_SUBSCRIBEDURL 0x00000800
  2680. #define COMP_ELEM_ORIGINAL_CSI 0x00001000
  2681. #define COMP_ELEM_RESTORED_CSI 0x00002000
  2682. #define COMP_ELEM_CURITEMSTATE 0x00004000
  2683. #define COMP_ELEM_ALL (COMP_ELEM_TYPE | COMP_ELEM_CHECKED | COMP_ELEM_DIRTY | \
  2684. COMP_ELEM_NOSCROLL | COMP_ELEM_POS_LEFT | COMP_ELEM_SIZE_WIDTH | \
  2685. COMP_ELEM_SIZE_HEIGHT | COMP_ELEM_POS_ZINDEX | COMP_ELEM_SOURCE | \
  2686. COMP_ELEM_FRIENDLYNAME | COMP_ELEM_POS_TOP | COMP_ELEM_SUBSCRIBEDURL | \
  2687. COMP_ELEM_ORIGINAL_CSI | COMP_ELEM_RESTORED_CSI | COMP_ELEM_CURITEMSTATE)
  2688. ////////////////////////////////////////////
  2689. // Flags for IActiveDesktop::AddDesktopItemWithUI()
  2690. typedef enum tagDTI_ADTIWUI
  2691. {
  2692. DTI_ADDUI_DEFAULT = 0x00000000,
  2693. DTI_ADDUI_DISPSUBWIZARD = 0x00000001,
  2694. DTI_ADDUI_POSITIONITEM = 0x00000002,
  2695. };
  2696. ////////////////////////////////////////////
  2697. // Flags for IActiveDesktop::AddUrl()
  2698. #define ADDURL_SILENT 0X0001
  2699. ////////////////////////////////////////////
  2700. // Default positions for ADI
  2701. #define COMPONENT_DEFAULT_LEFT (0xFFFF)
  2702. #define COMPONENT_DEFAULT_TOP (0xFFFF)
  2703. //
  2704. // Interface for manipulating the Active Desktop.
  2705. //
  2706. #undef INTERFACE
  2707. #define INTERFACE IActiveDesktop
  2708. DECLARE_INTERFACE_( IActiveDesktop, IUnknown )
  2709. {
  2710. // IUnknown methods
  2711. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  2712. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  2713. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  2714. // IActiveDesktop methods
  2715. STDMETHOD (ApplyChanges)(THIS_ DWORD dwFlags) PURE;
  2716. STDMETHOD (GetWallpaper)(THIS_ LPWSTR pwszWallpaper, UINT cchWallpaper, DWORD dwReserved) PURE;
  2717. STDMETHOD (SetWallpaper)(THIS_ LPCWSTR pwszWallpaper, DWORD dwReserved) PURE;
  2718. STDMETHOD (GetWallpaperOptions)(THIS_ LPWALLPAPEROPT pwpo, DWORD dwReserved) PURE;
  2719. STDMETHOD (SetWallpaperOptions)(THIS_ LPCWALLPAPEROPT pwpo, DWORD dwReserved) PURE;
  2720. STDMETHOD (GetPattern)(THIS_ LPWSTR pwszPattern, UINT cchPattern, DWORD dwReserved) PURE;
  2721. STDMETHOD (SetPattern)(THIS_ LPCWSTR pwszPattern, DWORD dwReserved) PURE;
  2722. STDMETHOD (GetDesktopItemOptions)(THIS_ LPCOMPONENTSOPT pco, DWORD dwReserved) PURE;
  2723. STDMETHOD (SetDesktopItemOptions)(THIS_ LPCCOMPONENTSOPT pco, DWORD dwReserved) PURE;
  2724. STDMETHOD (AddDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwReserved) PURE;
  2725. STDMETHOD (AddDesktopItemWithUI)(THIS_ HWND hwnd, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2726. STDMETHOD (ModifyDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwFlags) PURE;
  2727. STDMETHOD (RemoveDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwReserved) PURE;
  2728. STDMETHOD (GetDesktopItemCount)(THIS_ LPINT lpiCount, DWORD dwReserved) PURE;
  2729. STDMETHOD (GetDesktopItem)(THIS_ int nComponent, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2730. STDMETHOD (GetDesktopItemByID)(THIS_ ULONG_PTR dwID, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2731. STDMETHOD (GenerateDesktopItemHtml)(THIS_ LPCWSTR pwszFileName, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2732. STDMETHOD (AddUrl)(THIS_ HWND hwnd, LPCWSTR pszSource, LPCOMPONENT pcomp, DWORD dwFlags) PURE;
  2733. STDMETHOD (GetDesktopItemBySource)(THIS_ LPCWSTR pwszSource, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2734. };
  2735. typedef IActiveDesktop * LPACTIVEDESKTOP;
  2736. // Flags for SetSafeMode
  2737. #define SSM_CLEAR 0x0000
  2738. #define SSM_SET 0x0001
  2739. #define SSM_REFRESH 0x0002
  2740. #define SSM_UPDATE 0x0004
  2741. // Flags for Set/GetScheme
  2742. #define SCHEME_DISPLAY 0x0001
  2743. #define SCHEME_EDIT 0x0002
  2744. #define SCHEME_LOCAL 0x0004
  2745. #define SCHEME_GLOBAL 0x0008
  2746. #define SCHEME_REFRESH 0x0010
  2747. #define SCHEME_UPDATE 0x0020
  2748. #define SCHEME_DONOTUSE 0x0040 // used to be SCHEME_ENUMERATE; no longer supported
  2749. #define SCHEME_CREATE 0x0080
  2750. #undef INTERFACE
  2751. #define INTERFACE IActiveDesktopP
  2752. DECLARE_INTERFACE_( IActiveDesktopP, IUnknown )
  2753. {
  2754. // IUnknown methods
  2755. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  2756. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  2757. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  2758. // IActiveDesktopP methods
  2759. STDMETHOD (SetSafeMode)(THIS_ DWORD dwFlags) PURE;
  2760. STDMETHOD (EnsureUpdateHTML)(THIS) PURE;
  2761. STDMETHOD (SetScheme)(THIS_ LPCWSTR pwszSchemeName, DWORD dwFlags) PURE;
  2762. STDMETHOD (GetScheme)(THIS_ LPWSTR pwszSchemeName, DWORD *lpdwcchBuffer, DWORD dwFlags) PURE;
  2763. //
  2764. };
  2765. typedef IActiveDesktopP * LPACTIVEDESKTOPP;
  2766. //Flags for GetObjectFlags
  2767. #define GADOF_DIRTY 0x00000001
  2768. #undef INTERFACE
  2769. #define INTERFACE IADesktopP2
  2770. DECLARE_INTERFACE_( IADesktopP2, IUnknown )
  2771. {
  2772. // IUnknown methods
  2773. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  2774. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  2775. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  2776. // IADesktopP2 methods
  2777. STDMETHOD (ReReadWallpaper)(THIS) PURE;
  2778. STDMETHOD (GetADObjectFlags)(THIS_ DWORD *lpdwFlags, DWORD dwMask) PURE;
  2779. STDMETHOD (UpdateAllDesktopSubscriptions)(THIS) PURE;
  2780. STDMETHOD (MakeDynamicChanges)(THIS_ IOleObject *pOleObj) PURE;
  2781. };
  2782. typedef IADesktopP2 * LPADESKTOPP2;
  2783. #endif // _WININET_
  2784. #if (_WIN32_IE >= 0x0500)
  2785. #define MAX_COLUMN_NAME_LEN 80
  2786. #define MAX_COLUMN_DESC_LEN 128
  2787. #include <pshpack1.h>
  2788. typedef struct {
  2789. SHCOLUMNID scid; // OUT the unique identifier of this column
  2790. VARTYPE vt; // OUT the native type of the data returned
  2791. DWORD fmt; // OUT this listview format (LVCFMT_LEFT, usually)
  2792. UINT cChars; // OUT the default width of the column, in characters
  2793. DWORD csFlags; // OUT SHCOLSTATE flags
  2794. WCHAR wszTitle[MAX_COLUMN_NAME_LEN]; // OUT the title of the column
  2795. WCHAR wszDescription[MAX_COLUMN_DESC_LEN]; // OUT full description of this column
  2796. } SHCOLUMNINFO, *LPSHCOLUMNINFO;
  2797. typedef const SHCOLUMNINFO* LPCSHCOLUMNINFO;
  2798. #include <poppack.h> /* Return to default */
  2799. #include <pshpack8.h>
  2800. typedef struct {
  2801. ULONG dwFlags; // initialization flags
  2802. ULONG dwReserved; // reserved for future use.
  2803. WCHAR wszFolder[MAX_PATH]; // fully qualified folder path (or empty if multiple folders)
  2804. } SHCOLUMNINIT, *LPSHCOLUMNINIT;
  2805. typedef const SHCOLUMNINIT* LPCSHCOLUMNINIT;
  2806. #define SHCDF_UPDATEITEM 0x00000001 // this flag is a hint that the file has changed since the last call to GetItemData
  2807. typedef struct {
  2808. ULONG dwFlags; // combination of SHCDF_ flags.
  2809. DWORD dwFileAttributes; // file attributes.
  2810. ULONG dwReserved; // reserved for future use.
  2811. WCHAR* pwszExt; // address of file name extension
  2812. WCHAR wszFile[MAX_PATH]; // Absolute path of file.
  2813. } SHCOLUMNDATA, *LPSHCOLUMNDATA;
  2814. typedef const SHCOLUMNDATA* LPCSHCOLUMNDATA;
  2815. #include <poppack.h> /* Return to byte packing */
  2816. #undef INTERFACE
  2817. #define INTERFACE IColumnProvider
  2818. // Note: these objects must be threadsafe! GetItemData _will_ be called
  2819. // simultaneously from multiple threads.
  2820. DECLARE_INTERFACE_(IColumnProvider, IUnknown)
  2821. {
  2822. // IUnknown methods
  2823. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  2824. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  2825. STDMETHOD_(ULONG, Release)(THIS) PURE;
  2826. // IColumnProvider methods
  2827. STDMETHOD (Initialize)(THIS_ LPCSHCOLUMNINIT psci) PURE;
  2828. STDMETHOD (GetColumnInfo)(THIS_ DWORD dwIndex, SHCOLUMNINFO *psci) PURE;
  2829. STDMETHOD (GetItemData)(THIS_ LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, VARIANT *pvarData) PURE;
  2830. };
  2831. ///////////////////////////////////////////////////////
  2832. //
  2833. // Drag and Drop helper
  2834. //
  2835. // Purpose: To expose the Shell drag images
  2836. //
  2837. // This interface is implemented in the shell by CLSID_DragDropHelper.
  2838. //
  2839. // To use:
  2840. // If you are the source of a drag (i.e. in response to LV_DRAGBEGIN or
  2841. // equivelent begin drag message) call
  2842. // IDragSourceHelper::InitializeFromWindow
  2843. // (<hwnd of window supporting DI_GETDRAGIMAGE>,
  2844. // <pointer to POINT indicating offset to the mouse from
  2845. // the upper left corner of the image>,
  2846. // <pointer to data object>)
  2847. //
  2848. // NOTE: The Data object must support IDataObject::SetData with multiple
  2849. // data types and GetData must implement data type cloning
  2850. // (Including HGLOBAL), not just aliasing.
  2851. //
  2852. // If you wish to have an image while over your application add the
  2853. // IDragImages::Dr* calls to your IDropTarget implementation. For Example:
  2854. //
  2855. // STDMETHODIMP CUserDropTarget::DragEnter(IDataObject* pDataObject,
  2856. // DWORD grfKeyState,
  2857. // POINTL pt, DWORD* pdwEffect)
  2858. // {
  2859. // // Process your DragEnter
  2860. // // Call IDragImages::DragEnter last.
  2861. // _pDropTargetHelper->DragEnter(_hwndDragOver, pDataObject,
  2862. // (POINT*)&pt, *pdwEffect);
  2863. // return hres;
  2864. // }
  2865. //
  2866. //
  2867. // If you wish to be able to source a drag image from a custom control,
  2868. // implement a handler for the RegisterWindowMessage(DI_GETDRAGIMAGE).
  2869. // The LPARAM is a pointer to an SHDRAGIMAGE structure.
  2870. //
  2871. // sizeDragImage - Calculate the length and width required to render
  2872. // the images.
  2873. // ptOffset - Calculate the offset from the upper left corner to
  2874. // the mouse cursor within the image
  2875. // hbmpDragImage - CreateBitmap( sizeDragImage.cx, sizeDragImage.cy,
  2876. // GetDeviceCaps(hdcScreen, PLANES),
  2877. // GetDeviceCaps(hdcScreen, BITSPIXEL),
  2878. // NULL);
  2879. //
  2880. // Drag Images will only be displayed on Windows NT 5.0 or later.
  2881. //
  2882. //
  2883. // Note about IDropTargetHelper::Show - This method is provided for
  2884. // showing/hiding the Drag image in low color depth video modes. When
  2885. // painting to a window that is currently being dragged over (i.e. For
  2886. // indicating a selection) you need to hide the drag image by calling this
  2887. // method passing FALSE. After the window is done painting, Show the image
  2888. // again by passing TRUE.
  2889. #include <pshpack8.h>
  2890. typedef struct
  2891. {
  2892. SIZE sizeDragImage; // OUT - The length and Width of the
  2893. // rendered image
  2894. POINT ptOffset; // OUT - The Offset from the mouse cursor to
  2895. // the upper left corner of the image
  2896. HBITMAP hbmpDragImage; // OUT - The Bitmap containing the rendered
  2897. // drag images
  2898. COLORREF crColorKey; // OUT - The COLORREF that has been blitted
  2899. // to the background of the images
  2900. } SHDRAGIMAGE, *LPSHDRAGIMAGE;
  2901. #include <poppack.h> /* Return to byte packing */
  2902. // This is sent to a window to get the rendered images to a bitmap
  2903. // Call RegisterWindowMessage to get the ID
  2904. #define DI_GETDRAGIMAGE TEXT("ShellGetDragImage")
  2905. #undef INTERFACE
  2906. #define INTERFACE IDropTargetHelper
  2907. DECLARE_INTERFACE_( IDropTargetHelper, IUnknown )
  2908. {
  2909. // IUnknown methods
  2910. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  2911. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  2912. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  2913. // IDropTargetHelper
  2914. STDMETHOD (DragEnter)(THIS_ HWND hwndTarget, IDataObject* pDataObject,
  2915. POINT* ppt, DWORD dwEffect) PURE;
  2916. STDMETHOD (DragLeave)(THIS) PURE;
  2917. STDMETHOD (DragOver)(THIS_ POINT* ppt, DWORD dwEffect) PURE;
  2918. STDMETHOD (Drop)(THIS_ IDataObject* pDataObject, POINT* ppt,
  2919. DWORD dwEffect) PURE;
  2920. STDMETHOD (Show)(THIS_ BOOL fShow) PURE;
  2921. };
  2922. #undef INTERFACE
  2923. #define INTERFACE IDragSourceHelper
  2924. DECLARE_INTERFACE_( IDragSourceHelper, IUnknown )
  2925. {
  2926. // IUnknown methods
  2927. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  2928. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  2929. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  2930. // IDragSourceHelper
  2931. STDMETHOD (InitializeFromBitmap)(THIS_ LPSHDRAGIMAGE pshdi,
  2932. IDataObject* pDataObject) PURE;
  2933. STDMETHOD (InitializeFromWindow)(THIS_ HWND hwnd, POINT* ppt,
  2934. IDataObject* pDataObject) PURE;
  2935. };
  2936. #endif // (_WIN32_IE >= 0x0500)
  2937. #endif // _WIN32_IE
  2938. //==========================================================================
  2939. // Clipboard format which may be supported by IDataObject from system
  2940. // defined shell folders (such as directories, network, ...).
  2941. //==========================================================================
  2942. #define CFSTR_SHELLIDLIST TEXT("Shell IDList Array") // CF_IDLIST
  2943. #define CFSTR_SHELLIDLISTOFFSET TEXT("Shell Object Offsets") // CF_OBJECTPOSITIONS
  2944. #define CFSTR_NETRESOURCES TEXT("Net Resource") // CF_NETRESOURCE
  2945. #define CFSTR_FILEDESCRIPTORA TEXT("FileGroupDescriptor") // CF_FILEGROUPDESCRIPTORA
  2946. #define CFSTR_FILEDESCRIPTORW TEXT("FileGroupDescriptorW") // CF_FILEGROUPDESCRIPTORW
  2947. #define CFSTR_FILECONTENTS TEXT("FileContents") // CF_FILECONTENTS
  2948. #define CFSTR_FILENAMEA TEXT("FileName") // CF_FILENAMEA
  2949. #define CFSTR_FILENAMEW TEXT("FileNameW") // CF_FILENAMEW
  2950. #define CFSTR_PRINTERGROUP TEXT("PrinterFriendlyName") // CF_PRINTERS
  2951. #define CFSTR_FILENAMEMAPA TEXT("FileNameMap") // CF_FILENAMEMAPA
  2952. #define CFSTR_FILENAMEMAPW TEXT("FileNameMapW") // CF_FILENAMEMAPW
  2953. #define CFSTR_SHELLURL TEXT("UniformResourceLocator")
  2954. #define CFSTR_INETURLA CFSTR_SHELLURL
  2955. #define CFSTR_INETURLW TEXT("UniformResourceLocatorW")
  2956. #define CFSTR_PREFERREDDROPEFFECT TEXT("Preferred DropEffect")
  2957. #define CFSTR_PERFORMEDDROPEFFECT TEXT("Performed DropEffect")
  2958. #define CFSTR_PASTESUCCEEDED TEXT("Paste Succeeded")
  2959. #define CFSTR_INDRAGLOOP TEXT("InShellDragLoop")
  2960. #define CFSTR_DRAGCONTEXT TEXT("DragContext")
  2961. #define CFSTR_MOUNTEDVOLUME TEXT("MountedVolume")
  2962. #define CFSTR_PERSISTEDDATAOBJECT TEXT("PersistedDataObject")
  2963. #define CFSTR_TARGETCLSID TEXT("TargetCLSID") // HGLOBAL with a CLSID of the drop target
  2964. #define CFSTR_LOGICALPERFORMEDDROPEFFECT TEXT("Logical Performed DropEffect")
  2965. #define CFSTR_AUTOPLAY_SHELLIDLISTS TEXT("Autoplay Enumerated IDList Array") // (HGLOBAL with LPIDA)
  2966. #ifdef UNICODE
  2967. #define CFSTR_FILEDESCRIPTOR CFSTR_FILEDESCRIPTORW
  2968. #define CFSTR_FILENAME CFSTR_FILENAMEW
  2969. #define CFSTR_FILENAMEMAP CFSTR_FILENAMEMAPW
  2970. #define CFSTR_INETURL CFSTR_INETURLW
  2971. #else
  2972. #define CFSTR_FILEDESCRIPTOR CFSTR_FILEDESCRIPTORA
  2973. #define CFSTR_FILENAME CFSTR_FILENAMEA
  2974. #define CFSTR_FILENAMEMAP CFSTR_FILENAMEMAPA
  2975. #define CFSTR_INETURL CFSTR_INETURLA
  2976. #endif
  2977. #define DVASPECT_SHORTNAME 2 // use for CF_HDROP to get short name version of file paths
  2978. #define DVASPECT_COPY 3 // use to indicate format is a "Copy" of the data (FILECONTENTS, FILEDESCRIPTOR, etc)
  2979. #define DVASPECT_LINK 4 // use to indicate format is a "Shortcut" to the data (FILECONTENTS, FILEDESCRIPTOR, etc)
  2980. #include <pshpack8.h>
  2981. //
  2982. // format of CF_NETRESOURCE
  2983. //
  2984. typedef struct _NRESARRAY { // anr
  2985. UINT cItems;
  2986. NETRESOURCE nr[1];
  2987. } NRESARRAY, * LPNRESARRAY;
  2988. #include <poppack.h> /* Return to byte packing */
  2989. //
  2990. // format of CF_IDLIST
  2991. //
  2992. typedef struct _IDA {
  2993. UINT cidl; // number of relative IDList
  2994. UINT aoffset[1]; // [0]: folder IDList, [1]-[cidl]: item IDList
  2995. } CIDA, * LPIDA;
  2996. //
  2997. // FILEDESCRIPTOR.dwFlags field indicate which fields are to be used
  2998. //
  2999. typedef enum {
  3000. FD_CLSID = 0x0001,
  3001. FD_SIZEPOINT = 0x0002,
  3002. FD_ATTRIBUTES = 0x0004,
  3003. FD_CREATETIME = 0x0008,
  3004. FD_ACCESSTIME = 0x0010,
  3005. FD_WRITESTIME = 0x0020,
  3006. FD_FILESIZE = 0x0040,
  3007. FD_PROGRESSUI = 0x4000, // Show Progress UI w/Drag and Drop
  3008. FD_LINKUI = 0x8000, // 'link' UI is prefered
  3009. } FD_FLAGS;
  3010. typedef struct _FILEDESCRIPTORA { // fod
  3011. DWORD dwFlags;
  3012. CLSID clsid;
  3013. SIZEL sizel;
  3014. POINTL pointl;
  3015. DWORD dwFileAttributes;
  3016. FILETIME ftCreationTime;
  3017. FILETIME ftLastAccessTime;
  3018. FILETIME ftLastWriteTime;
  3019. DWORD nFileSizeHigh;
  3020. DWORD nFileSizeLow;
  3021. CHAR cFileName[ MAX_PATH ];
  3022. } FILEDESCRIPTORA, *LPFILEDESCRIPTORA;
  3023. typedef struct _FILEDESCRIPTORW { // fod
  3024. DWORD dwFlags;
  3025. CLSID clsid;
  3026. SIZEL sizel;
  3027. POINTL pointl;
  3028. DWORD dwFileAttributes;
  3029. FILETIME ftCreationTime;
  3030. FILETIME ftLastAccessTime;
  3031. FILETIME ftLastWriteTime;
  3032. DWORD nFileSizeHigh;
  3033. DWORD nFileSizeLow;
  3034. WCHAR cFileName[ MAX_PATH ];
  3035. } FILEDESCRIPTORW, *LPFILEDESCRIPTORW;
  3036. #ifdef UNICODE
  3037. #define FILEDESCRIPTOR FILEDESCRIPTORW
  3038. #define LPFILEDESCRIPTOR LPFILEDESCRIPTORW
  3039. #else
  3040. #define FILEDESCRIPTOR FILEDESCRIPTORA
  3041. #define LPFILEDESCRIPTOR LPFILEDESCRIPTORA
  3042. #endif
  3043. //
  3044. // format of CF_FILEGROUPDESCRIPTOR
  3045. //
  3046. typedef struct _FILEGROUPDESCRIPTORA { // fgd
  3047. UINT cItems;
  3048. FILEDESCRIPTORA fgd[1];
  3049. } FILEGROUPDESCRIPTORA, * LPFILEGROUPDESCRIPTORA;
  3050. typedef struct _FILEGROUPDESCRIPTORW { // fgd
  3051. UINT cItems;
  3052. FILEDESCRIPTORW fgd[1];
  3053. } FILEGROUPDESCRIPTORW, * LPFILEGROUPDESCRIPTORW;
  3054. #ifdef UNICODE
  3055. #define FILEGROUPDESCRIPTOR FILEGROUPDESCRIPTORW
  3056. #define LPFILEGROUPDESCRIPTOR LPFILEGROUPDESCRIPTORW
  3057. #else
  3058. #define FILEGROUPDESCRIPTOR FILEGROUPDESCRIPTORA
  3059. #define LPFILEGROUPDESCRIPTOR LPFILEGROUPDESCRIPTORA
  3060. #endif
  3061. //
  3062. // format of CF_HDROP and CF_PRINTERS, in the HDROP case the data that follows
  3063. // is a double null terinated list of file names, for printers they are printer
  3064. // friendly names
  3065. //
  3066. typedef struct _DROPFILES {
  3067. DWORD pFiles; // offset of file list
  3068. POINT pt; // drop point (client coords)
  3069. BOOL fNC; // is it on NonClient area
  3070. // and pt is in screen coords
  3071. BOOL fWide; // WIDE character switch
  3072. } DROPFILES, *LPDROPFILES;
  3073. //====== File System Notification APIs ===============================
  3074. //
  3075. typedef struct _SHChangeNotifyEntry
  3076. {
  3077. LPCITEMIDLIST pidl;
  3078. BOOL fRecursive;
  3079. } SHChangeNotifyEntry;
  3080. //
  3081. // File System Notification flags
  3082. //
  3083. #define SHCNE_RENAMEITEM 0x00000001L
  3084. #define SHCNE_CREATE 0x00000002L
  3085. #define SHCNE_DELETE 0x00000004L
  3086. #define SHCNE_MKDIR 0x00000008L
  3087. #define SHCNE_RMDIR 0x00000010L
  3088. #define SHCNE_MEDIAINSERTED 0x00000020L
  3089. #define SHCNE_MEDIAREMOVED 0x00000040L
  3090. #define SHCNE_DRIVEREMOVED 0x00000080L
  3091. #define SHCNE_DRIVEADD 0x00000100L
  3092. #define SHCNE_NETSHARE 0x00000200L
  3093. #define SHCNE_NETUNSHARE 0x00000400L
  3094. #define SHCNE_ATTRIBUTES 0x00000800L
  3095. #define SHCNE_UPDATEDIR 0x00001000L
  3096. #define SHCNE_UPDATEITEM 0x00002000L
  3097. #define SHCNE_SERVERDISCONNECT 0x00004000L
  3098. #define SHCNE_UPDATEIMAGE 0x00008000L
  3099. #define SHCNE_DRIVEADDGUI 0x00010000L
  3100. #define SHCNE_RENAMEFOLDER 0x00020000L
  3101. #define SHCNE_FREESPACE 0x00040000L
  3102. #if (_WIN32_IE >= 0x0400)
  3103. // SHCNE_EXTENDED_EVENT: the extended event is identified in dwItem1,
  3104. // packed in LPITEMIDLIST format (same as SHCNF_DWORD packing).
  3105. // Additional information can be passed in the dwItem2 parameter
  3106. // of SHChangeNotify (called "pidl2" below), which if present, must also
  3107. // be in LPITEMIDLIST format.
  3108. //
  3109. // Unlike the standard events, the extended events are ORDINALs, so we
  3110. // don't run out of bits. Extended events follow the SHCNEE_* naming
  3111. // convention.
  3112. //
  3113. // The dwItem2 parameter varies according to the extended event.
  3114. #define SHCNE_EXTENDED_EVENT 0x04000000L
  3115. #endif // (_WIN32_IE >= 0x0400)
  3116. #define SHCNE_ASSOCCHANGED 0x08000000L
  3117. #define SHCNE_DISKEVENTS 0x0002381FL
  3118. #define SHCNE_GLOBALEVENTS 0x0C0581E0L // Events that dont match pidls first
  3119. #define SHCNE_ALLEVENTS 0x7FFFFFFFL
  3120. #define SHCNE_INTERRUPT 0x80000000L // The presence of this flag indicates
  3121. // that the event was generated by an
  3122. // interrupt. It is stripped out before
  3123. // the clients of SHCNNotify_ see it.
  3124. #if (_WIN32_IE >= 0x0400)
  3125. // SHCNE_EXTENDED_EVENT extended events. These events are ordinals.
  3126. // This is not a bitfield.
  3127. #define SHCNEE_ORDERCHANGED 2L // pidl2 is the changed folder
  3128. #define SHCNEE_MSI_CHANGE 4L // pidl2 is a SHChangeProductKeyAsIDList
  3129. #define SHCNEE_MSI_UNINSTALL 5L // pidl2 is a SHChangeProductKeyAsIDList
  3130. #endif
  3131. // Flags
  3132. // uFlags & SHCNF_TYPE is an ID which indicates what dwItem1 and dwItem2 mean
  3133. #define SHCNF_IDLIST 0x0000 // LPITEMIDLIST
  3134. #define SHCNF_PATHA 0x0001 // path name
  3135. #define SHCNF_PRINTERA 0x0002 // printer friendly name
  3136. #define SHCNF_DWORD 0x0003 // DWORD
  3137. #define SHCNF_PATHW 0x0005 // path name
  3138. #define SHCNF_PRINTERW 0x0006 // printer friendly name
  3139. #define SHCNF_TYPE 0x00FF
  3140. #define SHCNF_FLUSH 0x1000
  3141. #define SHCNF_FLUSHNOWAIT 0x2000
  3142. #ifdef UNICODE
  3143. #define SHCNF_PATH SHCNF_PATHW
  3144. #define SHCNF_PRINTER SHCNF_PRINTERW
  3145. #else
  3146. #define SHCNF_PATH SHCNF_PATHA
  3147. #define SHCNF_PRINTER SHCNF_PRINTERA
  3148. #endif
  3149. //
  3150. // APIs
  3151. //
  3152. SHSTDAPI_(void) SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2);
  3153. //
  3154. // IShellChangeNotify
  3155. //
  3156. #undef INTERFACE
  3157. #define INTERFACE IShellChangeNotify
  3158. DECLARE_INTERFACE_(IShellChangeNotify, IUnknown)
  3159. {
  3160. // *** IUnknown methods ***
  3161. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3162. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3163. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3164. // *** IShellChangeNotify methods ***
  3165. STDMETHOD(OnChange) (THIS_ LONG lEvent, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  3166. } ;
  3167. //
  3168. // IQueryInfo
  3169. //
  3170. //-------------------------------------------------------------------------
  3171. //
  3172. // IQueryInfo interface
  3173. //
  3174. // [Methods]
  3175. // ::GetInfoTip()
  3176. //-------------------------------------------------------------------------
  3177. #undef INTERFACE
  3178. #define INTERFACE IQueryInfo
  3179. DECLARE_INTERFACE_(IQueryInfo, IUnknown)
  3180. {
  3181. // *** IUnknown methods ***
  3182. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3183. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3184. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3185. // *** IQueryInfo methods ***
  3186. STDMETHOD(GetInfoTip)(THIS_ DWORD dwFlags, WCHAR **ppwszTip) PURE;
  3187. STDMETHOD(GetInfoFlags)(THIS_ DWORD *pdwFlags) PURE;
  3188. } ;
  3189. #define QITIPF_DEFAULT 0x00000000
  3190. #define QITIPF_USENAME 0x00000001
  3191. #define QITIPF_LINKNOTARGET 0x00000002
  3192. #define QITIPF_LINKUSETARGET 0x00000004
  3193. #define QITIPF_USESLOWTIP 0x00000008 // Flag says it's OK to take a long time generating tip
  3194. #define QIF_CACHED 0x00000001
  3195. #define QIF_DONTEXPANDFOLDER 0x00000002
  3196. //
  3197. // SHAddToRecentDocs
  3198. //
  3199. #define SHARD_PIDL 0x00000001L
  3200. #define SHARD_PATHA 0x00000002L
  3201. #define SHARD_PATHW 0x00000003L
  3202. #ifdef UNICODE
  3203. #define SHARD_PATH SHARD_PATHW
  3204. #else
  3205. #define SHARD_PATH SHARD_PATHA
  3206. #endif
  3207. SHSTDAPI_(void) SHAddToRecentDocs(UINT uFlags, LPCVOID pv);
  3208. typedef struct _SHChangeDWORDAsIDList {
  3209. USHORT cb;
  3210. DWORD dwItem1;
  3211. DWORD dwItem2;
  3212. USHORT cbZero;
  3213. } SHChangeDWORDAsIDList, *LPSHChangeDWORDAsIDList;
  3214. #if (_WIN32_IE >= 0x0400)
  3215. typedef struct _SHChangeUpdateImageIDList {
  3216. USHORT cb;
  3217. int iIconIndex;
  3218. int iCurIndex;
  3219. UINT uFlags;
  3220. DWORD dwProcessID;
  3221. WCHAR szName[MAX_PATH];
  3222. USHORT cbZero;
  3223. } SHChangeUpdateImageIDList, * LPSHChangeUpdateImageIDList;
  3224. SHSTDAPI_(int) SHHandleUpdateImage( LPCITEMIDLIST pidlExtra );
  3225. typedef struct _SHChangeProductKeyAsIDList {
  3226. USHORT cb;
  3227. WCHAR wszProductKey[39];
  3228. USHORT cbZero;
  3229. } SHChangeProductKeyAsIDList, *LPSHChangeProductKeyAsIDList;
  3230. SHSTDAPI_(void) SHUpdateImageA(LPCSTR pszHashItem, int iIndex, UINT uFlags, int iImageIndex);
  3231. SHSTDAPI_(void) SHUpdateImageW(LPCWSTR pszHashItem, int iIndex, UINT uFlags, int iImageIndex);
  3232. #ifdef UNICODE
  3233. #define SHUpdateImage SHUpdateImageW
  3234. #else
  3235. #define SHUpdateImage SHUpdateImageA
  3236. #endif // !UNICODE
  3237. #endif /* _WIN32_IE */
  3238. SHSTDAPI_(ULONG) SHChangeNotifyRegister(HWND hwnd, int fSources, LONG fEvents, UINT wMsg, int cEntries, SHChangeNotifyEntry *pshcne);
  3239. SHSTDAPI_(BOOL) SHChangeNotifyDeregister(unsigned long ulID);
  3240. SHSTDAPI_(HANDLE) SHChangeNotification_Lock(HANDLE hChangeNotification, DWORD dwProcessId, LPITEMIDLIST **pppidl, LONG *plEvent);
  3241. SHSTDAPI_(BOOL) SHChangeNotification_Unlock(HANDLE hLock);
  3242. #if (_WIN32_IE >= 0x0400)
  3243. // The pidls that are given to the view via the ChangeNotifyEvents are simple Pidls,
  3244. // SHGetRealIDL() will convert them to true PIDLs.
  3245. SHSTDAPI SHGetRealIDL(IShellFolder *psf, LPCITEMIDLIST pidlSimple, LPITEMIDLIST * ppidlReal);
  3246. #endif // (_WIN32_IE >= 0x0400)
  3247. SHSTDAPI SHGetInstanceExplorer(IUnknown **ppunk);
  3248. //
  3249. // SHGetDataFromIDListA/W
  3250. //
  3251. // SHGetDataFromIDList nFormat values TCHAR
  3252. #define SHGDFIL_FINDDATA 1
  3253. #define SHGDFIL_NETRESOURCE 2
  3254. #define SHGDFIL_DESCRIPTIONID 3
  3255. #define SHDID_ROOT_REGITEM 1
  3256. #define SHDID_FS_FILE 2
  3257. #define SHDID_FS_DIRECTORY 3
  3258. #define SHDID_FS_OTHER 4
  3259. #define SHDID_COMPUTER_DRIVE35 5
  3260. #define SHDID_COMPUTER_DRIVE525 6
  3261. #define SHDID_COMPUTER_REMOVABLE 7
  3262. #define SHDID_COMPUTER_FIXED 8
  3263. #define SHDID_COMPUTER_NETDRIVE 9
  3264. #define SHDID_COMPUTER_CDROM 10
  3265. #define SHDID_COMPUTER_RAMDISK 11
  3266. #define SHDID_COMPUTER_OTHER 12
  3267. #define SHDID_NET_DOMAIN 13
  3268. #define SHDID_NET_SERVER 14
  3269. #define SHDID_NET_SHARE 15
  3270. #define SHDID_NET_RESTOFNET 16
  3271. #define SHDID_NET_OTHER 17
  3272. #define SHDID_COMPUTER_IMAGING 18
  3273. #define SHDID_COMPUTER_AUDIO 19
  3274. #define SHDID_COMPUTER_SHAREDDOCS 20
  3275. #include <pshpack8.h>
  3276. typedef struct _SHDESCRIPTIONID {
  3277. DWORD dwDescriptionId;
  3278. CLSID clsid;
  3279. } SHDESCRIPTIONID, *LPSHDESCRIPTIONID;
  3280. #include <poppack.h> /* Return to byte packing */
  3281. // these delegate to IShellFolder2::GetItemData()
  3282. SHSTDAPI SHGetDataFromIDListA(IShellFolder *psf, LPCITEMIDLIST pidl, int nFormat, void *pv, int cb);
  3283. SHSTDAPI SHGetDataFromIDListW(IShellFolder *psf, LPCITEMIDLIST pidl, int nFormat, void *pv, int cb);
  3284. #ifdef UNICODE
  3285. #define SHGetDataFromIDList SHGetDataFromIDListW
  3286. #else
  3287. #define SHGetDataFromIDList SHGetDataFromIDListA
  3288. #endif // !UNICODE
  3289. //===========================================================================
  3290. // PathResolve flags
  3291. #define PRF_VERIFYEXISTS 0x0001
  3292. #define PRF_TRYPROGRAMEXTENSIONS (0x0002 | PRF_VERIFYEXISTS)
  3293. #define PRF_FIRSTDIRDEF 0x0004
  3294. #define PRF_DONTFINDLNK 0x0008 // if PRF_TRYPROGRAMEXTENSIONS is specified
  3295. SHSTDAPI_(int) RestartDialog(HWND hwnd, LPCWSTR lpPrompt, DWORD dwReturn);
  3296. SHSTDAPI_(int) RestartDialogEx(HWND hwnd, LPCWSTR lpPrompt, DWORD dwReturn, DWORD dwReasonCode);
  3297. SHSTDAPI SHCoCreateInstance(LPCWSTR pszCLSID, const CLSID *pclsid, IUnknown *pUnkOuter, REFIID riid, void **ppv);
  3298. // For CallCPLEntry16
  3299. //
  3300. DECLARE_HANDLE(FARPROC16);
  3301. SHSTDAPI_(LRESULT) CallCPLEntry16(HINSTANCE hinst, FARPROC16 lpfnEntry, HWND hwndCPL, UINT msg, LPARAM lParam1, LPARAM lParam2);
  3302. SHSTDAPI SHCreateStdEnumFmtEtc(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **ppenumFormatEtc);
  3303. SHSTDAPI SHDoDragDrop(HWND hwnd, IDataObject *pdata, IDropSource *pdsrc, DWORD dwEffect, DWORD *pdwEffect);
  3304. // stuff for doing auto scrolling
  3305. #define NUM_POINTS 3
  3306. typedef struct { // asd
  3307. int iNextSample;
  3308. DWORD dwLastScroll;
  3309. BOOL bFull;
  3310. POINT pts[NUM_POINTS];
  3311. DWORD dwTimes[NUM_POINTS];
  3312. } AUTO_SCROLL_DATA;
  3313. SHSTDAPI_(BOOL) DAD_SetDragImage(HIMAGELIST him, POINT * pptOffset);
  3314. SHSTDAPI_(BOOL) DAD_DragEnterEx(HWND hwndTarget, const POINT ptStart);
  3315. SHSTDAPI_(BOOL) DAD_DragEnterEx2(HWND hwndTarget, const POINT ptStart, IDataObject *pdtObject);
  3316. SHSTDAPI_(BOOL) DAD_ShowDragImage(BOOL fShow);
  3317. SHSTDAPI_(BOOL) DAD_DragMove(POINT pt);
  3318. SHSTDAPI_(BOOL) DAD_DragLeave(void);
  3319. SHSTDAPI_(BOOL) DAD_AutoScroll(HWND hwnd, AUTO_SCROLL_DATA *pad, const POINT *pptNow);
  3320. typedef struct {
  3321. WORD cLength;
  3322. WORD nVersion;
  3323. BOOL fFullPathTitle : 1;
  3324. BOOL fSaveLocalView : 1;
  3325. BOOL fNotShell : 1;
  3326. BOOL fSimpleDefault : 1;
  3327. BOOL fDontShowDescBar : 1;
  3328. BOOL fNewWindowMode : 1;
  3329. BOOL fShowCompColor : 1; // NT: Show compressed volumes in a different colour
  3330. BOOL fDontPrettyNames : 1; // NT: Do 8.3 name conversion, or not!
  3331. BOOL fAdminsCreateCommonGroups : 1; // NT: Administrators create comon groups
  3332. UINT fUnusedFlags : 7;
  3333. UINT fMenuEnumFilter;
  3334. } CABINETSTATE, * LPCABINETSTATE;
  3335. #define CABINETSTATE_VERSION 2
  3336. // APIs for reading and writing the cabinet state.
  3337. SHSTDAPI_(BOOL) ReadCabinetState( LPCABINETSTATE lpState, int iSize );
  3338. SHSTDAPI_(BOOL) WriteCabinetState( LPCABINETSTATE lpState );
  3339. SHSTDAPI_(BOOL) PathMakeUniqueName(LPWSTR pszUniqueName, UINT cchMax, LPCWSTR pszTemplate, LPCWSTR pszLongPlate, LPCWSTR pszDir);
  3340. SHSTDAPI_(void) PathQualify(LPWSTR psz);
  3341. SHSTDAPI_(BOOL) PathIsExe(LPCWSTR pszPath);
  3342. SHSTDAPI_(BOOL) PathIsSlowA(LPCSTR pszFile, DWORD dwAttr);
  3343. SHSTDAPI_(BOOL) PathIsSlowW(LPCWSTR pszFile, DWORD dwAttr);
  3344. #ifdef UNICODE
  3345. #define PathIsSlow PathIsSlowW
  3346. #else
  3347. #define PathIsSlow PathIsSlowA
  3348. #endif // !UNICODE
  3349. //
  3350. // Return codes from PathCleanupSpec. Negative return values are
  3351. // unrecoverable errors
  3352. //
  3353. #define PCS_FATAL 0x80000000
  3354. #define PCS_REPLACEDCHAR 0x00000001
  3355. #define PCS_REMOVEDCHAR 0x00000002
  3356. #define PCS_TRUNCATED 0x00000004
  3357. #define PCS_PATHTOOLONG 0x00000008 // Always combined with FATAL
  3358. SHSTDAPI_(int) PathCleanupSpec(LPCWSTR pszDir, LPWSTR pszSpec);
  3359. SHSTDAPI_(int) PathResolve(LPWSTR pszPath, LPCWSTR dirs[], UINT fFlags);
  3360. SHSTDAPI_(BOOL) GetFileNameFromBrowse(HWND hwnd, LPWSTR pszFilePath, UINT cbFilePath,
  3361. LPCWSTR pszWorkingDir, LPCWSTR pszDefExt, LPCWSTR pszFilters, LPCWSTR pszTitle);
  3362. SHSTDAPI_(int) DriveType(int iDrive);
  3363. SHSTDAPI_(int) RealDriveType(int iDrive, BOOL fOKToHitNet);
  3364. SHSTDAPI_(int) IsNetDrive(int iDrive);
  3365. // Flags for Shell_MergeMenus
  3366. #define MM_ADDSEPARATOR 0x00000001L
  3367. #define MM_SUBMENUSHAVEIDS 0x00000002L
  3368. #define MM_DONTREMOVESEPS 0x00000004L
  3369. SHSTDAPI_(UINT) Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags);
  3370. /*
  3371. * The SHObjectProperties API provides an easy way to invoke
  3372. * the Properties context menu command on shell objects.
  3373. *
  3374. * PARAMETERS
  3375. *
  3376. * hwnd The window handle of the window which will own the dialog
  3377. * dwType A SHOP_ value as defined below
  3378. * lpObject Name of the object, see SHOP_ values below
  3379. * lpPage The name of the property sheet page to open to or NULL.
  3380. *
  3381. * RETURN
  3382. *
  3383. * TRUE if the Properties command was invoked
  3384. */
  3385. SHSTDAPI_(BOOL) SHObjectProperties(HWND hwnd, DWORD dwType, LPCWSTR lpObject, LPCWSTR lpPage);
  3386. #define SHOP_PRINTERNAME 0x00000001 // lpObject points to a printer friendly name
  3387. #define SHOP_FILEPATH 0x00000002 // lpObject points to a fully qualified path+file name
  3388. #define SHOP_VOLUMEGUID 0x00000004 // lpObject points to a Volume GUID
  3389. /*
  3390. * The SHFormatDrive API provides access to the Shell
  3391. * format dialog. This allows apps which want to format disks
  3392. * to bring up the same dialog that the Shell does to do it.
  3393. *
  3394. * This dialog is not sub-classable. You cannot put custom
  3395. * controls in it. If you want this ability, you will have
  3396. * to write your own front end for the DMaint_FormatDrive
  3397. * engine.
  3398. *
  3399. * NOTE that the user can format as many diskettes in the specified
  3400. * drive, or as many times, as he/she wishes to. There is no way to
  3401. * force any specififc number of disks to format. If you want this
  3402. * ability, you will have to write your own front end for the
  3403. * DMaint_FormatDrive engine.
  3404. *
  3405. * NOTE also that the format will not start till the user pushes the
  3406. * start button in the dialog. There is no way to do auto start. If
  3407. * you want this ability, you will have to write your own front end
  3408. * for the DMaint_FormatDrive engine.
  3409. *
  3410. * PARAMETERS
  3411. *
  3412. * hwnd = The window handle of the window which will own the dialog
  3413. * NOTE that unlike SHCheckDrive, hwnd == NULL does not cause
  3414. * this dialog to come up as a "top level application" window.
  3415. * This parameter should always be non-null, this dialog is
  3416. * only designed to be the child of another window, not a
  3417. * stand-alone application.
  3418. * drive = The 0 based (A: == 0) drive number of the drive to format
  3419. * fmtID = The ID of the physical format to format the disk with
  3420. * NOTE: The special value SHFMT_ID_DEFAULT means "use the
  3421. * default format specified by the DMaint_FormatDrive
  3422. * engine". If you want to FORCE a particular format
  3423. * ID "up front" you will have to call
  3424. * DMaint_GetFormatOptions yourself before calling
  3425. * this to obtain the valid list of phys format IDs
  3426. * (contents of the PhysFmtIDList array in the
  3427. * FMTINFOSTRUCT).
  3428. * options = There is currently only two option bits defined
  3429. *
  3430. * SHFMT_OPT_FULL
  3431. * SHFMT_OPT_SYSONLY
  3432. *
  3433. * The normal defualt in the Shell format dialog is
  3434. * "Quick Format", setting this option bit indicates that
  3435. * the caller wants to start with FULL format selected
  3436. * (this is useful for folks detecting "unformatted" disks
  3437. * and wanting to bring up the format dialog).
  3438. *
  3439. * The SHFMT_OPT_SYSONLY initializes the dialog to
  3440. * default to just sys the disk.
  3441. *
  3442. * All other bits are reserved for future expansion and
  3443. * must be 0.
  3444. *
  3445. * Please note that this is a bit field and not a value
  3446. * and treat it accordingly.
  3447. *
  3448. * RETURN
  3449. * The return is either one of the SHFMT_* values, or if the
  3450. * returned DWORD value is not == to one of these values, then
  3451. * the return is the physical format ID of the last succesful
  3452. * format. The LOWORD of this value can be passed on subsequent
  3453. * calls as the fmtID parameter to "format the same type you did
  3454. * last time".
  3455. *
  3456. */
  3457. SHSTDAPI_(DWORD) SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options);
  3458. //
  3459. // Special value of fmtID which means "use the default format"
  3460. //
  3461. #define SHFMT_ID_DEFAULT 0xFFFF
  3462. //
  3463. // Option bits for options parameter
  3464. //
  3465. #define SHFMT_OPT_FULL 0x0001
  3466. #define SHFMT_OPT_SYSONLY 0x0002
  3467. //
  3468. // Special return values. PLEASE NOTE that these are DWORD values.
  3469. //
  3470. #define SHFMT_ERROR 0xFFFFFFFFL // Error on last format, drive may be formatable
  3471. #define SHFMT_CANCEL 0xFFFFFFFEL // Last format was canceled
  3472. #define SHFMT_NOFORMAT 0xFFFFFFFDL // Drive is not formatable
  3473. #ifndef HPSXA_DEFINED
  3474. #define HPSXA_DEFINED
  3475. DECLARE_HANDLE( HPSXA );
  3476. #endif
  3477. WINSHELLAPI HPSXA SHCreatePropSheetExtArray( HKEY hKey, LPCWSTR pszSubKey, UINT max_iface );
  3478. WINSHELLAPI void SHDestroyPropSheetExtArray( HPSXA hpsxa );
  3479. WINSHELLAPI UINT SHAddFromPropSheetExtArray( HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam );
  3480. WINSHELLAPI UINT SHReplaceFromPropSheetExtArray( HPSXA hpsxa, UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam );
  3481. SHSTDAPI_(LPITEMIDLIST) ILClone(LPCITEMIDLIST pidl);
  3482. SHSTDAPI_(LPITEMIDLIST) ILGetNext(LPCITEMIDLIST pidl);
  3483. SHSTDAPI_(UINT) ILGetSize(LPCITEMIDLIST pidl);
  3484. SHSTDAPI_(LPITEMIDLIST) ILFindLastID(LPCITEMIDLIST pidl);
  3485. SHSTDAPI_(BOOL) ILRemoveLastID(LPITEMIDLIST pidl);
  3486. SHSTDAPI_(LPITEMIDLIST) ILAppendID(LPITEMIDLIST pidl, LPCSHITEMID pmkid, BOOL fAppend);
  3487. SHSTDAPI_(void) ILFree(LPITEMIDLIST pidl);
  3488. SHSTDAPI_(LPITEMIDLIST) ILCloneFirst(LPCITEMIDLIST pidl);
  3489. SHSTDAPI_(BOOL) ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
  3490. SHSTDAPI_(BOOL) ILIsParent(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2, BOOL fImmediate);
  3491. SHSTDAPI_(LPITEMIDLIST) ILFindChild(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild);
  3492. SHSTDAPI_(LPITEMIDLIST) ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
  3493. SHSTDAPI ILLoadFromStream(IStream *pstm, LPITEMIDLIST *pidl);
  3494. SHSTDAPI ILSaveToStream(IStream *pstm, LPCITEMIDLIST pidl);
  3495. #if (_WIN32_IE >= 0x0400)
  3496. SHSTDAPI_(LPITEMIDLIST) ILCreateFromPathA(LPCSTR pszPath);
  3497. SHSTDAPI_(LPITEMIDLIST) ILCreateFromPathW(LPCWSTR pszPath);
  3498. #ifdef NO_WRAPPERS_FOR_ILCREATEFROMPATH
  3499. SHSTDAPI_(LPITEMIDLIST) ILCreateFromPath(LPCTSTR pszPath);
  3500. #else
  3501. #ifdef UNICODE
  3502. #define ILCreateFromPath ILCreateFromPathW
  3503. #else
  3504. #define ILCreateFromPath ILCreateFromPathA
  3505. #endif // !UNICODE
  3506. #endif
  3507. #endif
  3508. SHSTDAPI SHILCreateFromPath(LPCWSTR szPath, LPITEMIDLIST *ppidl, DWORD *rgfInOut);
  3509. #undef INTERFACE
  3510. #define INTERFACE IDefViewFrame
  3511. DECLARE_INTERFACE_(IDefViewFrame, IUnknown)
  3512. {
  3513. // *** IUnknown methods ***
  3514. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3515. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3516. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3517. // *** IDefViewFrame methods ***
  3518. STDMETHOD(GetWindowLV) (THIS_ HWND * phwnd) PURE;
  3519. STDMETHOD(ReleaseWindowLV) (THIS) PURE;
  3520. STDMETHOD(GetShellFolder)(THIS_ IShellFolder **ppsf) PURE;
  3521. };
  3522. //===========================================================================
  3523. // Shell restrictions. (Parameter for SHRestricted)
  3524. typedef enum RESTRICTIONS
  3525. {
  3526. REST_NONE = 0x00000000,
  3527. REST_NORUN = 0x00000001,
  3528. REST_NOCLOSE = 0x00000002,
  3529. REST_NOSAVESET = 0x00000004,
  3530. REST_NOFILEMENU = 0x00000008,
  3531. REST_NOSETFOLDERS = 0x00000010,
  3532. REST_NOSETTASKBAR = 0x00000020,
  3533. REST_NODESKTOP = 0x00000040,
  3534. REST_NOFIND = 0x00000080,
  3535. REST_NODRIVES = 0x00000100,
  3536. REST_NODRIVEAUTORUN = 0x00000200,
  3537. REST_NODRIVETYPEAUTORUN = 0x00000400,
  3538. REST_NONETHOOD = 0x00000800,
  3539. REST_STARTBANNER = 0x00001000,
  3540. REST_RESTRICTRUN = 0x00002000,
  3541. REST_NOPRINTERTABS = 0x00004000,
  3542. REST_NOPRINTERDELETE = 0x00008000,
  3543. REST_NOPRINTERADD = 0x00010000,
  3544. REST_NOSTARTMENUSUBFOLDERS = 0x00020000,
  3545. REST_MYDOCSONNET = 0x00040000,
  3546. REST_NOEXITTODOS = 0x00080000,
  3547. REST_ENFORCESHELLEXTSECURITY = 0x00100000,
  3548. REST_LINKRESOLVEIGNORELINKINFO = 0x00200000,
  3549. REST_NOCOMMONGROUPS = 0x00400000,
  3550. REST_SEPARATEDESKTOPPROCESS = 0x00800000,
  3551. REST_NOWEB = 0x01000000,
  3552. REST_NOTRAYCONTEXTMENU = 0x02000000,
  3553. REST_NOVIEWCONTEXTMENU = 0x04000000,
  3554. REST_NONETCONNECTDISCONNECT = 0x08000000,
  3555. REST_STARTMENULOGOFF = 0x10000000,
  3556. REST_NOSETTINGSASSIST = 0x20000000,
  3557. REST_NOINTERNETICON = 0x40000001,
  3558. REST_NORECENTDOCSHISTORY = 0x40000002,
  3559. REST_NORECENTDOCSMENU = 0x40000003,
  3560. REST_NOACTIVEDESKTOP = 0x40000004,
  3561. REST_NOACTIVEDESKTOPCHANGES = 0x40000005,
  3562. REST_NOFAVORITESMENU = 0x40000006,
  3563. REST_CLEARRECENTDOCSONEXIT = 0x40000007,
  3564. REST_CLASSICSHELL = 0x40000008,
  3565. REST_NOCUSTOMIZEWEBVIEW = 0x40000009,
  3566. REST_NOHTMLWALLPAPER = 0x40000010,
  3567. REST_NOCHANGINGWALLPAPER = 0x40000011,
  3568. REST_NODESKCOMP = 0x40000012,
  3569. REST_NOADDDESKCOMP = 0x40000013,
  3570. REST_NODELDESKCOMP = 0x40000014,
  3571. REST_NOCLOSEDESKCOMP = 0x40000015,
  3572. REST_NOCLOSE_DRAGDROPBAND = 0x40000016, // Disable Close and Drag & Drop on ALL Bands
  3573. REST_NOMOVINGBAND = 0x40000017, // Disable Moving ALL Bands
  3574. REST_NOEDITDESKCOMP = 0x40000018,
  3575. REST_NORESOLVESEARCH = 0x40000019,
  3576. REST_NORESOLVETRACK = 0x4000001A,
  3577. REST_FORCECOPYACLWITHFILE = 0X4000001B,
  3578. REST_NOLOGO3CHANNELNOTIFY = 0x4000001C,
  3579. REST_NOFORGETSOFTWAREUPDATE = 0x4000001D,
  3580. REST_NOSETACTIVEDESKTOP = 0x4000001E, // No Active desktop on Settings Menu
  3581. REST_NOUPDATEWINDOWS = 0x4000001F, // No Windows Update on Settings Menu
  3582. REST_NOCHANGESTARMENU = 0x40000020, // No Context menu or Drag and Drop on Start menu
  3583. REST_NOFOLDEROPTIONS = 0x40000021, // No Folder Options on Settings Menu
  3584. REST_HASFINDCOMPUTERS = 0x40000022, // Show Start/Search/Computers
  3585. REST_INTELLIMENUS = 0x40000023,
  3586. REST_RUNDLGMEMCHECKBOX = 0x40000024,
  3587. REST_ARP_ShowPostSetup = 0x40000025, // ARP: Show Post-Setup page
  3588. REST_NOCSC = 0x40000026, // Disable the ClientSide caching on SM
  3589. REST_NOCONTROLPANEL = 0x40000027, // Remove the Control Panel only from SM|Settings
  3590. REST_ENUMWORKGROUP = 0x40000028, // Enumerate workgroup in root of nethood
  3591. REST_ARP_NOARP = 0x40000029, // ARP: Don't Allow ARP to come up at all
  3592. REST_ARP_NOREMOVEPAGE = 0x4000002A, // ARP: Don't allow Remove page
  3593. REST_ARP_NOADDPAGE = 0x4000002B, // ARP: Don't allow Add page
  3594. REST_ARP_NOWINSETUPPAGE = 0x4000002C, // ARP: Don't allow opt components page
  3595. REST_GREYMSIADS = 0x4000002D, // SM: Allow the greying of Darwin Ads in SM
  3596. REST_NOCHANGEMAPPEDDRIVELABEL = 0x4000002E, // Don't enable the UI which allows users to rename mapped drive labels
  3597. REST_NOCHANGEMAPPEDDRIVECOMMENT = 0x4000002F, // Don't enable the UI which allows users to change mapped drive comments
  3598. REST_MaxRecentDocs = 0x40000030,
  3599. REST_NONETWORKCONNECTIONS = 0x40000031, // No Start Menu | Settings |Network Connections
  3600. REST_FORCESTARTMENULOGOFF = 0x40000032, // Force logoff on the Start Menu
  3601. REST_NOWEBVIEW = 0x40000033, // Disable Web View
  3602. REST_NOCUSTOMIZETHISFOLDER = 0x40000034, // Disable Customize This Folder
  3603. REST_NOENCRYPTION = 0x40000035, // Don't allow file encryption
  3604. // Do NOT use me 0x40000036,
  3605. REST_DONTSHOWSUPERHIDDEN = 0x40000037, // don't show super hidden files
  3606. REST_NOSHELLSEARCHBUTTON = 0x40000038,
  3607. REST_NOHARDWARETAB = 0x40000039, // No Hardware tab on Drives or in control panel
  3608. REST_NORUNASINSTALLPROMPT = 0x4000003A, // Don't bring up "Run As" prompt for install programs
  3609. REST_PROMPTRUNASINSTALLNETPATH = 0x4000003B, // Force the "Run As" prompt for install programs on unc/network shares
  3610. REST_NOMANAGEMYCOMPUTERVERB = 0x4000003C, // No Manage verb on My Computer
  3611. REST_NORECENTDOCSNETHOOD = 0x4000003D, // dont add the recent docs shares to nethood
  3612. REST_DISALLOWRUN = 0x4000003E, // don't allow certain apps to be run
  3613. REST_NOWELCOMESCREEN = 0x4000003F, // don't allow the welcome screen to be displayed.
  3614. REST_RESTRICTCPL = 0x40000040, // only allow certain cpls to be run
  3615. REST_DISALLOWCPL = 0x40000041, // don't allow certain cpls to be run
  3616. REST_NOSMBALLOONTIP = 0x40000042, // No Start Menu Balloon Tip
  3617. REST_NOSMHELP = 0x40000043, // No Help on the Start Menu
  3618. REST_NOWINKEYS = 0x40000044, // No Windows-X Hot keys
  3619. REST_NOENCRYPTONMOVE = 0x40000045, // Don't automatically try to encrypt files that are moved to encryped directories
  3620. REST_NOLOCALMACHINERUN = 0x40000046, // ignore HKLM\sw\ms\win\cv\Run and all of it's sub keys
  3621. REST_NOCURRENTUSERRUN = 0x40000047, // ignore HKCU\sw\ms\win\cv\Run and all of it's sub keys
  3622. REST_NOLOCALMACHINERUNONCE = 0x40000048, // ignore HKLM\sw\ms\win\cv\RunOnce and all of it's sub keys
  3623. REST_NOCURRENTUSERRUNONCE = 0x40000049, // ignore HKCU\sw\ms\win\cv\RunOnce and all of it's sub keys
  3624. REST_FORCEACTIVEDESKTOPON = 0x4000004A, // Force ActiveDesktop to be turned ON all the time.
  3625. REST_NOCOMPUTERSNEARME = 0x4000004B, // removes the "Computers near me" link
  3626. REST_NOVIEWONDRIVE = 0x4000004C, // disallows CreateViewObject() on specified drives (CFSFolder only)
  3627. REST_NONETCRAWL = 0x4000004D, // disables the crawling of the WNet namespace.
  3628. REST_NOSHAREDDOCUMENTS = 0x4000004E, // don't auto share the Shared Documents/create link
  3629. REST_NOSMMYDOCS = 0x4000004F, // Don't show the My Documents item on the Start Menu.
  3630. REST_NOSMMYPICS = 0x40000050, // Don't show the My Pictures item on the Start Menu
  3631. REST_ALLOWBITBUCKDRIVES = 0x40000051, // Bit mask indicating which which drives have bit bucket support
  3632. REST_NONLEGACYSHELLMODE = 0x40000052, // new consumer shell modes
  3633. REST_NOCONTROLPANELBARRICADE = 0x40000053, // The webview barricade in Control Panel
  3634. REST_NOSTARTPAGE = 0x40000054, // Whistler Start Page on desktop.
  3635. REST_NOAUTOTRAYNOTIFY = 0x40000055, // Whistler auto-tray notify feature
  3636. REST_NOTASKGROUPING = 0x40000056, // Whistler taskbar button grouping feature
  3637. REST_NOCDBURNING = 0x40000057, // whistler cd burning feature
  3638. REST_MYCOMPNOPROP = 0x40000058, // disables Properties on My Computer's context menu
  3639. REST_MYDOCSNOPROP = 0x40000059, // disables Properties on My Documents' context menu
  3640. REST_NOSTARTPANEL = 0x4000005A, // Windows start panel (New start menu) for Whistler.
  3641. REST_NODISPLAYAPPEARANCEPAGE = 0x4000005B, // disable Themes and Appearance tabs in the Display Control Panel.
  3642. REST_NOTHEMESTAB = 0x4000005C, // disable the Themes tab in the Display Control Panel.
  3643. REST_NOVISUALSTYLECHOICE = 0x4000005D, // disable the visual style drop down in the Appearance tab of the Display Control Panel.
  3644. REST_NOSIZECHOICE = 0x4000005E, // disable the size drop down in the Appearance tab of the Display Control Panel.
  3645. REST_NOCOLORCHOICE = 0x4000005F, // disable the color drop down in the Appearance tab of the Display Control Panel.
  3646. REST_SETVISUALSTYLE = 0x40000060, // Load the specified file as the visual style.
  3647. REST_STARTRUNNOHOMEPATH = 0x40000061, // dont use the %HOMEPATH% env var for the Start-Run dialog
  3648. REST_NOUSERNAMEINSTARTPANEL = 0x40000062, // don't show the username is the startpanel.
  3649. REST_NOMYCOMPUTERICON = 0x40000063, // don't show my computer anywhere, hide its contents
  3650. REST_NOSMNETWORKPLACES = 0x40000064, // don't show network places in startpanel.
  3651. REST_NOSMPINNEDLIST = 0x40000065, // don't show the pinned list in startpanel.
  3652. REST_NOSMMYMUSIC = 0x40000066, // don't show MyMusic folder in startpanel
  3653. REST_NOSMEJECTPC = 0x40000067, // don't show "Undoc PC" command in startmenu
  3654. REST_NOSMMOREPROGRAMS = 0x40000068, // don't show "More Programs" button in StartPanel.
  3655. REST_NOSMMFUPROGRAMS = 0x40000069, // don't show the MFU programs list in StartPanel.
  3656. REST_NOTRAYITEMSDISPLAY = 0x4000006A, // disables the display of the system tray
  3657. REST_NOTOOLBARSONTASKBAR = 0x4000006B, // disables toolbar display on the taskbar
  3658. REST_NOSMCONFIGUREPROGRAMS = 0x4000006F, // No Configure Programs on Settings Menu
  3659. REST_HIDECLOCK = 0x40000070, // don't show the clock
  3660. REST_NOLOWDISKSPACECHECKS = 0x40000071, // disable the low disk space checking
  3661. REST_NOENTIRENETWORK = 0x40000072, // removes the "Entire Network" link (i.e. from "My Network Places")
  3662. REST_NODESKTOPCLEANUP = 0x40000073, // disable the desktop cleanup wizard
  3663. REST_BITBUCKNUKEONDELETE = 0x40000074, // disables recycling of files
  3664. REST_BITBUCKCONFIRMDELETE = 0x40000075, // always show the delete confirmation dialog when deleting files
  3665. REST_BITBUCKNOPROP = 0x40000076, // disables Properties on Recycle Bin's context menu
  3666. REST_NODISPBACKGROUND = 0x40000077, // disables the Desktop tab in the Display CPL
  3667. REST_NODISPSCREENSAVEPG = 0x40000078, // disables the Screen Saver tab in the Display CPL
  3668. REST_NODISPSETTINGSPG = 0x40000079, // disables the Settings tab in the Display CPL
  3669. REST_NODISPSCREENSAVEPREVIEW = 0x4000007A, // disables the screen saver on the Screen Saver tab in the Display CPL
  3670. REST_NODISPLAYCPL = 0x4000007B, // disables the Display CPL
  3671. REST_HIDERUNASVERB = 0x4000007C, // hides the "Run As..." context menu item
  3672. REST_NOTHUMBNAILCACHE = 0x4000007D, // disables use of the thumbnail cache
  3673. REST_NOSTRCMPLOGICAL = 0x4000007E, // dont use StrCmpLogical() instead use default CompareString()
  3674. REST_NOPUBLISHWIZARD = 0x4000007F, // disables publishing wizard (WPW)
  3675. REST_NOONLINEPRINTSWIZARD = 0x40000080, // disables online prints wizard (OPW)
  3676. REST_NOWEBSERVICES = 0x40000081, // disables the web specified services for both OPW and WPW
  3677. REST_ALLOWUNHASHEDWEBVIEW = 0x40000082, // allow the user to be promted to accept web view templates that don't already have an md5 hash in the registry
  3678. REST_ALLOWLEGACYWEBVIEW = 0x40000083, // allow legacy webview template to be shown.
  3679. REST_REVERTWEBVIEWSECURITY = 0x40000084, // disable added webview security measures (revert to w2k functionality).
  3680. REST_INHERITCONSOLEHANDLES = 0x40000086, // ShellExec() will check for the current process and target process being console processes to inherit handles
  3681. REST_SORTMAXITEMCOUNT = 0x40000087, // Do not sort views with more items than this key. Useful for viewing big amount of files in one folder.
  3682. REST_NOREMOTERECURSIVEEVENTS = 0x40000089, // Dont register network change events recursively to avoid network traffic
  3683. REST_NOREMOTECHANGENOTIFY = 0x40000091, // Do not register for remote change notifies
  3684. REST_NOSIMPLENETIDLIST = 0x40000092, // No simple network IDLists
  3685. REST_NOENUMENTIRENETWORK = 0x40000093, // Don't enumerate entire network if we happen to get to it (in conjunction with REST_NOENTIRENETWORK)
  3686. REST_NODETAILSTHUMBNAILONNETWORK= 0x40000094, // Disable Thumbnail for Network files in DUI Details pane
  3687. REST_NOINTERNETOPENWITH = 0x40000095, // dont allow looking on the internet for file associations
  3688. REST_ALLOWLEGACYLMZBEHAVIOR = 0x4000009A, // allowable LMZ behavior for ActiveX objects changed in XPSP2, this policy gets the pre-XPSP2 behavior
  3689. REST_DONTRETRYBADNETNAME = 0x4000009B, // In Network Places: if provider returns ERROR_BAD_NET_NAME, give up
  3690. REST_ALLOWFILECLSIDJUNCTIONS = 0x4000009C, // re-enable legacy support for file.{guid} junctions in FileSystem Folder
  3691. REST_NOUPNPINSTALL = 0x4000009D, // disable "install UPnP" task in My Net Places
  3692. REST_NODISCONNECT = 0x41000001, // No Disconnect option in Start menu
  3693. REST_NOSECURITY = 0x41000002, // No Security option in start menu
  3694. REST_NOFILEASSOCIATE = 0x41000003, // Do not allow user to change file association
  3695. REST_ALLOWCOMMENTTOGGLE = 0x41000004, // Allow the user to toggle the positions of the Comment and the Computer Name
  3696. REST_USEDESKTOPINICACHE = 0x41000005, // Cache desktop.ini entries from network folders
  3697. } RESTRICTIONS;
  3698. SHSTDAPI_(IStream *) OpenRegStream(HKEY hkey, LPCWSTR pszSubkey, LPCWSTR pszValue, DWORD grfMode);
  3699. SHSTDAPI_(BOOL) SHFindFiles(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile);
  3700. SHSTDAPI_(void) PathGetShortPath(LPWSTR pszLongPath);
  3701. SHSTDAPI_(BOOL) PathYetAnotherMakeUniqueName(LPWSTR pszUniqueName, LPCWSTR pszPath, LPCWSTR pszShort, LPCWSTR pszFileSpec);
  3702. SHSTDAPI_(BOOL) Win32DeleteFile(LPCWSTR pszPath);
  3703. //
  3704. // Path processing function
  3705. //
  3706. #define PPCF_ADDQUOTES 0x00000001 // return a quoted name if required
  3707. #define PPCF_ADDARGUMENTS 0x00000003 // appends arguments (and wraps in quotes if required)
  3708. #define PPCF_NODIRECTORIES 0x00000010 // don't match to directories
  3709. #define PPCF_FORCEQUALIFY 0x00000040 // qualify even non-relative names
  3710. #define PPCF_LONGESTPOSSIBLE 0x00000080 // always find the longest possible name
  3711. SHSTDAPI_(LONG) PathProcessCommand(LPCWSTR lpSrc, LPWSTR lpDest, int iMax, DWORD dwFlags);
  3712. SHSTDAPI_(DWORD) SHRestricted(RESTRICTIONS rest);
  3713. SHSTDAPI_(BOOL) SignalFileOpen(LPCITEMIDLIST pidl);
  3714. SHSTDAPI_(LPITEMIDLIST) SHSimpleIDListFromPath(LPCWSTR pszPath);
  3715. SHSTDAPI SHLoadOLE(LPARAM lParam);
  3716. SHSTDAPI SHStartNetConnectionDialogA(HWND hwnd, LPCSTR pszRemoteName, DWORD dwType);
  3717. SHSTDAPI SHStartNetConnectionDialogW(HWND hwnd, LPCWSTR pszRemoteName, DWORD dwType);
  3718. #ifdef UNICODE
  3719. #define SHStartNetConnectionDialog SHStartNetConnectionDialogW
  3720. #else
  3721. #define SHStartNetConnectionDialog SHStartNetConnectionDialogA
  3722. #endif // !UNICODE
  3723. SHSTDAPI SHDefExtractIconA(LPCSTR pszIconFile, int iIndex, UINT uFlags,
  3724. HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
  3725. SHSTDAPI SHDefExtractIconW(LPCWSTR pszIconFile, int iIndex, UINT uFlags,
  3726. HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
  3727. #ifdef UNICODE
  3728. #define SHDefExtractIcon SHDefExtractIconW
  3729. #else
  3730. #define SHDefExtractIcon SHDefExtractIconA
  3731. #endif // !UNICODE
  3732. SHSTDAPI_(BOOL) Shell_GetImageLists(HIMAGELIST *phiml, HIMAGELIST *phimlSmall);
  3733. SHSTDAPI_(int) Shell_GetCachedImageIndex(LPCWSTR pszIconPath, int iIconIndex, UINT uIconFlags);
  3734. //
  3735. // IDocViewSite
  3736. //
  3737. #undef INTERFACE
  3738. #define INTERFACE IDocViewSite
  3739. DECLARE_INTERFACE_(IDocViewSite, IUnknown)
  3740. {
  3741. // *** IUnknown methods ***
  3742. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3743. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  3744. STDMETHOD_(ULONG,Release)(THIS) PURE;
  3745. // *** IDocViewSite methods ***
  3746. STDMETHOD(OnSetTitle) (THIS_ VARIANTARG *pvTitle) PURE;
  3747. } ;
  3748. #define VALIDATEUNC_NOUI 0x0002 // don't bring up UI
  3749. #define VALIDATEUNC_CONNECT 0x0001 // connect a drive letter
  3750. #define VALIDATEUNC_PRINT 0x0004 // validate as print share instead of disk share
  3751. #define VALIDATEUNC_VALID 0x0007 // valid flags
  3752. SHSTDAPI_(BOOL) SHValidateUNC(HWND hwndOwner, LPWSTR pszFile, UINT fConnect);
  3753. #define OPENPROPS_NONE 0x0000
  3754. #define OPENPROPS_INHIBITPIF 0x8000
  3755. #define GETPROPS_NONE 0x0000
  3756. #define SETPROPS_NONE 0x0000
  3757. #define CLOSEPROPS_NONE 0x0000
  3758. #define CLOSEPROPS_DISCARD 0x0001
  3759. #define PIFNAMESIZE 30
  3760. #define PIFSTARTLOCSIZE 63
  3761. #define PIFDEFPATHSIZE 64
  3762. #define PIFPARAMSSIZE 64
  3763. #define PIFSHPROGSIZE 64
  3764. #define PIFSHDATASIZE 64
  3765. #define PIFDEFFILESIZE 80
  3766. #define PIFMAXFILEPATH 260
  3767. typedef struct PROPPRG { /* prg */
  3768. WORD flPrg; // see PRG_ flags
  3769. WORD flPrgInit; // see PRGINIT_ flags
  3770. CHAR achTitle[PIFNAMESIZE]; // name[30]
  3771. CHAR achCmdLine[PIFSTARTLOCSIZE+PIFPARAMSSIZE+1];// startfile[63] + params[64]
  3772. CHAR achWorkDir[PIFDEFPATHSIZE]; // defpath[64]
  3773. WORD wHotKey; // PfHotKeyScan thru PfHotKeyVal
  3774. CHAR achIconFile[PIFDEFFILESIZE]; // name of file containing icon
  3775. WORD wIconIndex; // index of icon within file
  3776. DWORD dwEnhModeFlags; // reserved enh-mode flags
  3777. DWORD dwRealModeFlags; // real-mode flags (see RMOPT_*)
  3778. CHAR achOtherFile[PIFDEFFILESIZE]; // name of "other" file in directory
  3779. CHAR achPIFFile[PIFMAXFILEPATH]; // name of PIF file
  3780. } PROPPRG;
  3781. typedef UNALIGNED PROPPRG *PPROPPRG;
  3782. typedef UNALIGNED PROPPRG FAR *LPPROPPRG;
  3783. typedef const UNALIGNED PROPPRG FAR *LPCPROPPRG;
  3784. SHSTDAPI_(HANDLE) PifMgr_OpenProperties(LPCWSTR pszApp, LPCWSTR pszPIF, UINT hInf, UINT flOpt);
  3785. SHSTDAPI_(int) PifMgr_GetProperties(HANDLE hProps, LPCSTR pszGroup, void *lpProps, int cbProps, UINT flOpt);
  3786. SHSTDAPI_(int) PifMgr_SetProperties(HANDLE hProps, LPCSTR pszGroup, const VOID *lpProps, int cbProps, UINT flOpt);
  3787. SHSTDAPI_(HANDLE) PifMgr_CloseProperties(HANDLE hProps, UINT flOpt);
  3788. SHSTDAPI_(void) SHSetInstanceExplorer(IUnknown *punk);
  3789. SHSTDAPI_(BOOL) IsUserAnAdmin(void);
  3790. #undef INTERFACE
  3791. #define INTERFACE IInitializeObject
  3792. DECLARE_INTERFACE_(IInitializeObject, IUnknown)
  3793. {
  3794. // *** IUnknown methods ***
  3795. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3796. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3797. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3798. // *** IInitializeObject methods
  3799. STDMETHOD(Initialize)(THIS) PURE;
  3800. };
  3801. enum
  3802. {
  3803. BMICON_LARGE = 0,
  3804. BMICON_SMALL
  3805. };
  3806. #undef INTERFACE
  3807. #define INTERFACE IBanneredBar
  3808. DECLARE_INTERFACE_(IBanneredBar, IUnknown)
  3809. {
  3810. // *** IUnknown methods ***
  3811. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3812. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3813. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3814. // *** IBanneredBar methods ***
  3815. STDMETHOD(SetIconSize)(THIS_ DWORD iIcon) PURE;
  3816. STDMETHOD(GetIconSize)(THIS_ DWORD* piIcon) PURE;
  3817. STDMETHOD(SetBitmap)(THIS_ HBITMAP hBitmap) PURE;
  3818. STDMETHOD(GetBitmap)(THIS_ HBITMAP* phBitmap) PURE;
  3819. };
  3820. SHSTDAPI_(LRESULT) SHShellFolderView_Message(HWND hwndMain, UINT uMsg, LPARAM lParam);
  3821. //
  3822. // Callback interface for the IShellFolderView
  3823. //
  3824. #undef INTERFACE
  3825. #define INTERFACE IShellFolderViewCB
  3826. DECLARE_INTERFACE_(IShellFolderViewCB, IUnknown)
  3827. {
  3828. // *** IUnknown methods ***
  3829. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3830. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3831. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3832. // *** IShellFolderViewCB methods ***
  3833. STDMETHOD(MessageSFVCB)(THIS_ UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
  3834. };
  3835. #include <pshpack8.h>
  3836. #undef UNSIZED_ARRAY2
  3837. #undef EMPTY_SIZE2
  3838. #define UNSIZED_ARRAY2
  3839. #define EMPTY_SIZE2 UNSIZED_ARRAY2
  3840. #define QCMINFO_PLACE_BEFORE 0
  3841. #define QCMINFO_PLACE_AFTER 1
  3842. typedef struct _QCMINFO_IDMAP_PLACEMENT
  3843. {
  3844. UINT id;
  3845. UINT fFlags;
  3846. } QCMINFO_IDMAP_PLACEMENT;
  3847. typedef struct _QCMINFO_IDMAP
  3848. {
  3849. UINT nMaxIds;
  3850. QCMINFO_IDMAP_PLACEMENT pIdList[1];
  3851. } QCMINFO_IDMAP;
  3852. typedef struct _QCMINFO
  3853. {
  3854. HMENU hmenu; // in
  3855. UINT indexMenu; // in
  3856. UINT idCmdFirst; // in/out
  3857. UINT idCmdLast; // in
  3858. QCMINFO_IDMAP const* pIdMap; // in / unused
  3859. } QCMINFO;
  3860. typedef QCMINFO * LPQCMINFO;
  3861. // TBINFO flags
  3862. #define TBIF_APPEND 0
  3863. #define TBIF_PREPEND 1
  3864. #define TBIF_REPLACE 2
  3865. #define TBIF_DEFAULT 0x00000000
  3866. #define TBIF_INTERNETBAR 0x00010000
  3867. #define TBIF_STANDARDTOOLBAR 0x00020000
  3868. #define TBIF_NOTOOLBAR 0x00030000
  3869. typedef struct _TBINFO
  3870. {
  3871. UINT cbuttons; // out
  3872. UINT uFlags; // out (one of TBIF_ flags)
  3873. } TBINFO;
  3874. typedef struct _DETAILSINFO
  3875. {
  3876. LPCITEMIDLIST pidl;
  3877. int fmt;
  3878. int cxChar;
  3879. STRRET str;
  3880. int iImage;
  3881. } DETAILSINFO;
  3882. typedef struct _SFVM_PROPPAGE_DATA
  3883. {
  3884. DWORD dwReserved;
  3885. LPFNADDPROPSHEETPAGE pfn;
  3886. LPARAM lParam;
  3887. } SFVM_PROPPAGE_DATA;
  3888. typedef struct _SFVM_HELPTOPIC_DATA
  3889. {
  3890. WCHAR wszHelpFile[MAX_PATH];
  3891. WCHAR wszHelpTopic[MAX_PATH];
  3892. } SFVM_HELPTOPIC_DATA;
  3893. // uMsg wParam lParam
  3894. #define SFVM_MERGEMENU 1 // - LPQCMINFO
  3895. #define SFVM_INVOKECOMMAND 2 // idCmd -
  3896. #define SFVM_GETHELPTEXT 3 // idCmd,cchMax pszText
  3897. #define SFVM_GETTOOLTIPTEXT 4 // idCmd,cchMax pszText
  3898. #define SFVM_GETBUTTONINFO 5 // - LPTBINFO
  3899. #define SFVM_GETBUTTONS 6 // idCmdFirst,cbtnMax LPTBBUTTON
  3900. #define SFVM_INITMENUPOPUP 7 // idCmdFirst,nIndex hmenu
  3901. #define SFVM_FSNOTIFY 14 // LPCITEMIDLIST* lEvent
  3902. #define SFVM_WINDOWCREATED 15 // hwnd -
  3903. #define SFVM_GETDETAILSOF 23 // iColumn DETAILSINFO*
  3904. #define SFVM_COLUMNCLICK 24 // iColumn -
  3905. #define SFVM_QUERYFSNOTIFY 25 // - SHChangeNotifyEntry *
  3906. #define SFVM_DEFITEMCOUNT 26 // - UINT*
  3907. #define SFVM_DEFVIEWMODE 27 // - FOLDERVIEWMODE*
  3908. #define SFVM_UNMERGEMENU 28 // - hmenu
  3909. #define SFVM_UPDATESTATUSBAR 31 // fInitialize -
  3910. #define SFVM_BACKGROUNDENUM 32 // - -
  3911. #define SFVM_DIDDRAGDROP 36 // dwEffect IDataObject *
  3912. #define SFVM_SETISFV 39 // - IShellFolderView*
  3913. #define SFVM_THISIDLIST 41 // - LPITMIDLIST*
  3914. #define SFVM_ADDPROPERTYPAGES 47 // - SFVM_PROPPAGE_DATA *
  3915. #define SFVM_BACKGROUNDENUMDONE 48 // - -
  3916. #define SFVM_GETNOTIFY 49 // LPITEMIDLIST* LONG*
  3917. #define SFVM_GETSORTDEFAULTS 53 // iDirection iParamSort
  3918. #define SFVM_SIZE 57 // - -
  3919. #define SFVM_GETZONE 58 // - DWORD*
  3920. #define SFVM_GETPANE 59 // Pane ID DWORD*
  3921. #define SFVM_GETHELPTOPIC 63 // - SFVM_HELPTOPIC_DATA *
  3922. #define SFVM_GETANIMATION 68 // HINSTANCE * WCHAR *
  3923. // SHCreateShellFolderView struct
  3924. typedef struct _SFV_CREATE
  3925. {
  3926. UINT cbSize;
  3927. IShellFolder* pshf;
  3928. IShellView* psvOuter;
  3929. IShellFolderViewCB* psfvcb; // No callback if NULL
  3930. } SFV_CREATE;
  3931. SHSTDAPI SHCreateShellFolderView(const SFV_CREATE* pcsfv, IShellView **ppsv);
  3932. typedef HRESULT (CALLBACK * LPFNDFMCALLBACK)(IShellFolder *psf, HWND hwnd,
  3933. IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam);
  3934. SHSTDAPI CDefFolderMenu_Create2(LPCITEMIDLIST pidlFolder, HWND hwnd,
  3935. UINT cidl, LPCITEMIDLIST *apidl,
  3936. IShellFolder *psf, LPFNDFMCALLBACK lpfn,
  3937. UINT nKeys, const HKEY *ahkeyClsKeys,
  3938. IContextMenu **ppcm);
  3939. SHSTDAPI_(BOOL) SHOpenPropSheetA(LPCSTR pszCaption, HKEY ahkeys[], UINT cikeys,
  3940. const CLSID * pclsidDefault, IDataObject *pdtobj,
  3941. IShellBrowser *psb, LPCSTR pStartPage);
  3942. SHSTDAPI_(BOOL) SHOpenPropSheetW(LPCWSTR pszCaption, HKEY ahkeys[], UINT cikeys,
  3943. const CLSID * pclsidDefault, IDataObject *pdtobj,
  3944. IShellBrowser *psb, LPCWSTR pStartPage);
  3945. #ifdef UNICODE
  3946. #define SHOpenPropSheet SHOpenPropSheetW
  3947. #else
  3948. #define SHOpenPropSheet SHOpenPropSheetA
  3949. #endif // !UNICODE
  3950. // uMsg wParam lParam
  3951. #define DFM_MERGECONTEXTMENU 1 // uFlags LPQCMINFO
  3952. #define DFM_INVOKECOMMAND 2 // idCmd pszArgs
  3953. #define DFM_GETDEFSTATICID 14 // idCmd * 0
  3954. // Commands from DFM_INVOKECOMMAND when strings are passed in
  3955. #define DFM_CMD_PROPERTIES ((UINT)-5)
  3956. typedef TBINFO * LPTBINFO;
  3957. typedef DETAILSINFO *PDETAILSINFO;
  3958. typedef HRESULT (CALLBACK * LPFNVIEWCALLBACK)(IShellView *psvOuter,
  3959. IShellFolder *psf,
  3960. HWND hwndMain,
  3961. UINT uMsg,
  3962. WPARAM wParam,
  3963. LPARAM lParam);
  3964. // SHCreateShellFolderViewEx struct
  3965. typedef struct _CSFV
  3966. {
  3967. UINT cbSize;
  3968. IShellFolder * pshf;
  3969. IShellView * psvOuter;
  3970. LPCITEMIDLIST pidl;
  3971. LONG lEvents;
  3972. LPFNVIEWCALLBACK pfnCallback; // No callback if NULL
  3973. FOLDERVIEWMODE fvm;
  3974. } CSFV, * LPCSFV;
  3975. // Tell the FolderView to rearrange. The lParam will be passed to
  3976. // IShellFolder::CompareIDs
  3977. #define SFVM_REARRANGE 0x00000001
  3978. #define ShellFolderView_ReArrange(_hwnd, _lparam) \
  3979. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_REARRANGE, _lparam)
  3980. // Add an OBJECT into the view
  3981. #define SFVM_ADDOBJECT 0x00000003
  3982. #define ShellFolderView_AddObject(_hwnd, _pidl) \
  3983. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_ADDOBJECT, (LPARAM)_pidl)
  3984. // Remove an OBJECT into the view
  3985. #define SFVM_REMOVEOBJECT 0x00000006
  3986. #define ShellFolderView_RemoveObject(_hwnd, _pidl) \
  3987. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_REMOVEOBJECT, (LPARAM)_pidl)
  3988. // updates an object by passing in pointer to two PIDLS, the first
  3989. // is the old pidl, the second one is the one with update information.
  3990. //
  3991. // _ppidl[1] must be a *copy* of a pidl, as control over the lifetime
  3992. // of the pidl belongs to the view after successful completion of
  3993. // this call. (Unsuccessful completion (a -1 return) implies failure
  3994. // and the caller must free the memory.) Win95 waits a while before
  3995. // freeing the pidl, IE4 frees the pidl immediately.
  3996. // IShellFolderView::UpdateObject does not suffer from this problem.
  3997. //
  3998. #define SFVM_UPDATEOBJECT 0x00000007
  3999. #define ShellFolderView_UpdateObject(_hwnd, _ppidl) \
  4000. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_UPDATEOBJECT, (LPARAM)_ppidl)
  4001. // Returns an array of the selected IDS to the caller.
  4002. // lparam is a pointer to receive the idlists into
  4003. // return value is the count of items in the array.
  4004. #define SFVM_GETSELECTEDOBJECTS 0x00000009
  4005. #define ShellFolderView_GetSelectedObjects(_hwnd, ppidl) \
  4006. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_GETSELECTEDOBJECTS, (LPARAM)ppidl)
  4007. typedef struct _SFV_SETITEMPOS
  4008. {
  4009. LPCITEMIDLIST pidl;
  4010. POINT pt;
  4011. } SFV_SETITEMPOS, *LPSFV_SETITEMPOS;
  4012. // Sets the position of an item in the viewer
  4013. // lparam is a pointer to a SVF_SETITEMPOS
  4014. // return value is unused
  4015. #define SFVM_SETITEMPOS 0x0000000e
  4016. #define ShellFolderView_SetItemPos(_hwnd, _pidl, _x, _y) \
  4017. { SFV_SETITEMPOS _sip = {_pidl, {_x, _y}}; \
  4018. SHShellFolderView_Message(_hwnd, SFVM_SETITEMPOS, (LPARAM)(LPSFV_SETITEMPOS)&_sip);}
  4019. // Notifies a ShellView when one of its objects get put on the clipboard
  4020. // as a result of a menu command.
  4021. //
  4022. //
  4023. // lparam is the dwEffect (DROPEFFECT_MOVE, DROPEFFECT_COPY)
  4024. // return value is void.
  4025. #define SFVM_SETCLIPBOARD 0x00000010
  4026. #define ShellFolderView_SetClipboard(_hwnd, _dwEffect) \
  4027. (void)SHShellFolderView_Message(_hwnd, SFVM_SETCLIPBOARD, (LPARAM)(DWORD)(_dwEffect))
  4028. #define SFVM_SETPOINTS 0x00000017
  4029. #define ShellFolderView_SetPoints(_hwnd, _pdtobj) \
  4030. (void)SHShellFolderView_Message(_hwnd, SFVM_SETPOINTS, (LPARAM)_pdtobj)
  4031. #include <poppack.h> /* Return to byte packing */
  4032. SHSTDAPI_(IContextMenu *) SHFind_InitMenuPopup(HMENU hmenu, HWND hwndOwner, UINT idCmdFirst, UINT idCmdLast);
  4033. SHSTDAPI SHCreateShellFolderViewEx(LPCSFV pcsfv, IShellView ** ppsv);
  4034. //
  4035. // PROPIDs for Internet Shortcuts (FMTID_Intshcut) to be used with
  4036. // IPropertySetStorage/IPropertyStorage
  4037. //
  4038. // The known property ids and their variant types are:
  4039. // PID_IS_URL [VT_LPWSTR] URL
  4040. // PID_IS_NAME [VT_LPWSTR] Name of the internet shortcut
  4041. // PID_IS_WORKINGDIR [VT_LPWSTR] Working directory for the shortcut
  4042. // PID_IS_HOTKEY [VT_UI2] Hotkey for the shortcut
  4043. // PID_IS_SHOWCMD [VT_I4] Show command for shortcut
  4044. // PID_IS_ICONINDEX [VT_I4] Index into file that has icon
  4045. // PID_IS_ICONFILE [VT_LPWSTR] File that has the icon
  4046. // PID_IS_WHATSNEW [VT_LPWSTR] What's New text
  4047. // PID_IS_AUTHOR [VT_LPWSTR] Author
  4048. // PID_IS_DESCRIPTION [VT_LPWSTR] Description text of site
  4049. // PID_IS_COMMENT [VT_LPWSTR] User annotated comment
  4050. //
  4051. #define PID_IS_URL 2
  4052. #define PID_IS_NAME 4
  4053. #define PID_IS_WORKINGDIR 5
  4054. #define PID_IS_HOTKEY 6
  4055. #define PID_IS_SHOWCMD 7
  4056. #define PID_IS_ICONINDEX 8
  4057. #define PID_IS_ICONFILE 9
  4058. #define PID_IS_WHATSNEW 10
  4059. #define PID_IS_AUTHOR 11
  4060. #define PID_IS_DESCRIPTION 12
  4061. #define PID_IS_COMMENT 13
  4062. //
  4063. // PROPIDs for Internet Sites (FMTID_InternetSite) to be used with
  4064. // IPropertySetStorage/IPropertyStorage
  4065. //
  4066. // The known property ids and their variant types are:
  4067. // PID_INTSITE_WHATSNEW [VT_LPWSTR] What's New text
  4068. // PID_INTSITE_AUTHOR [VT_LPWSTR] Author
  4069. // PID_INTSITE_LASTVISIT [VT_FILETIME] Time site was last visited
  4070. // PID_INTSITE_LASTMOD [VT_FILETIME] Time site was last modified
  4071. // PID_INTSITE_VISITCOUNT [VT_UI4] Number of times user has visited
  4072. // PID_INTSITE_DESCRIPTION [VT_LPWSTR] Description text of site
  4073. // PID_INTSITE_COMMENT [VT_LPWSTR] User annotated comment
  4074. // PID_INTSITE_RECURSE [VT_UI4] Levels to recurse (0-3)
  4075. // PID_INTSITE_WATCH [VT_UI4] PIDISM_ flags
  4076. // PID_INTSITE_SUBSCRIPTION [VT_UI8] Subscription cookie
  4077. // PID_INTSITE_URL [VT_LPWSTR] URL
  4078. // PID_INTSITE_TITLE [VT_LPWSTR] Title
  4079. // PID_INTSITE_CODEPAGE [VT_UI4] Codepage of the document
  4080. // PID_INTSITE_TRACKING [VT_UI4] Tracking
  4081. // PID_INTSITE_ICONINDEX [VT_I4] Retrieve the index to the icon
  4082. // PID_INTSITE_ICONFILE [VT_LPWSTR] Retrieve the file containing the icon index.
  4083. #define PID_INTSITE_WHATSNEW 2
  4084. #define PID_INTSITE_AUTHOR 3
  4085. #define PID_INTSITE_LASTVISIT 4
  4086. #define PID_INTSITE_LASTMOD 5
  4087. #define PID_INTSITE_VISITCOUNT 6
  4088. #define PID_INTSITE_DESCRIPTION 7
  4089. #define PID_INTSITE_COMMENT 8
  4090. #define PID_INTSITE_FLAGS 9
  4091. #define PID_INTSITE_CONTENTLEN 10
  4092. #define PID_INTSITE_CONTENTCODE 11
  4093. #define PID_INTSITE_RECURSE 12
  4094. #define PID_INTSITE_WATCH 13
  4095. #define PID_INTSITE_SUBSCRIPTION 14
  4096. #define PID_INTSITE_URL 15
  4097. #define PID_INTSITE_TITLE 16
  4098. #define PID_INTSITE_CODEPAGE 18
  4099. #define PID_INTSITE_TRACKING 19
  4100. #define PID_INTSITE_ICONINDEX 20
  4101. #define PID_INTSITE_ICONFILE 21
  4102. // Flags for PID_IS_FLAGS
  4103. #define PIDISF_RECENTLYCHANGED 0x00000001
  4104. #define PIDISF_CACHEDSTICKY 0x00000002
  4105. #define PIDISF_CACHEIMAGES 0x00000010
  4106. #define PIDISF_FOLLOWALLLINKS 0x00000020
  4107. // Values for PID_INTSITE_WATCH
  4108. #define PIDISM_GLOBAL 0 // Monitor based on global setting
  4109. #define PIDISM_WATCH 1 // User says watch
  4110. #define PIDISM_DONTWATCH 2 // User says don't watch
  4111. ////////////////////////////////////////////////////////////////////
  4112. //
  4113. // The shell keeps track of some per-user state to handle display
  4114. // options that is of major interest to ISVs.
  4115. // The key one requested right now is "DoubleClickInWebView".
  4116. typedef struct {
  4117. BOOL fShowAllObjects : 1;
  4118. BOOL fShowExtensions : 1;
  4119. BOOL fNoConfirmRecycle : 1;
  4120. BOOL fShowSysFiles : 1;
  4121. BOOL fShowCompColor : 1;
  4122. BOOL fDoubleClickInWebView : 1;
  4123. BOOL fDesktopHTML : 1;
  4124. BOOL fWin95Classic : 1;
  4125. BOOL fDontPrettyPath : 1;
  4126. BOOL fShowAttribCol : 1; // No longer used, dead bit
  4127. BOOL fMapNetDrvBtn : 1;
  4128. BOOL fShowInfoTip : 1;
  4129. BOOL fHideIcons : 1;
  4130. BOOL fWebView : 1;
  4131. BOOL fFilter : 1;
  4132. BOOL fShowSuperHidden : 1;
  4133. BOOL fNoNetCrawling : 1;
  4134. DWORD dwWin95Unused; // Win95 only - no longer supported pszHiddenFileExts
  4135. UINT uWin95Unused; // Win95 only - no longer supported cbHiddenFileExts
  4136. // Note: Not a typo! This is a persisted structure so we cannot use LPARAM
  4137. LONG lParamSort;
  4138. int iSortDirection;
  4139. UINT version;
  4140. // new for win2k. need notUsed var to calc the right size of ie4 struct
  4141. // FIELD_OFFSET does not work on bit fields
  4142. UINT uNotUsed; // feel free to rename and use
  4143. BOOL fSepProcess: 1;
  4144. // new for Whistler.
  4145. BOOL fStartPanelOn: 1; //Indicates if the Whistler StartPanel mode is ON or OFF.
  4146. BOOL fShowStartPage: 1; //Indicates if the Whistler StartPage on desktop is ON or OFF.
  4147. UINT fSpareFlags : 13;
  4148. } SHELLSTATEA, *LPSHELLSTATEA;
  4149. typedef struct {
  4150. BOOL fShowAllObjects : 1;
  4151. BOOL fShowExtensions : 1;
  4152. BOOL fNoConfirmRecycle : 1;
  4153. BOOL fShowSysFiles : 1;
  4154. BOOL fShowCompColor : 1;
  4155. BOOL fDoubleClickInWebView : 1;
  4156. BOOL fDesktopHTML : 1;
  4157. BOOL fWin95Classic : 1;
  4158. BOOL fDontPrettyPath : 1;
  4159. BOOL fShowAttribCol : 1;
  4160. BOOL fMapNetDrvBtn : 1;
  4161. BOOL fShowInfoTip : 1;
  4162. BOOL fHideIcons : 1;
  4163. BOOL fWebView : 1;
  4164. BOOL fFilter : 1;
  4165. BOOL fShowSuperHidden : 1;
  4166. BOOL fNoNetCrawling : 1;
  4167. DWORD dwWin95Unused; // Win95 only - no longer supported pszHiddenFileExts
  4168. UINT uWin95Unused; // Win95 only - no longer supported cbHiddenFileExts
  4169. // Note: Not a typo! This is a persisted structure so we cannot use LPARAM
  4170. LONG lParamSort;
  4171. int iSortDirection;
  4172. UINT version;
  4173. // new for win2k. need notUsed var to calc the right size of ie4 struct
  4174. // FIELD_OFFSET does not work on bit fields
  4175. UINT uNotUsed; // feel free to rename and use
  4176. BOOL fSepProcess: 1;
  4177. // new for Whistler.
  4178. BOOL fStartPanelOn: 1; //Indicates if the Whistler StartPage mode is ON or OFF.
  4179. BOOL fShowStartPage: 1; //Indicates if the Whistler StartPage on desktop is ON or OFF.
  4180. // If you need a new flag, steal a bit from from fSpareFlags.
  4181. UINT fSpareFlags : 13;
  4182. } SHELLSTATEW, *LPSHELLSTATEW;
  4183. #define SHELLSTATEVERSION_IE4 9
  4184. #define SHELLSTATEVERSION_WIN2K 10
  4185. #ifdef UNICODE
  4186. #define SHELLSTATE SHELLSTATEW
  4187. #define LPSHELLSTATE LPSHELLSTATEW
  4188. #else
  4189. #define SHELLSTATE SHELLSTATEA
  4190. #define LPSHELLSTATE LPSHELLSTATEA
  4191. #endif
  4192. #define SHELLSTATE_SIZE_WIN95 FIELD_OFFSET(SHELLSTATE,lParamSort)
  4193. #define SHELLSTATE_SIZE_NT4 FIELD_OFFSET(SHELLSTATE,version)
  4194. #define SHELLSTATE_SIZE_IE4 FIELD_OFFSET(SHELLSTATE,uNotUsed)
  4195. #define SHELLSTATE_SIZE_WIN2K sizeof(SHELLSTATE)
  4196. SHSTDAPI_(void) SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet);
  4197. //
  4198. // SysFiles are these windows special files:
  4199. // "dll sys vxd 386 drv"
  4200. //
  4201. // hidden files are files with the FILE_ATTRIBUTE_HIDDEN attribute
  4202. //
  4203. // system files are files with the FILE_ATTRIBUTE_SYSTEM attribute
  4204. //
  4205. // fShowAllObjects fShowSysFiles Result
  4206. // --------------- ------------- ------
  4207. // 0 0 hide hidden + SysFiles + system files
  4208. // 0 1 hide hidden files.
  4209. // 1 0 show all files.
  4210. // 1 1 show all files.
  4211. //
  4212. typedef struct {
  4213. BOOL fShowAllObjects : 1;
  4214. BOOL fShowExtensions : 1;
  4215. BOOL fNoConfirmRecycle : 1;
  4216. BOOL fShowSysFiles : 1;
  4217. BOOL fShowCompColor : 1;
  4218. BOOL fDoubleClickInWebView : 1;
  4219. BOOL fDesktopHTML : 1;
  4220. BOOL fWin95Classic : 1;
  4221. BOOL fDontPrettyPath : 1;
  4222. BOOL fShowAttribCol : 1;
  4223. BOOL fMapNetDrvBtn : 1;
  4224. BOOL fShowInfoTip : 1;
  4225. BOOL fHideIcons : 1;
  4226. UINT fRestFlags : 3;
  4227. } SHELLFLAGSTATE, *LPSHELLFLAGSTATE;
  4228. #define SSF_SHOWALLOBJECTS 0x00000001
  4229. #define SSF_SHOWEXTENSIONS 0x00000002
  4230. #define SSF_HIDDENFILEEXTS 0x00000004
  4231. #define SSF_SERVERADMINUI 0x00000004
  4232. #define SSF_SHOWCOMPCOLOR 0x00000008
  4233. #define SSF_SORTCOLUMNS 0x00000010
  4234. #define SSF_SHOWSYSFILES 0x00000020
  4235. #define SSF_DOUBLECLICKINWEBVIEW 0x00000080
  4236. #define SSF_SHOWATTRIBCOL 0x00000100
  4237. #define SSF_DESKTOPHTML 0x00000200
  4238. #define SSF_WIN95CLASSIC 0x00000400
  4239. #define SSF_DONTPRETTYPATH 0x00000800
  4240. #define SSF_SHOWINFOTIP 0x00002000
  4241. #define SSF_MAPNETDRVBUTTON 0x00001000
  4242. #define SSF_NOCONFIRMRECYCLE 0x00008000
  4243. #define SSF_HIDEICONS 0x00004000
  4244. #define SSF_FILTER 0x00010000
  4245. #define SSF_WEBVIEW 0x00020000
  4246. #define SSF_SHOWSUPERHIDDEN 0x00040000
  4247. #define SSF_SEPPROCESS 0x00080000
  4248. #define SSF_NONETCRAWLING 0x00100000
  4249. #define SSF_STARTPANELON 0x00200000
  4250. #define SSF_SHOWSTARTPAGE 0x00400000
  4251. // SHGetSettings(LPSHELLFLAGSTATE lpss, DWORD dwMask)
  4252. //
  4253. // Specify the bits you are interested in in dwMask and they will be
  4254. // filled out in the lpss structure.
  4255. //
  4256. // When these settings change, a WM_SETTINGCHANGE message is sent
  4257. // with the string lParam value of "ShellState".
  4258. //
  4259. SHSTDAPI_(void) SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
  4260. // SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, void **ppv, LPCITEMIDLIST *ppidlLast)
  4261. //
  4262. // Given a pidl, you can get an interface pointer (as specified by riid) of the pidl's parent folder (in ppv)
  4263. // If ppidlLast is non-NULL, you can also get the pidl of the last item.
  4264. //
  4265. SHSTDAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, void **ppv, LPCITEMIDLIST *ppidlLast);
  4266. // SHSTDAPI SHParseDisplayName(PCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
  4267. //
  4268. // given a string it will call psfDesktop->ParseDisplayName() to try and create a pidl
  4269. // if no pbc specified, it uses the preferred options for parsing.
  4270. // this includes mapping file system paths to their appropriate aliased location (RegisterObjectParam(STR_PARSE_TRANSLATE_ALIASES))
  4271. // psfgaoOut is optional for SFGAO attributes
  4272. //
  4273. SHSTDAPI SHParseDisplayName(PCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut);
  4274. // SHPathPrepareForWrite(HWND hwnd, IUnknown *punkEnableModless, LPCTSTR pszPath, DWORD dwFlags)
  4275. //
  4276. // DESCRIPTION:
  4277. // This API will prepare the path for the caller. This includes:
  4278. // 1. Prompting for the ejectable media to be re-inserted. (Floppy, CD-ROM, ZIP drive, etc.)
  4279. // 2. Prompting for the media to be formatted. (Floppy, hard drive, etc.)
  4280. // 3. Remount mapped drives if the connection was lost. (\\unc\share mapped to N: becomes disconnected)
  4281. // 4. If the path doesn't exist, create it. (SHPPFW_DIRCREATE and SHPPFW_ASKDIRCREATE)
  4282. // 5. Display an error if the media is read only. (SHPPFW_NOWRITECHECK not set)
  4283. //
  4284. // PARAMETERS:
  4285. // hwnd: Parernt window for UI. NULL means don't display UI. OPTIONAL
  4286. // punkEnableModless: Parent that will be set to modal during UI using IOleInPlaceActiveObject::EnableModeless(). OPTIONAL
  4287. // pszPath: Path to verify is valid for writting. This can be a UNC or file drive path. The path
  4288. // should only contain directories. Pass SHPPFW_IGNOREFILENAME if the last path segment
  4289. // is always filename to ignore.
  4290. // dwFlags: SHPPFW_* Flags to modify behavior
  4291. //
  4292. //-------------------------------------------------------------------------
  4293. #define SHPPFW_NONE 0x00000000
  4294. #define SHPPFW_DEFAULT SHPPFW_DIRCREATE // May change
  4295. #define SHPPFW_DIRCREATE 0x00000001 // Create the directory if it doesn't exist without asking the user.
  4296. #define SHPPFW_ASKDIRCREATE 0x00000002 // Create the directory if it doesn't exist after asking the user.
  4297. #define SHPPFW_IGNOREFILENAME 0x00000004 // Ignore the last item in pszPath because it's a file. Example: pszPath="C:\DirA\DirB", only use "C:\DirA".
  4298. #define SHPPFW_NOWRITECHECK 0x00000008 // Caller only needs to read from the drive, so don't check if it's READ ONLY.
  4299. #define SHPPFW_MEDIACHECKONLY 0x00000010 // do the retrys on the media (or net path), return errors if the file can't be found
  4300. SHSTDAPI SHPathPrepareForWriteA(HWND hwnd, IUnknown *punkEnableModless, LPCSTR pszPath, DWORD dwFlags);
  4301. SHSTDAPI SHPathPrepareForWriteW(HWND hwnd, IUnknown *punkEnableModless, LPCWSTR pszPath, DWORD dwFlags);
  4302. #ifdef UNICODE
  4303. #define SHPathPrepareForWrite SHPathPrepareForWriteW
  4304. #else
  4305. #define SHPathPrepareForWrite SHPathPrepareForWriteA
  4306. #endif // !UNICODE
  4307. //--------------------------------------------------------------------------
  4308. //
  4309. // Interface used for exposing the INI file methods on a shortcut file
  4310. //
  4311. //
  4312. //--------------------------------------------------------------------------
  4313. #undef INTERFACE
  4314. #define INTERFACE INamedPropertyBag
  4315. DECLARE_INTERFACE_(INamedPropertyBag, IUnknown)
  4316. {
  4317. // *** IUnknown methods ***
  4318. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  4319. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  4320. STDMETHOD_(ULONG,Release) (THIS) PURE;
  4321. // *** INamedPropertyBag methods ***
  4322. STDMETHOD(ReadPropertyNPB) (THIS_ /* [in] */ LPCOLESTR pszBagname,
  4323. /* [in] */ LPCOLESTR pszPropName,
  4324. /* [out][in] */ PROPVARIANT *pVar) PURE;
  4325. STDMETHOD(WritePropertyNPB)(THIS_ /* [in] */ LPCOLESTR pszBagname,
  4326. /* [in] */ LPCOLESTR pszPropName,
  4327. /* [in] */ PROPVARIANT *pVar) PURE;
  4328. STDMETHOD(RemovePropertyNPB)(THIS_ /* [in] */ LPCOLESTR pszBagname,
  4329. /* [in] */ LPCOLESTR pszPropName) PURE;
  4330. };
  4331. #ifdef __urlmon_h__
  4332. // NOTE: urlmon.h must be included before shlobj.h to access this function.
  4333. //
  4334. // SoftwareUpdateMessageBox
  4335. //
  4336. // Provides a standard message box for the alerting the user that a software
  4337. // update is available or installed. No UI will be displayed if there is no
  4338. // update available or if the available update version is less than or equal
  4339. // to the Advertised update version.
  4340. //
  4341. // hWnd - [in] Handle of owner window
  4342. // szDistUnit - [in] Unique identifier string for a code distribution unit. For
  4343. // ActiveX controls and Active Setup installed components, this
  4344. // is typically a GUID string.
  4345. // dwFlags - [in] Must be 0.
  4346. // psdi - [in,out] Pointer to SOFTDISTINFO ( see URLMon.h ). May be NULL.
  4347. // cbSize should be initialized
  4348. // by the caller to sizeof(SOFTDISTINFO), dwReserved should be set to 0.
  4349. //
  4350. // RETURNS:
  4351. //
  4352. // IDNO - The user chose cancel. If *pbRemind is FALSE, the caller should save the
  4353. // update version from the SOFTDISTINFO and pass it in as the Advertised
  4354. // version in future calls.
  4355. //
  4356. // IDYES - The user has selected Update Now/About Update. The caller should navigate to
  4357. // the SOFTDISTINFO's pszHREF to initiate the install or learn about it.
  4358. // The caller should save the update version from the SOFTDISTINFO and pass
  4359. // it in as the Advertised version in future calls.
  4360. //
  4361. // IDIGNORE - There is no pending software update. Note: There is
  4362. // no Ignore button in the standard UI. This occurs if the available
  4363. // version is less than the installed version or is not present or if the
  4364. // Advertised version is greater than or equal to the update version.
  4365. //
  4366. // IDABORT - An error occured. Call GetSoftwareUpdateInfo() for a more specific HRESULT.
  4367. // Note: There is no Abort button in the standard UI.
  4368. SHDOCAPI_(DWORD) SoftwareUpdateMessageBox( HWND hWnd,
  4369. LPCWSTR szDistUnit,
  4370. DWORD dwFlags,
  4371. LPSOFTDISTINFO psdi );
  4372. #endif // if __urlmon_h__
  4373. // SHPropStgCreate()
  4374. // Wrap of IPropertySetStorage::Open/Create
  4375. //
  4376. // This function ensures proper handling of code page retrieval/assignment
  4377. // for the requested property set operation.
  4378. //
  4379. // psstg, // Address of IPropertySetStorage vtable
  4380. // fmtid, // property set ID
  4381. // pclsid, // class ID associated with the set. This can be NULL
  4382. // grfFlags, // PROPSETFLAG_xxx. All sets containing ansi bytes should be created with
  4383. // PROPSETFLAG_ANSI, otherwise PROPSETFLAG_DEFAULT.
  4384. // grfMode, // STGM_ flags. Must contain STGM_DIRECT|STGM_EXCLUSIVE.
  4385. // dwDisposition, // OPEN_EXISTING. OPEN_ALWAYS, CREATE_NEW, or CREATE_ALWAYS
  4386. // IPropertyStorage** ppstg, // Address to receive requested vtable
  4387. // puCodePage // Optional address to receive the code page ID for the set.
  4388. //
  4389. SHSTDAPI SHPropStgCreate( IPropertySetStorage* psstg, REFFMTID fmtid, CLSID* pclsid, DWORD grfFlags, DWORD grfMode, DWORD dwDisposition, OUT IPropertyStorage** ppstg, OUT OPTIONAL UINT* puCodePage );
  4390. // SHPropStgReadMultiple()
  4391. // IPropertyStorage::ReadMultiple wrap
  4392. //
  4393. // The wrap ensures ANSI/UNICODE translations are handled properly for
  4394. // legacy property sets.
  4395. //
  4396. // pps, // address of IPropertyStorage vtable.
  4397. // uCodePage, //Code page value retrieved from SHCreatePropertySet
  4398. // cpspec, //Count of properties being read
  4399. // rgpspec, //Array of the properties to be read
  4400. // rgvar //Array of PROPVARIANTs containing the property values on return
  4401. //
  4402. SHSTDAPI SHPropStgReadMultiple( IPropertyStorage* pps, UINT uCodePage, ULONG cpspec, PROPSPEC const rgpspec[], PROPVARIANT rgvar[] );
  4403. // SHPropStgWriteMultiple()
  4404. // IPropertyStorage::WriteMultiple wrap
  4405. //
  4406. // The wrap ensures ANSI/UNICODE translations are handled properly for
  4407. // legacy property sets.
  4408. //
  4409. // pps, // address of IPropertyStorage vtable.
  4410. // uCodePage, // code page retrieved from SHCreatePropertySet.
  4411. // cpspec, // The number of properties being set
  4412. // rgpspec, // Property specifiers
  4413. // rgvar, // Array of PROPVARIANT values
  4414. // propidNameFirst // Minimum value for property identifiers. This value should be >= PID_FIRST_USABLE
  4415. //
  4416. SHSTDAPI SHPropStgWriteMultiple( IPropertyStorage* pps, UINT* puCodePage, ULONG cpspec, PROPSPEC const rgpspec[], PROPVARIANT rgvar[], PROPID propidNameFirst );
  4417. SHSTDAPI SHCreateFileExtractIconA(LPCSTR pszFile, DWORD dwFileAttributes, REFIID riid, void **ppv);
  4418. SHSTDAPI SHCreateFileExtractIconW(LPCWSTR pszFile, DWORD dwFileAttributes, REFIID riid, void **ppv);
  4419. #ifdef UNICODE
  4420. #define SHCreateFileExtractIcon SHCreateFileExtractIconW
  4421. #else
  4422. #define SHCreateFileExtractIcon SHCreateFileExtractIconA
  4423. #endif // !UNICODE
  4424. #include <pshpack8.h>
  4425. SHSTDAPI SHLimitInputEdit(HWND hwndEdit, IShellFolder *psf);
  4426. #if (_WIN32_WINNT >= 0x0500) || (_WIN32_WINDOWS >= 0x0500)
  4427. //
  4428. // The SHMultiFileProperties API displays a property sheet for a
  4429. // set of files specified in an IDList Array.
  4430. //
  4431. // Parameters:
  4432. // pdtobj - Data object containing list of files. The data
  4433. // object must provide the "Shell IDList Array"
  4434. // clipboard format. The parent folder's implementation of
  4435. // IShellFolder::GetDisplayNameOf must return a fully-qualified
  4436. // filesystem path for each item in response to the
  4437. // SHGDN_FORPARSING flag.
  4438. //
  4439. // dwFlags - Reserved for future use. Should be set to 0.
  4440. //
  4441. // Returns:
  4442. // S_OK
  4443. //
  4444. SHSTDAPI SHMultiFileProperties(IDataObject *pdtobj, DWORD dwFlags);
  4445. #endif
  4446. #if (_WIN32_IE >= 0x0600)
  4447. //
  4448. //
  4449. typedef void (CALLBACK *PFNASYNCICONTASKBALLBACK)(LPCITEMIDLIST pidl, LPVOID pvData, LPVOID pvHint, INT iIconIndex, INT iOpenIconIndex);
  4450. // HRESULT SHMapIDListToImageListIndexAsync(IShellTaskScheduler* pts, IShellFolder *psf, LPCITEMIDLIST pidl, UINT flags,
  4451. // PFNASYNCICONTASKBALLBACK pfn, LPVOID pvData, LPVOID pvHint, int *piIndex, int *piIndexSel);
  4452. // A usefull function for asynchronously mapping idlist into index into system
  4453. // image list. Optionally it can also look up the index of the selected icon.
  4454. // pts Task scheduler interface to use to create the background task
  4455. // psf Shell folder relating to the pidl
  4456. // pidl Item whose icon is requested
  4457. // flags GIL_ flags
  4458. // pfn Function called back when the background task is done
  4459. // pvData User data passed back in the (*pfn) callback
  4460. // pvHint User data passed back in the (*pfn) callback
  4461. // piIndex Icon index returned. This is the temporary index if the function returns E_PENDING. The final index will be provided thru the callback
  4462. // piIndexSel Optional icon index for the open icon case (GIL_OPENICON).
  4463. //
  4464. // Returns S_OK if all the requested info was available. E_PENDING means that you get temporary icons, and will be called back
  4465. // asynchronously with the final icons. Other failure code means the function failed.
  4466. SHSTDAPI SHMapIDListToImageListIndexAsync(IShellTaskScheduler* pts, IShellFolder *psf, LPCITEMIDLIST pidl, UINT flags,
  4467. PFNASYNCICONTASKBALLBACK pfn, LPVOID pvData, LPVOID pvHint, int *piIndex, int *piIndexSel);
  4468. #endif // (_WIN32_IE >= 0x0600)
  4469. // A usefull function in Defview for mapping idlist into index into system
  4470. // image list. Optionally it can also look up the index of the selected
  4471. // icon.
  4472. SHSTDAPI_(int) SHMapPIDLToSystemImageListIndex(IShellFolder *pshf, LPCITEMIDLIST pidl, int *piIndexSel);
  4473. STDAPI SHCLSIDFromString(PCWSTR lpsz, CLSID *pclsid);
  4474. STDAPI SHFlushClipboard(void);
  4475. STDAPI SHCreateQueryCancelAutoPlayMoniker(IMoniker** ppmoniker);
  4476. HINSTANCE WINAPI SHGetShellStyleHInstance(void);
  4477. STDAPI_(void) PerUserInit(void);
  4478. WINSHELLAPI BOOL WINAPI SHRunControlPanel(LPCWSTR lpcszCmdLine, HWND hwndMsgParent);
  4479. #ifndef _SHLOBJ_NO_PICKICONDLG
  4480. WINSHELLAPI int WINAPI PickIconDlg(HWND hwnd, LPWSTR pszIconPath, UINT cbIconPath, int *piIconIndex);
  4481. #endif
  4482. typedef struct tagAAMENUFILENAME
  4483. {
  4484. SHORT cbTotal;
  4485. BYTE rgbReserved[12];
  4486. WCHAR szFileName[1]; // variable length string
  4487. } AASHELLMENUFILENAME, *LPAASHELLMENUFILENAME;
  4488. typedef struct tagAASHELLMENUITEM
  4489. {
  4490. void* lpReserved1;
  4491. int iReserved;
  4492. UINT uiReserved;
  4493. LPAASHELLMENUFILENAME lpName; // name of file
  4494. LPWSTR psz; // text to use if no file
  4495. } AASHELLMENUITEM, *LPAASHELLMENUITEM;
  4496. STDAPI SHGetAttributesFromDataObject(IDataObject *pdo, DWORD dwAttributeMask, DWORD *pdwAttributes, UINT *pcItems);
  4497. #include <poppack.h> /* Return to byte packing */
  4498. #ifdef __cplusplus
  4499. }
  4500. #endif /* __cplusplus */
  4501. #include <poppack.h>
  4502. SHDOCAPI_(BOOL) ImportPrivacySettings( LPCWSTR szFilename,
  4503. IN OUT BOOL* pfParsePrivacyPreferences, IN OUT BOOL* pfParsePerSiteRules);
  4504. #ifndef IEnumPrivacyRecords
  4505. typedef interface IEnumPrivacyRecords IEnumPrivacyRecords;
  4506. #endif
  4507. SHDOCAPI DoPrivacyDlg( HWND hwndParent, LPOLESTR pszUrl, IEnumPrivacyRecords *pPrivacyEnum, BOOL fReportAllSites);
  4508. #endif // _SHLOBJ_H_