diff options
| author | Dave Wilson <[email protected]> | 2015-03-17 19:50:07 -0700 |
|---|---|---|
| committer | Dave Wilson <[email protected]> | 2015-03-17 19:50:07 -0700 |
| commit | 97cf5197cf5b882b2c689d8dc2b555f2edf8f418 (patch) | |
| tree | 46f3701832d70b420eb0fc0eb93261f9da45db3f /print/cpsuisam | |
| parent | ef1905bf1e8825bb31120dfb27e0daf3154d859a (diff) | |
Initial publish
Diffstat (limited to 'print/cpsuisam')
| -rw-r--r-- | print/cpsuisam/CPSUIDAT.C | 1331 | ||||
| -rw-r--r-- | print/cpsuisam/CPSUIDAT.H | 73 | ||||
| -rw-r--r-- | print/cpsuisam/CPSUISAM.DEF | 6 | ||||
| -rw-r--r-- | print/cpsuisam/CPSUISAM.DLG | 35 | ||||
| -rw-r--r-- | print/cpsuisam/CPSUISAM.H | 37 | ||||
| -rw-r--r-- | print/cpsuisam/DEBUG.C | 114 | ||||
| -rw-r--r-- | print/cpsuisam/DEBUG.H | 66 | ||||
| -rw-r--r-- | print/cpsuisam/PRECOMP.H | 17 | ||||
| -rw-r--r-- | print/cpsuisam/ReadMe.md | 13 | ||||
| -rw-r--r-- | print/cpsuisam/cpsuisam.c | 665 | ||||
| -rw-r--r-- | print/cpsuisam/cpsuisam.sln | 28 | ||||
| -rw-r--r-- | print/cpsuisam/cpsuisam.vcxproj | 255 | ||||
| -rw-r--r-- | print/cpsuisam/cpsuisam.vcxproj.Filters | 36 | ||||
| -rw-r--r-- | print/cpsuisam/icons/apple.ico | bin | 0 -> 1078 bytes | |||
| -rw-r--r-- | print/cpsuisam/icons/cpsuisam.ico | bin | 0 -> 1078 bytes | |||
| -rw-r--r-- | print/cpsuisam/precompsrc.c | 1 | ||||
| -rw-r--r-- | print/cpsuisam/res.rc | 51 |
17 files changed, 2728 insertions, 0 deletions
diff --git a/print/cpsuisam/CPSUIDAT.C b/print/cpsuisam/CPSUIDAT.C new file mode 100644 index 00000000..c3854001 --- /dev/null +++ b/print/cpsuisam/CPSUIDAT.C @@ -0,0 +1,1331 @@ +/*++ + +Copyright (c) 1990-2003 Microsoft Corporation +All Rights Reserved + + +Module Name: + + cpsuidat.c + + +Abstract: + + This module contains all the predefined data + + +--*/ + + +#include "precomp.h" +#pragma hdrstop + +#define DBG_CPSUIFILENAME DbgTVPage + + + +#define DBG_TVTESTCB 0x00000001 +#define DBG_PUSHDLGPROC 0x00000002 + +DEFINE_DBGVAR(0); + +#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) + + +HINSTANCE hInstApp = NULL; + +TCHAR TitleName[] = TEXT("Common Property Sheet UI Sample"); +TCHAR ClassName[] = TEXT("CPSUISampleClass"); +TCHAR MenuName[] = TEXT("CPSUISampleMenu"); +TCHAR OptItemName[] = TEXT("CPSUI TreeView Sample"); +TCHAR szWinSpool[] = TEXT("WinSpool.Drv"); +CHAR szDocPropSheets[] = "DocumentPropertySheets"; + +BOOL UpdatePermission = TRUE; +BOOL UseStdAbout = TRUE; + + +INT_PTR +CALLBACK +PushButtonProc( + HWND hDlg, + UINT Msg, + WPARAM wParam, + LPARAM lParam + ); + +CPSUICALLBACK +TVTestCallBack( + _In_ PCPSUICBPARAM pCPSUICBParam + ); + + +OPTPARAM NoYesOP[] = { + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + (LPTSTR)IDS_CPSUI_NO, // pData + IDI_CPSUI_NO, // IconID + 0 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + (LPTSTR)IDS_CPSUI_YES, // pData + IDI_CPSUI_YES, // IconID + 1 // lParam + } +}; + +EXTCHKBOX ECB_EP_ECB = { + + sizeof(EXTCHKBOX), + 0, + TEXT("Include Icon"), + (LPTSTR)IDS_CPSUI_SLASH_SEP, + TEXT("Icon"), + IDI_CPSUI_GRAPHIC }; + + +OPTPARAM ECB_EP_OP[] = { + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("None"), // pData + IDI_CPSUI_EMPTY, // IconID + 0 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("Extended CheckBox"), // pData + IDI_CPSUI_EMPTY, // IconID + 1 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("Extended Push"), // pData + IDI_CPSUI_EMPTY, // IconID + 0 // lParam + } +}; + + +OPTTYPE ECB_EP_OT = { + + sizeof(OPTTYPE), // cbSize + TVOT_3STATES, // Type + 0, // Flags OPTTF_xxxx + 3, // Count + 0, // BegCtrlID + ECB_EP_OP, // pOptParam + 0 // Style, OTS_xxxx + }; + +OPTTYPE NoYesOT = { + + sizeof(OPTTYPE), // cbSize + TVOT_2STATES, // Type + 0, // Flags OPTTF_xxxx + 2, // Count + 0, // BegCtrlID + NoYesOP, // pOptParam + 0 // Style, OTS_xxxx + }; + +OPTPARAM TVOT3StatesOP[] = { + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("States 1"), // pData + IDI_CPSUI_PORTRAIT, // IconID + 0 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("States 2"), // pData + IDI_CPSUI_LANDSCAPE, // IconID + 1 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("States 3"), // pData + IDI_CPSUI_ROT_LAND, // IconID + 0 // lParam + } +}; + +OPTTYPE TVOT2StatesOT = { + + sizeof(OPTTYPE), // cbSize + TVOT_2STATES, // Type + 0, // Flags OPTTF_xxxx + 2, // Count + 0, // BegCtrlID + TVOT3StatesOP, // pOptParam + 0 // Style, OTS_xxxx + }; + +OPTTYPE TVOT3StatesOT = { + + sizeof(OPTTYPE), // cbSize + TVOT_3STATES, // Type + 0, // Flags OPTTF_xxxx + 3, // Count + 0, // BegCtrlID + TVOT3StatesOP, // pOptParam + 0 // Style, OTS_xxxx + }; + +OPTPARAM MinRangeOP[] = { + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT(""), // pData (postfix) + IDI_CPSUI_EMPTY, // IconID + 0 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + NULL, // pData (help line) + (DWORD)MIN_INT, // IconID + MAX_INT // lParam + } +}; + +OPTTYPE MinRangeOT = { + + sizeof(OPTTYPE), // cbSize + TVOT_UDARROW, // Type + 0, // Flags OPTTF_xxxx + 2, // Count + 0, // BegCtrlID + MinRangeOP, // pOptParam + 0 // Style, OTS_xxxx + }; + +OPTPARAM MaxRangeOP[] = { + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT(""), // pData (postfix) + IDI_CPSUI_EMPTY, // IconID + 0 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + NULL, // pData (help line) + (DWORD)MIN_INT, // IconID + MAX_INT // lParam + } +}; + +OPTTYPE MaxRangeOT = { + + sizeof(OPTTYPE), // cbSize + TVOT_UDARROW, // Type + 0, // Flags OPTTF_xxxx + 2, // Count + 0, // BegCtrlID + MaxRangeOP, // pOptParam + 0 // Style, OTS_xxxx + }; + + +OPTPARAM MinMaxRangeOP[] = { + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("%"), // pData (postfix) + IDI_CPSUI_SCALING, // IconID + 0 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + NULL, // pData (help line) + (DWORD)MIN_INT, // IconID + MAX_INT // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + NULL, // pData (help line) + 2, // IconID + 50 // lParam + } +}; + +OPTTYPE TVOTUDArrowOT = { + + sizeof(OPTTYPE), // cbSize + TVOT_UDARROW, // Type + 0, // Flags OPTTF_xxxx + 2, // Count + 0, // BegCtrlID + MinMaxRangeOP, // pOptParam + 0 // Style, OTS_xxxx + }; + +OPTTYPE TVOTTrackBarOT = { + + sizeof(OPTTYPE), // cbSize + TVOT_TRACKBAR, // Type + 0, // Flags OPTTF_xxxx + 3, // Count + 0, // BegCtrlID + MinMaxRangeOP, // pOptParam + 0 // Style, OTS_xxxx + }; + +OPTTYPE TVOTScrollBarOT = { + + sizeof(OPTTYPE), // cbSize + TVOT_SCROLLBAR, // Type + 0, // Flags OPTTF_xxxx + 3, // Count + 0, // BegCtrlID + MinMaxRangeOP, // pOptParam + 0 // Style, OTS_xxxx + }; + +OPTPARAM TVOTLBCBOP[] = { + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + (LPTSTR)IDS_CPSUI_NOTINSTALLED, // pData + IDI_CPSUI_SEL_NONE, // IconID + 0 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT(" 1 MB"), // pData + IDI_CPSUI_MEM, // IconID + 0 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT(" 2 MB"), // pData + IDI_CPSUI_MEM, // IconID + 0 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT(" 4 MB"), // pData + IDI_CPSUI_MEM, // IconID + 0 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT(" 6 MB"), // pData + IDI_CPSUI_MEM, // IconID + 0 // lParam + }, + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT(" 8 MB"), // pData + IDI_CPSUI_MEM, // IconID + 0 // lParam + }, + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("10 MB"), // pData + IDI_CPSUI_MEM, // IconID + 0 // lParam + }, + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("12 MB"), // pData + IDI_CPSUI_MEM, // IconID + 0 // lParam + }, + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("14 MB"), // pData + IDI_CPSUI_MEM, // IconID + 0 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("16 MB"), // pData + IDI_CPSUI_MEM, // IconID + 0 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("18 MB"), // pData + IDI_CPSUI_MEM, // IconID + 0 // lParam + }, + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("20 MB"), // pData + IDI_CPSUI_MEM, // IconID + 0 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("24 MB"), // pData + IDI_CPSUI_MEM, // IconID + 0 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("32 MB"), // pData + IDI_CPSUI_MEM, // IconID + 0 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("48 MB"), // pData + IDI_CPSUI_MEM, // IconID + 0 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("64 MB"), // pData + IDI_CPSUI_MEM, // IconID + 0 // lParam + }, +}; + + +OPTTYPE TVOTListBoxOT = { + + sizeof(OPTTYPE), // cbSize + TVOT_LISTBOX, // Type + 0, // Flags OPTTF_xxxx + COUNT_ARRAY(TVOTLBCBOP), // Count + 0, // BegCtrlID + TVOTLBCBOP, // pOptParam + 0 // Style, OTS_xxxx + }; + + +OPTTYPE TVOTComboBoxOT = { + + sizeof(OPTTYPE), // cbSize + TVOT_COMBOBOX, // Type + 0, // Flags OPTTF_xxxx + COUNT_ARRAY(TVOTLBCBOP), // Count + 0, // BegCtrlID + TVOTLBCBOP, // pOptParam + 0 // Style, OTS_xxxx + }; + +TCHAR TVOTEditBoxBuf[128] = TEXT("Confidential"); + +OPTPARAM TVOTEditBoxOP[] = { + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("*Mark*"), // pData + IDI_CPSUI_WATERMARK, // IconID + 0 // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("Type in WaterMark text"), // pData + COUNT_ARRAY(TVOTEditBoxBuf), // IconID + 0 // lParam + } +}; + + +OPTTYPE TVOTEditBoxOT = { + + sizeof(OPTTYPE), // cbSize + TVOT_EDITBOX, // Type + 0, // Flags OPTTF_xxxx + 2, // Count + 0, // BegCtrlID + TVOTEditBoxOP, // pOptParam + 0 // Style, OTS_xxxx + }; + +OPTPARAM TVOTChkBoxOP[] = { + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + CHKBOXS_FALSE_TRUE, // style + TEXT("Let's do it!"), // pData + IDI_CPSUI_TELEPHONE, // IconID + 0 // lParam + } +}; + + + +OPTTYPE TVOTChkBoxOT = { + + sizeof(OPTTYPE), // cbSize + TVOT_CHKBOX, // Type + 0, // Flags OPTTF_xxxx + 1, // Count + 0, // BegCtrlID + TVOTChkBoxOP, // pOptParam + 0 // Style, OTS_xxxx + }; + + +OPTPARAM ChkBoxTypeOP[] = { + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("CHKBOXS_FALSE_TRUE"), // pData + IDI_CPSUI_EMPTY, // IconID + CHKBOXS_FALSE_TRUE // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("CHKBOXS_NO_YES"), // pData + IDI_CPSUI_EMPTY, // IconID + CHKBOXS_NO_YES // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("CHKBOXS_OFF_ON"), // pData + IDI_CPSUI_EMPTY, // IconID + CHKBOXS_OFF_ON // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("CHKBOXS_FALSE_PDATA"), // pData + IDI_CPSUI_EMPTY, // IconID + CHKBOXS_FALSE_PDATA // lParam + }, + + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("CHKBOXS_NO_PDATA"), // pData + IDI_CPSUI_EMPTY, // IconID + CHKBOXS_NO_PDATA // lParam + }, + + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("CHKBOXS_OFF_PDATA"), // pData + IDI_CPSUI_EMPTY, // IconID + CHKBOXS_OFF_PDATA // lParam + }, + + { + sizeof(OPTPARAM), // cbSize + 0, // OPTPF_xxx + 0, // style + TEXT("CHKBOXS_NONE_PDATA"), // pData + IDI_CPSUI_EMPTY, // IconID + CHKBOXS_NONE_PDATA // lParam + } +}; + + +OPTTYPE ChkBoxTypeOT = { + + sizeof(OPTTYPE), // cbSize + TVOT_LISTBOX, // Type + 0, // Flags OPTTF_xxxx + COUNT_ARRAY(ChkBoxTypeOP), // Count + 0, // BegCtrlID + ChkBoxTypeOP, // pOptParam + 0 // Style, OTS_xxxx + }; + +EXTCHKBOX TV_ECB = { + + sizeof(EXTCHKBOX), + ECBF_OVERLAY_WARNING_ICON, + TEXT("Extended CheckBox Test"), + (LPTSTR)IDS_CPSUI_SLASH_SEP, + TEXT("Got Checked!!!"), + IDI_APPLE }; + +EXTPUSH TV_EP = { + + sizeof(EXTPUSH), + 0, + TEXT("Extended Push Test"), + NULL, //DLGPROC + IDI_APPLE, + 0 }; + + + +OPTITEM TVTestOptItems[] = { + + { sizeof(OPTITEM), LEVEL_0, 0, OPTIF_NONE, 0, + (LPTSTR)TEXT("TreeView Test"), IDI_CPSUI_QUESTION, NULL, + NULL, 0, DMPUB_TVTEST }, + + { sizeof(OPTITEM), LEVEL_1, 0, OPTIF_COLLAPSE, 0, + (LPTSTR)TEXT("CPSUI Options"), 0, NULL, + NULL, 0, DMPUB_TVOPT }, + + { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, + (LPTSTR)TEXT("Extended Type"), 0, &ECB_EP_ECB, + &ECB_EP_OT, 0, DMPUB_TVOPT_ECB_EP }, + + { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, + (LPTSTR)TEXT("Disabled Extended"), 0, NULL, + &NoYesOT, 0, DMPUB_EXT_DISABLED }, + + { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, + (LPTSTR)TEXT("Overlay 'Warning' Icon"), 0, NULL, + &NoYesOT, 0, DMPUB_EXT_OVERLAY_WARNING }, + + { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, + (LPTSTR)TEXT("Overlay 'Stop' Icon"), 0, NULL, + &NoYesOT, 0, DMPUB_EXT_OVERLAY_STOP }, + + { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, + (LPTSTR)TEXT("Overlay 'No' Icon"), 0, NULL, + &NoYesOT, 0, DMPUB_EXT_OVERLAY_NO }, + + { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_COLLAPSE, 0, + (LPTSTR)TEXT("OptItem/OptType"), 0, NULL, + NULL, 0, DMPUB_TVOPT }, + + { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, + (LPTSTR)TEXT("Disabled OptType"), 0, NULL, + &NoYesOT, 0, DMPUB_TVOPT_DISABLED }, + + { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, + (LPTSTR)TEXT("Overlay 'Warning' Icon"), 0, NULL, + &NoYesOT, 0, DMPUB_TVOPT_OVERLAY_WARNING }, + + { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, + (LPTSTR)TEXT("Overlay 'Stop' Icon"), 0, NULL, + &NoYesOT, 0, DMPUB_TVOPT_OVERLAY_STOP }, + + { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, + (LPTSTR)TEXT("Overlay 'No' Icon"), 0, NULL, + &NoYesOT, 0, DMPUB_TVOPT_OVERLAY_NO }, + + { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_COLLAPSE, 0, + (LPTSTR)TEXT("ScrollBar/TrackBar Ranges"), 0, NULL, + NULL, 0, DMPUB_TVOPT }, + + { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, + TEXT("Min Range"), MIN_INT, NULL, + &MinRangeOT, 0, DMPUB_MINRANGE }, + + { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, + TEXT("Max. Range"), MAX_INT, NULL, + &MaxRangeOT, 0, DMPUB_MAXRANGE }, + + { sizeof(OPTITEM), LEVEL_1, 0, OPTIF_NONE, 0, + TEXT("TVOT Test"), IDI_CPSUI_QUESTION, NULL, + NULL, 0, DMPUB_TVOPT_TEST }, + + { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, + (LPTSTR)TEXT("TVOT_2STATES"), 0, NULL, + &TVOT2StatesOT, 0, DMPUB_2STATES }, + + { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, + TEXT("TVOT_3STATES"), 0, NULL, + &TVOT3StatesOT, 0, DMPUB_3STATES }, + + { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, + TEXT("TVOT_UDARROW"), 55, NULL, + &TVOTUDArrowOT, 0, DMPUB_UDARROW }, + + { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, + TEXT("TVOT_TRACKBAR"), 100, NULL, + &TVOTTrackBarOT, 0, DMPUB_TRACKBAR }, + + { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, + TEXT("TVOT_SCROLLBAR"), 210, NULL, + &TVOTScrollBarOT, 0, DMPUB_SCROLLBAR }, + + { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, + TEXT("TVOT_LISTBOX"), 2, NULL, + &TVOTListBoxOT, 0, DMPUB_LISTBOX }, + + { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, + (LPTSTR)TEXT("Include 16x16 Icons"), 1, NULL, + &NoYesOT, 0, DMPUB_TVOPT_ICONS }, + + { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, + TEXT("TVOT_COMBOBOX"), 4, NULL, + &TVOTComboBoxOT, 0, DMPUB_COMBOBOX }, + + { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK | OPTIF_COLLAPSE, 0, + (LPTSTR)TEXT("Include 16x16 Icons"), 1, NULL, + &NoYesOT, 0, DMPUB_TVOPT_ICONS }, + + { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, + TEXT("TVOT_EDITBOX"), 0, NULL, // fill in TVOTEditBoxBuf later + &TVOTEditBoxOT, 0, DMPUB_EDITBOX }, + + { sizeof(OPTITEM), LEVEL_2, 0, OPTIF_CALLBACK, 0, + TEXT("TVOT_CHKBOX"), 0, NULL, + &TVOTChkBoxOT, 0, DMPUB_CHKBOX }, + + { sizeof(OPTITEM), LEVEL_3, 0, OPTIF_CALLBACK, 0, + TEXT("CheckBox Type"), 0, NULL, + &ChkBoxTypeOT, 0, DMPUB_CHKBOX_TYPE } + +}; + + + +INT_PTR +CALLBACK +PushButtonProc( + HWND hDlg, + UINT Msg, + WPARAM wParam, + LPARAM lParam + ) +{ + +#ifndef DBG + UNREFERENCED_PARAMETER(lParam); +#endif + + switch (Msg) { + + case WM_INITDIALOG: /* message: initialize dialog box */ + + CPSUIDBG(DBG_PUSHDLGPROC, + ("PushButtonProc lParam=%s", (LPSTR)lParam)); + break; + + case WM_COMMAND: + + switch(LOWORD(wParam)) { + + case IDOK: + case IDCANCEL: + + EndDialog(hDlg, (BOOL)(LOWORD(wParam) == IDOK)); + return(TRUE); + } + } + + return(FALSE); +} + + + +INT_PTR +APIENTRY +MyAboutProc( + HWND hDlg, + UINT Msg, + WPARAM wParam, + LPARAM lParam + ) + +/*++ + +Routine Description: + + This is the about... callback which pop up appliation's own about + + +--*/ +{ + PCOMPROPSHEETUI pCPSUI = NULL; + TCHAR Buf[128] = {0}; + HRESULT hr = S_OK; + + switch (Msg) { + + case WM_INITDIALOG: /* message: initialize dialog box */ + + pCPSUI = (PCOMPROPSHEETUI)lParam; + + hr = pCPSUI ? S_OK : E_INVALIDARG; + + if (SUCCEEDED(hr)) + { + hr = StringCchPrintf(Buf, ARRAY_SIZE(Buf), TEXT("About %s"), pCPSUI->pCallerName); + } + + if (SUCCEEDED(hr)) + { + hr = SetWindowText(hDlg, Buf) ? S_OK : E_FAIL; + } + + if (SUCCEEDED(hr)) + { + hr = StringCchPrintf(Buf, ARRAY_SIZE(Buf), + TEXT("%s Version %u.%u"), + pCPSUI->pCallerName, + (UINT)HIBYTE(pCPSUI->CallerVersion), + (UINT)LOBYTE(pCPSUI->CallerVersion)); + } + + if (SUCCEEDED(hr)) + { + hr = SetDlgItemText(hDlg, IDD_ABOUT1, Buf) ? S_OK : E_FAIL; + } + + if (SUCCEEDED(hr)) + { + hr = StringCchPrintf(Buf, ARRAY_SIZE(Buf), + TEXT("%s Version %u.%u"), + pCPSUI->pOptItemName, + (UINT)HIBYTE(pCPSUI->OptItemVersion), + (UINT)LOBYTE(pCPSUI->OptItemVersion)); + } + + if (SUCCEEDED(hr)) + { + hr = SetDlgItemText(hDlg, IDD_ABOUT2, Buf) ? S_OK : E_FAIL; + } + + break; + + case WM_COMMAND: + + switch(LOWORD(wParam)) { + + case IDOK: + case IDCANCEL: + + EndDialog(hDlg, (BOOL)(LOWORD(wParam) == IDOK)); + return(TRUE); + } + } + + return (FALSE); +} + + + +POPTITEM +FindOptItem( + POPTITEM pOptItem, + UINT cOptItem, + BYTE DMPubID + ) +{ + while (cOptItem--) { + + if (pOptItem->DMPubID == DMPubID) { + + return(pOptItem); + } + + ++pOptItem; + } + + return(NULL); +} + + + +CPSUICALLBACK +TVTestCallBack( + _In_ PCPSUICBPARAM pCPSUICBParam + ) +{ + POPTITEM pCurItem = pCPSUICBParam->pCurItem; + POPTITEM pItem; + BYTE DMPubID; + LONG Sel; + LONG Action = CPSUICB_ACTION_NONE; + + + DMPubID = pCurItem->DMPubID; + Sel = pCurItem->Sel; + + switch (pCPSUICBParam->Reason) { + + case CPSUICB_REASON_OPTITEM_SETFOCUS: + + CPSUIDBG(DBG_TVTESTCB, ("Got OPTITEM_SETFOCUS CallBack now")); + + switch (DMPubID) + { + case DMPUB_MINRANGE: + { + pItem = FindOptItem(pCPSUICBParam->pOptItem, + pCPSUICBParam->cOptItem, + DMPUB_MAXRANGE); + + if (pItem) + { + pCurItem->pOptType->pOptParam[1].lParam = (LONG)pItem->Sel; + } + } + + break; + + case DMPUB_MAXRANGE: + { + pItem = FindOptItem(pCPSUICBParam->pOptItem, + pCPSUICBParam->cOptItem, + DMPUB_MINRANGE); + + if (pItem) + { + pCurItem->pOptType->pOptParam[1].IconID = (DWORD)pItem->Sel; + } + } + + break; + + } + + break; + + case CPSUICB_REASON_ABOUT: + + DialogBoxParam(hInstApp, + MAKEINTRESOURCE(DLGABOUT), + pCPSUICBParam->hDlg, + MyAboutProc, + (LPARAM)(pCPSUICBParam->pOldSel)); + + break; + + case CPSUICB_REASON_ECB_CHANGED: + + CPSUIDBG(DBG_TVTESTCB, ("Got ECB_CHANGED CallBack now")); + + switch (DMPubID) { + + case DMPUB_TVOPT_ECB_EP: + + if (pCurItem->Flags & OPTIF_ECB_CHECKED) { + + TV_EP.IconID = + TV_ECB.IconID = IDI_APPLE; + + } else { + + TV_EP.IconID = + TV_ECB.IconID = 0; + } + + Action = CPSUICB_ACTION_OPTIF_CHANGED; + break; + + default: + + break; + } + + break; + + case CPSUICB_REASON_SEL_CHANGED: + + CPSUIDBG(DBG_TVTESTCB, ("Got SEL_CHANGED CallBack now")); + + switch (DMPubID) + { + case DMPUB_CHKBOX_TYPE: + { + pItem = FindOptItem(pCPSUICBParam->pOptItem, + pCPSUICBParam->cOptItem, + DMPUB_CHKBOX); + + if (pItem) + { + pItem->pOptType->pOptParam[0].Style = (BYTE)pCurItem->Sel; + + pItem->Flags |= OPTIF_CHANGED; + Action = CPSUICB_ACTION_OPTIF_CHANGED; + } + } + break; + + case DMPUB_TVOPT_ICONS: + + pItem = pCurItem - 1; + + if (Sel) { + + pItem->pOptType->Style &= ~OTS_LBCB_NO_ICON16_IN_ITEM; + + } else { + + pItem->pOptType->Style |= OTS_LBCB_NO_ICON16_IN_ITEM; + } + + break; + + case DMPUB_EXT_OVERLAY_WARNING: + + if (Sel) { + + TV_EP.Flags |= EPF_OVERLAY_WARNING_ICON; + TV_ECB.Flags |= ECBF_OVERLAY_WARNING_ICON; + + } else { + + TV_EP.Flags &= ~EPF_OVERLAY_WARNING_ICON; + TV_ECB.Flags &= ~ECBF_OVERLAY_WARNING_ICON; + } + + break; + + case DMPUB_EXT_OVERLAY_STOP: + + if (Sel) { + + TV_EP.Flags |= EPF_OVERLAY_STOP_ICON; + TV_ECB.Flags |= ECBF_OVERLAY_STOP_ICON; + + } else { + + TV_EP.Flags &= ~EPF_OVERLAY_STOP_ICON; + TV_ECB.Flags &= ~ECBF_OVERLAY_STOP_ICON; + } + + break; + + case DMPUB_EXT_OVERLAY_NO: + + if (Sel) { + + TV_EP.Flags |= EPF_OVERLAY_NO_ICON; + TV_ECB.Flags |= ECBF_OVERLAY_NO_ICON; + + } else { + + TV_EP.Flags &= ~EPF_OVERLAY_NO_ICON; + TV_ECB.Flags &= ~ECBF_OVERLAY_NO_ICON; + } + + break; + + case DMPUB_MINRANGE: + + MinMaxRangeOP[1].IconID = (DWORD)Sel; + break; + + case DMPUB_MAXRANGE: + + MinMaxRangeOP[1].lParam = (LONG)Sel; + break; + + case DMPUB_TVOPT_OVERLAY_WARNING: + case DMPUB_TVOPT_OVERLAY_STOP: + case DMPUB_TVOPT_OVERLAY_NO: + + Action = CPSUICB_ACTION_REINIT_ITEMS; + + case DMPUB_TVOPT_ECB_EP: + + if (Sel) { + + pCurItem->Flags &= ~OPTIF_EXT_DISABLED; + + } else { + + pCurItem->Flags |= OPTIF_EXT_DISABLED; + } + + pCurItem->Flags |= OPTIF_CHANGED; + Action = CPSUICB_ACTION_OPTIF_CHANGED; + + // + // Fall through + // + + case DMPUB_TVOPT_DISABLED: + case DMPUB_EXT_DISABLED: + + pItem = FindOptItem(pCPSUICBParam->pOptItem, + pCPSUICBParam->cOptItem, + DMPUB_2STATES); + + if (pItem) { + + do { + + if ((pItem->DMPubID >= DMPUB_2STATES) && + (pItem->DMPubID <= DMPUB_CHKBOX)) { + + switch (DMPubID) { + + case DMPUB_TVOPT_OVERLAY_WARNING: + + if (Sel) { + + pItem->Flags |= OPTIF_OVERLAY_WARNING_ICON; + + } else { + + pItem->Flags &= ~OPTIF_OVERLAY_WARNING_ICON; + } + + break; + + case DMPUB_TVOPT_OVERLAY_STOP: + + if (Sel) { + + pItem->Flags |= OPTIF_OVERLAY_STOP_ICON; + + } else { + + pItem->Flags &= ~OPTIF_OVERLAY_STOP_ICON; + } + + break; + + case DMPUB_TVOPT_OVERLAY_NO: + + if (Sel) { + + pItem->Flags |= OPTIF_OVERLAY_NO_ICON; + + } else { + + pItem->Flags &= ~OPTIF_OVERLAY_NO_ICON; + } + + break; + + case DMPUB_TVOPT_DISABLED: + + if (Sel) { + + pItem->pOptType->Flags |= OPTTF_TYPE_DISABLED; + + } else { + + pItem->pOptType->Flags &= ~OPTTF_TYPE_DISABLED; + } + + break; + + case DMPUB_EXT_DISABLED: + + if (Sel) { + + pItem->Flags |= OPTIF_EXT_DISABLED; + + } else { + + pItem->Flags &= ~OPTIF_EXT_DISABLED; + } + + break; + + case DMPUB_TVOPT_ECB_EP: + + switch (Sel) { + + case 0: + + pItem->Flags |= OPTIF_EXT_HIDE; + break; + + case 1: + + pItem->Flags &= ~(OPTIF_EXT_HIDE | + OPTIF_EXT_IS_EXTPUSH); + pItem->pExtChkBox = &TV_ECB; + + break; + + case 2: + + pItem->Flags &= ~OPTIF_EXT_HIDE; + pItem->Flags |= OPTIF_EXT_IS_EXTPUSH; + pItem->pExtPush = &TV_EP; + break; + } + } + } + + pItem->Flags |= OPTIF_CHANGED; + + } while ((pItem++)->DMPubID != DMPUB_CHKBOX); + } + + break; + + default: + + break; + } + + break; + + case CPSUICB_REASON_PUSHBUTTON: + + CPSUIDBG(DBG_TVTESTCB, ("Got PUSH Button CallBack now")); + break; + + case CPSUICB_REASON_EXTPUSH: + + DialogBoxParam(hInstApp, + MAKEINTRESOURCE(EXTPUSH_DLG), + pCPSUICBParam->hDlg, + PushButtonProc, + (LPARAM)(pCPSUICBParam->pOldSel)); + break; + + default: + + break; + } + + return(Action); +} + + + +BOOL +SetupComPropSheetUI( + _In_ PCOMPROPSHEETUI pCPSUI + ) +{ + static BOOL UpdateEditBox = TRUE; + UINT i; + + + ZeroMemory(pCPSUI, sizeof(COMPROPSHEETUI)); + + pCPSUI->cbSize = sizeof(COMPROPSHEETUI); + pCPSUI->hInstCaller = hInstApp; + pCPSUI->pCallerName = (LPTSTR)TitleName; + pCPSUI->CallerVersion = 0x100; + pCPSUI->pOptItemName = (LPTSTR)OptItemName; + pCPSUI->OptItemVersion = 0x400; + pCPSUI->UserData = (ULONG_PTR)pCPSUI; + pCPSUI->pHelpFile = (LPTSTR)TEXT("CPSUISam.hlp"); + pCPSUI->pfnCallBack = TVTestCallBack; + pCPSUI->pOptItem = TVTestOptItems; + pCPSUI->cOptItem = COUNT_ARRAY(TVTestOptItems); + pCPSUI->Flags = 0; + pCPSUI->pDlgPage = CPSUI_PDLGPAGE_TREEVIWONLY; + pCPSUI->cDlgPage = 0; + + + if (UpdateEditBox) { + + // + // Fixup compiler warning for the LPSTR and LONG + // + + for (i = 0; i < COUNT_ARRAY(TVTestOptItems); i++) { + + if (TVTestOptItems[i].DMPubID == DMPUB_EDITBOX) { + + TVTestOptItems[i].pSel = (LPTSTR)TVOTEditBoxBuf; + UpdateEditBox = FALSE; + break; + } + } + } + + if (UpdatePermission) { + + pCPSUI->Flags |= CPSUIF_UPDATE_PERMISSION; + } + + if (!UseStdAbout) { + + pCPSUI->Flags |= CPSUIF_ABOUT_CALLBACK; + } + + return(TRUE); +} diff --git a/print/cpsuisam/CPSUIDAT.H b/print/cpsuisam/CPSUIDAT.H new file mode 100644 index 00000000..7043d9c2 --- /dev/null +++ b/print/cpsuisam/CPSUIDAT.H @@ -0,0 +1,73 @@ +/*++ + +Copyright (c) 1990-2003 Microsoft Corporation +All Rights Reserved + + +Module Name: + + cpsuidat.h + + +Abstract: + + This module + + +[Environment:] + + Windows 2000, Windows XP, Windows Server 2003 - Common Printer Driver UI DLL + + +--*/ + + +#define COUNT_ARRAY(a) (sizeof(a) / sizeof((a)[0])) + + +#define OPTIF_NONE 0 + +#define LEVEL_0 0 +#define LEVEL_1 1 +#define LEVEL_2 2 +#define LEVEL_3 3 +#define LEVEL_4 4 + + +#define DMPUB_TVTEST (DMPUB_USER + 1) +#define DMPUB_TVOPT (DMPUB_USER + 2) +#define DMPUB_TVOPT_ECB_EP (DMPUB_USER + 3) +#define DMPUB_TVOPT_ICONS (DMPUB_USER + 4) +#define DMPUB_TVOPT_DISABLED (DMPUB_USER + 5) +#define DMPUB_TVOPT_TEST (DMPUB_USER + 6) +#define DMPUB_2STATES (DMPUB_USER + 7) +#define DMPUB_3STATES (DMPUB_USER + 8) +#define DMPUB_UDARROW (DMPUB_USER + 9) +#define DMPUB_TRACKBAR (DMPUB_USER + 10) +#define DMPUB_SCROLLBAR (DMPUB_USER + 11) +#define DMPUB_LISTBOX (DMPUB_USER + 12) +#define DMPUB_COMBOBOX (DMPUB_USER + 13) +#define DMPUB_EDITBOX (DMPUB_USER + 14) +#define DMPUB_PUSHBUTTON (DMPUB_USER + 15) +#define DMPUB_CHKBOX (DMPUB_USER + 16) +#define DMPUB_CHKBOX_TYPE (DMPUB_USER + 17) +#define DMPUB_TVOPT_OVERLAY_WARNING (DMPUB_USER + 18) +#define DMPUB_TVOPT_OVERLAY_STOP (DMPUB_USER + 19) +#define DMPUB_TVOPT_OVERLAY_NO (DMPUB_USER + 20) +#define DMPUB_EXT_OVERLAY_WARNING (DMPUB_USER + 21) +#define DMPUB_EXT_OVERLAY_STOP (DMPUB_USER + 22) +#define DMPUB_EXT_OVERLAY_NO (DMPUB_USER + 23) +#define DMPUB_EXT_DISABLED (DMPUB_USER + 24) +#define DMPUB_MINRANGE (DMPUB_USER + 25) +#define DMPUB_MAXRANGE (DMPUB_USER + 26) + +#define MAX_INT 0x00007fff +#define MIN_INT 0xFFFF8000 + + + +BOOL +SetupComPropSheetUI +( + _In_ PCOMPROPSHEETUI pCPSUI +); diff --git a/print/cpsuisam/CPSUISAM.DEF b/print/cpsuisam/CPSUISAM.DEF new file mode 100644 index 00000000..f254e960 --- /dev/null +++ b/print/cpsuisam/CPSUISAM.DEF @@ -0,0 +1,6 @@ +; module-definition file for SurPtrUI -- used by LINK.EXE + +NAME CPSUI ; application's module name + +DESCRIPTION 'Microsoft Windows 2000/Windows XP/Windows Server 2003 Common Property Sheet UI Sample Program' + diff --git a/print/cpsuisam/CPSUISAM.DLG b/print/cpsuisam/CPSUISAM.DLG new file mode 100644 index 00000000..29112c5d --- /dev/null +++ b/print/cpsuisam/CPSUISAM.DLG @@ -0,0 +1,35 @@ +1 DLGINCLUDE "cpsuisam.h" + +PUSHBUTTON_DLG DIALOGEX 9, 18, 160, 100 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Push Button Dialog" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "The TVOT_PUSHBUTTON's Button is Pushed. Press OK to Continue...", + -1, 10, 21, 141, 37 + DEFPUSHBUTTON "OK", IDOK, 88, 78, 63, 14 +END + +DLGABOUT DIALOGEX 5, 15, 200, 90 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "About" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "About 1 Text", IDD_ABOUT1, 38, 12, 152, 20 + LTEXT "About 2 Text", IDD_ABOUT2, 38, 36, 152, 24 + DEFPUSHBUTTON "OK", IDOK, 126, 68, 59, 14 + ICON IDI_APPLE, IDD_ABOUTICON, 8, 20, 18, 20 +END + +EXTPUSH_DLG DIALOGEX 6, 18, 214, 78 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Extended Push Button DIALOG BOX" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "You just push the 'Extended Push Test' push button. To Continue press OK button...", + -1, 12, 10, 187, 30 + DEFPUSHBUTTON "OK", IDOK, 129, 54, 69, 14 +END diff --git a/print/cpsuisam/CPSUISAM.H b/print/cpsuisam/CPSUISAM.H new file mode 100644 index 00000000..bcddc730 --- /dev/null +++ b/print/cpsuisam/CPSUISAM.H @@ -0,0 +1,37 @@ +/*++ + +Copyright (c) 1990-2003 Microsoft Corporation +All Rights Reserved + + +Module Name: + + cpsuisam.h + + +Abstract: + + This module is the header file for the sample + + +[Environment:] + + +--*/ + + +#define IDM_PERMISSION 10 +#define IDM_USESTDABOUT 20 +#define IDM_DOCPROP 30 +#define IDM_TVTEST 40 +#define IDM_DOCPROP_TVTEST 50 + +#define IDI_CPSUISAMPLE 500 +#define IDI_APPLE 510 + +#define PUSHBUTTON_DLG 1000 +#define DLGABOUT 1010 +#define EXTPUSH_DLG 1020 +#define IDD_ABOUT1 201 +#define IDD_ABOUT2 202 +#define IDD_ABOUTICON 203 diff --git a/print/cpsuisam/DEBUG.C b/print/cpsuisam/DEBUG.C new file mode 100644 index 00000000..48853686 --- /dev/null +++ b/print/cpsuisam/DEBUG.C @@ -0,0 +1,114 @@ +/*++ + +Copyright (c) 1990-2003 Microsoft Corporation +All Rights Reserved + +Module Name: + + debug.c + +Abstract: + + This module contains all debugging routines + +[Environment:] + + NT Windows - Common Printer Driver UI DLL. + +[Notes:] + +Revision History: + +--*/ + +#include "precomp.h" +#pragma hdrstop + +#if DBG + +BOOL DoCPSUIWarn = TRUE; + +VOID +cdecl +CPSUIDbgPrint +( + LPCSTR pszFormat, + ... +) +/*++ + +Routine Description: + + This fucntion output the debug informat to the debugger + +Arguments: + + pszFormat - format string + + ... - variable data + +Return Value: + + VOID + +--*/ +{ + va_list vaList; + static TCHAR OutBuf[768]; +#ifdef UNICODE + static WCHAR FormatBuf[256]; +#endif + // + // We assume that UNICODE flag is turn on for the compilation, bug the + // format string passed to here is ASCII version, so we need to convert + // it to LPWSTR before the wvsprintf() + // + + va_start(vaList, pszFormat); + +#ifdef UNICODE + MultiByteToWideChar(CP_ACP, 0, pszFormat, -1, FormatBuf, COUNT_ARRAY(FormatBuf)); + StringCchVPrintf(OutBuf, COUNT_ARRAY(OutBuf), FormatBuf, vaList); +#else + StringCchVPrintf(OutBuf, COUNT_ARRAY(OutBuf), pszFormat, vaList); +#endif + va_end(vaList); + + OutputDebugString((LPTSTR)OutBuf); + OutputDebugString(TEXT("\n")); +} + +VOID +CPSUIDbgType +( + INT Type +) +/*++ + +Routine Description: + + this function output the ERROR/WARNING message + +Arguments: + + Type + +Return Value: + +--*/ +{ + static TCHAR DebugDLLName[] = TEXT("SurPtrUI"); + + if (Type < 0) + { + OutputDebugString(TEXT("ERROR) ")); + } + else if (Type > 0) + { + OutputDebugString(TEXT("WARNING: ")); + } + OutputDebugString(DebugDLLName); + OutputDebugString(TEXT("!")); +} + +#endif // DBG diff --git a/print/cpsuisam/DEBUG.H b/print/cpsuisam/DEBUG.H new file mode 100644 index 00000000..5d6b88a3 --- /dev/null +++ b/print/cpsuisam/DEBUG.H @@ -0,0 +1,66 @@ +/*++ + +Copyright (c) 1990-2003 Microsoft Corporation +All Rights Reserved + + +Module Name: + + debug.h + + +Abstract: + + This module contains all debugger definitions + + +[Environment:] + + NT Windows - Common Printer Driver UI DLL. + + +--*/ + + +#if DBG + +VOID +cdecl +CPSUIDbgPrint +( + LPCSTR pszFormat, + ... +); + +VOID +CPSUIDbgType +( + INT Type +); + +extern BOOL DoCPSUIWarn; + +#define DBGP(x) (CPSUIDbgPrint x) + +#define DEFINE_DBGVAR(x) DWORD DBG_CPSUIFILENAME=(x) + +#define CPSUIDBG(x,y) if((x)&DBG_CPSUIFILENAME){CPSUIDbgType(0);DBGP(y);} + +#define CPSUIDBGBLK(x) x; +#define CPSUIWARN(x) if(DoCPSUIWarn) { CPSUIDbgType(1);DBGP(x); } +#define CPSUIERR(x) CPSUIDbgType(-1);DBGP(x) +#define CPSUIRIP(x) CPSUIERR(x); DebugBreak() +#define CPSUIASSERT(b,x,e,i) \ + if (!(e)) { _CPSUIAssert(x,#e,__FILE__,(UINT)__LINE__,(DWORD)i,b); } + +#else // DBG + +#define CPSUIDBGBLK(x) +#define DEFINE_DBGVAR(x) +#define CPSUIDBG(x,y) +#define CPSUIWARN(x) +#define CPSUIERR(x) +#define CPSUIRIP(x) +#define CPSUIASSERT(b,x,e,i) + +#endif // DBG diff --git a/print/cpsuisam/PRECOMP.H b/print/cpsuisam/PRECOMP.H new file mode 100644 index 00000000..4e63995b --- /dev/null +++ b/print/cpsuisam/PRECOMP.H @@ -0,0 +1,17 @@ +// +// Copyright (c) 1990-2003 Microsoft Corporation +// All Rights Reserved +// + +#include <stddef.h> +#include <windows.h> +#include <winspool.h> +#include <winddiui.h> +#include <commctrl.h> +#include <commdlg.h> +#include <compstui.h> +#include <shlwapi.h> +#include <strsafe.h> +#include "debug.h" +#include "cpsuisam.h" +#include "cpsuidat.h" diff --git a/print/cpsuisam/ReadMe.md b/print/cpsuisam/ReadMe.md new file mode 100644 index 00000000..a4fddfb9 --- /dev/null +++ b/print/cpsuisam/ReadMe.md @@ -0,0 +1,13 @@ +Common Property Sheet UI Sample +=============================== + +The CPSUISAM application causes the Common Property Sheet User Interface (CPSUI) to call the Windows print spooler to create property sheet pages for the system's default printer. + +Printer interface DLLs must not perform this action and this sample shows how create property sheet pages for a printer. + +The application then creates an additional property sheet page to illustrate some of the techniques that you can use when you are using CPSUI to create a new page. + +CPSUI is a user-mode DLL that enables you to create property sheet pages that have a standard appearance. + +CPSUIAM causes CPSUI to call the Windows print spooler to create property sheet pages for the system's default printer. The application then creates an additional property sheet page to illustrate some of the techniques that you can use when you are using CPSUI to create a new page. For more information, see [Common Property Sheet User Interface](http://msdn.microsoft.com/en-us/library/windows/hardware/ff546163(v=vs.85).aspx). + diff --git a/print/cpsuisam/cpsuisam.c b/print/cpsuisam/cpsuisam.c new file mode 100644 index 00000000..d63b5844 --- /dev/null +++ b/print/cpsuisam/cpsuisam.c @@ -0,0 +1,665 @@ +/*++ + +Copyright (c) 1990-2003 Microsoft Corporation +All Rights Reserved + + +Module Name: + + cpsuisam.c + + +Abstract: + + This module contrains sample prototype for the + Windows 2000/Windows XP/Windows Server 2003 common Property + Sheet user interface + +--*/ + +#include "precomp.h" +#pragma hdrstop + +#define DBG_CPSUIFILENAME DbgCPSUISam + + + +#define DBG_WINMAINPROC 0x00000001 + +DEFINE_DBGVAR(0); + + + +#define HAS_TVTEST_PAGES 0x01 +#define HAS_DOCPROP_PAGES 0x02 + + + +extern HINSTANCE hInstApp; +extern TCHAR TitleName[]; +extern TCHAR ClassName[]; +extern TCHAR MenuName[]; +extern TCHAR szWinSpool[]; +extern CHAR szDocPropSheets[]; +extern BOOL UpdatePermission; +extern BOOL UseStdAbout; + + +HWND hWndApp = NULL; + + +typedef struct _CPSUISAMPLE +{ + HANDLE hParent; + HANDLE hCPSUI; + HANDLE hDocProp; + PFNCOMPROPSHEET pfnCPS; + COMPROPSHEETUI CPSUI; + DOCUMENTPROPERTYHEADER DPHdr; + HGLOBAL hDevMode; + HGLOBAL hDevNames; +} CPSUISAMPLE, *PCPSUISAMPLE; + +BOOL +GetDefPrinter +( + PCPSUISAMPLE pCPSUISample +) +{ + HGLOBAL hDevMode = NULL; + HGLOBAL hDevNames = NULL; + LPTSTR pszPrinterName = NULL; + DEVMODE *pDM = NULL; + DEVNAMES *pDN = NULL; + HANDLE hPrinter = NULL; + PAGESETUPDLG PSD = {0}; + BOOL Ok = FALSE; + + PSD.lStructSize = sizeof(PSD); + PSD.Flags = PSD_RETURNDEFAULT; + + if (PageSetupDlg(&PSD)) + { + hDevMode = PSD.hDevMode; + + if (NULL != hDevMode) + { + pDM = (DEVMODE *)GlobalLock(hDevMode); + if (NULL != pDM) + { + hDevNames = PSD.hDevNames; + if (hDevNames) + { + pDN = (DEVNAMES *)GlobalLock(hDevNames); + if (NULL != pDN) + { + pszPrinterName = (LPTSTR)pDN + pDN->wDeviceOffset; + if (pszPrinterName != NULL) + { + if (OpenPrinter(pszPrinterName, &hPrinter, NULL)) + { + Ok = TRUE; + } + } + } + } + } + } + + if (Ok) + { + HGLOBAL h = pCPSUISample->hDevMode; + + if (NULL != h) + { + GlobalUnlock(h); + GlobalFree(h); + } + + h = pCPSUISample->hDevNames; + + if (NULL != h) + { + GlobalUnlock(h); + GlobalFree(h); + } + + if (pCPSUISample->DPHdr.hPrinter) + { + ClosePrinter(pCPSUISample->DPHdr.hPrinter); + } + + pCPSUISample->hDevMode = PSD.hDevMode; + pCPSUISample->hDevNames = PSD.hDevNames; + + pCPSUISample->DPHdr.cbSize = sizeof(DOCUMENTPROPERTYHEADER); + pCPSUISample->DPHdr.hPrinter = hPrinter; + pCPSUISample->DPHdr.pszPrinterName = pszPrinterName; + pCPSUISample->DPHdr.pdmIn = + pCPSUISample->DPHdr.pdmOut = pDM; + pCPSUISample->DPHdr.fMode = (DM_IN_BUFFER | DM_IN_PROMPT | DM_OUT_BUFFER); + + if (!UpdatePermission) + { + pCPSUISample->DPHdr.fMode |= DM_NOPERMISSION; + } + } + else + { + hDevMode = PSD.hDevMode; + hDevNames = PSD.hDevNames; + + if (NULL != hDevMode) + { + GlobalUnlock(hDevMode); + GlobalFree(hDevMode); + } + + if (NULL != hDevNames) + { + GlobalUnlock(hDevNames); + GlobalFree(hDevNames); + } + + if (hPrinter) + { + ClosePrinter(hPrinter); + } + } + } + + return Ok; +} + + +LONG +CALLBACK +CPSUIFunc +( + _In_ PPROPSHEETUI_INFO pPSUIInfo, + LPARAM lParam +) +{ + PPROPSHEETUI_INFO_HEADER pPSUIInfoHdr; + PCPSUISAMPLE pCPSUISample; + HANDLE h; + INSERTPSUIPAGE_INFO InsPI; + + if (!pPSUIInfo) + { + return FALSE; + } + + switch (pPSUIInfo->Reason) + { + case PROPSHEETUI_REASON_INIT: + + pCPSUISample = (PCPSUISAMPLE)LocalAlloc(LPTR, sizeof(CPSUISAMPLE)); + if (NULL == pCPSUISample) + { + return(-1); + } + + pPSUIInfo->UserData = (ULONG_PTR)pCPSUISample; + pCPSUISample->hParent = pPSUIInfo->hComPropSheet; + pCPSUISample->pfnCPS = pPSUIInfo->pfnComPropSheet; + + // + // Add Document Property Sheet for current default Printer + // + + switch (pPSUIInfo->lParamInit) + { + case IDM_DOCPROP: + case IDM_DOCPROP_TVTEST: + + if (GetDefPrinter(pCPSUISample)) + { + InsPI.cbSize = sizeof(INSERTPSUIPAGE_INFO); + InsPI.Type = PSUIPAGEINSERT_DLL; + InsPI.Mode = INSPSUIPAGE_MODE_FIRST_CHILD; + InsPI.dwData1 = (ULONG_PTR)szWinSpool; + InsPI.dwData2 = (ULONG_PTR)szDocPropSheets; + InsPI.dwData3 = (ULONG_PTR)&(pCPSUISample->DPHdr); + + pCPSUISample->hDocProp = + (HANDLE)pCPSUISample->pfnCPS( pCPSUISample->hParent, + CPSFUNC_INSERT_PSUIPAGE, + (LPARAM)0, + (LPARAM)&InsPI + ); + } + break; + } + + // + // Add TreeView Page + // + + switch (pPSUIInfo->lParamInit) + { + case IDM_TVTEST: + case IDM_DOCPROP_TVTEST: + + if (SetupComPropSheetUI(&(pCPSUISample->CPSUI))) + { + InsPI.cbSize = sizeof(INSERTPSUIPAGE_INFO); + InsPI.Type = PSUIPAGEINSERT_PCOMPROPSHEETUI; + InsPI.Mode = INSPSUIPAGE_MODE_FIRST_CHILD; + InsPI.dwData1 = (ULONG_PTR)&(pCPSUISample->CPSUI); + InsPI.dwData2 = + InsPI.dwData3 = 0; + + pCPSUISample->hCPSUI = + (HANDLE)pCPSUISample->pfnCPS( pCPSUISample->hParent, + CPSFUNC_INSERT_PSUIPAGE, + (LPARAM)0, + (LPARAM)&InsPI + ); + } + break; + } + + if ( (pCPSUISample->hCPSUI) + || (pCPSUISample->hDocProp) + ) + { + return 1; + } + + break; + + case PROPSHEETUI_REASON_GET_INFO_HEADER: + + pPSUIInfoHdr = (PPROPSHEETUI_INFO_HEADER)lParam; + if (NULL != pPSUIInfoHdr) + { + pPSUIInfoHdr->pTitle = (LPTSTR)TitleName; + + switch (pPSUIInfo->lParamInit) + { + case IDM_DOCPROP: + + pPSUIInfoHdr->IconID = IDI_CPSUI_PRINTER2; + break; + + case IDM_TVTEST: + + pPSUIInfoHdr->IconID = IDI_CPSUI_OPTION2; + break; + + case IDM_DOCPROP_TVTEST: + + pPSUIInfoHdr->IconID = IDI_CPSUI_RUN_DIALOG; + break; + } + + pPSUIInfoHdr->Flags = PSUIHDRF_PROPTITLE | PSUIHDRF_NOAPPLYNOW; + pPSUIInfoHdr->hWndParent = hWndApp; + pPSUIInfoHdr->hInst = hInstApp; + + return 1; + } + + break; + + case PROPSHEETUI_REASON_SET_RESULT: + + pCPSUISample = (PCPSUISAMPLE)pPSUIInfo->UserData; + if ( (NULL != pCPSUISample) + && (pCPSUISample->hCPSUI == ((PSETRESULT_INFO)lParam)->hSetResult) + ) + { + // + // Save the result and propagate to its owner + // + pPSUIInfo->Result = ((PSETRESULT_INFO)lParam)->Result; + return 1; + } + + break; + + case PROPSHEETUI_REASON_DESTROY: + + pCPSUISample = (PCPSUISAMPLE)pPSUIInfo->UserData; + if (NULL != pCPSUISample) + { + h = pCPSUISample->hDevMode; + if (NULL != h) + { + GlobalUnlock(h); + GlobalFree(h); + } + + h = pCPSUISample->hDevNames; + if (NULL != h) + { + GlobalUnlock(h); + GlobalFree(h); + } + + if (pCPSUISample->DPHdr.hPrinter) + { + ClosePrinter(pCPSUISample->DPHdr.hPrinter); + } + + LocalFree((HLOCAL)pCPSUISample); + pPSUIInfo->UserData = 0; + } + return 1; + } + return -1; +} + +LRESULT +CALLBACK +MainWndProc +( + HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam +) +/*++ + +Routine Description: + + This is the main window procedure to the testing program + + +Arguments: + + See SDK + + +Return Value: + + See SDK + +--*/ +{ + DWORD Result; + LONG Ret; + + switch (Msg) + { + case WM_INITMENUPOPUP: + + if (!HIWORD(lParam)) + { + CheckMenuItem( (HMENU)UIntToPtr((UINT)wParam), + IDM_PERMISSION, + MF_BYCOMMAND | ((UpdatePermission) ? MF_CHECKED : MF_UNCHECKED) + ); + + CheckMenuItem( (HMENU)UIntToPtr((UINT)wParam), + IDM_USESTDABOUT, + MF_BYCOMMAND | ((UseStdAbout) ? MF_CHECKED : MF_UNCHECKED) + ); + } + break; + + case WM_COMMAND: + + switch (wParam) + { + case IDM_USESTDABOUT: + + UseStdAbout = !UseStdAbout; + break; + + case IDM_PERMISSION: + + UpdatePermission = !UpdatePermission; + break; + + case IDM_DOCPROP: + case IDM_TVTEST: + case IDM_DOCPROP_TVTEST: + + Ret = CommonPropertySheetUI( hWnd, + (PFNPROPSHEETUI)CPSUIFunc, + (LPARAM)LOWORD(wParam), + &Result + ); + + CPSUIDBG( DBG_WINMAINPROC, + ("CommonPropertySheetUI()=%ld, Result=%ld", Ret, Result) + ); + + break; + + default: + + break; + } + break; + + case WM_DESTROY: + + PostQuitMessage(0); + break; + + default: + + return (DefWindowProc(hWnd, Msg, wParam, lParam)); + } + + return 0L; +} + +BOOL +InitInstance +( + HANDLE hInstance, + INT nCmdShow +) +/*++ + +Routine Description: + + Saves instance handle and creates main window + + This function is called at initialization time for every instance of + this application. This function performs initialization tasks that + cannot be shared by multiple instances. + + In this case, we save the instance handle in a static variable and + create and display the main program window. + + +Arguments: + + hInstance - Current instance identifier + + nComShow - Param for first ShowWindow() call. + + + +Return Value: + + TRUE/FALSE + + +--*/ +{ + // + // Save the instance handle in static variable, which will be used in + // many subsequence calls from this application to Windows. + // + + hInstApp = hInstance; + + // + // Create a main window for this application instance. + // + + hWndApp = CreateWindow( ClassName, + TitleName, + WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + NULL, + NULL, + hInstance, + NULL + ); + if (NULL != hWndApp) + { + // + // Make the window visible; update its client area; + // and send WM_PAINT message + // + + ShowWindow(hWndApp, nCmdShow); + UpdateWindow(hWndApp); + } + + return ((hWndApp) ? TRUE : FALSE); +} + + +BOOL +InitApplication +( + HANDLE hInstance +) +/*++ + +Routine Description: + + Initializes window data and registers window class + + This function is called at initialization time only if no other + instances of the application are running. This function performs + initialization tasks that can be done once for any number of running + instances. + + In this case, we initialize a window class by filling out a data + structure of type WNDCLASS and calling the Windows RegisterClass() + function. Since all instances of this application use the same window + class, we only need to do this when the first instance is initialized. + + +Arguments: + + hInstance - current instance + + +Return Value: + + BOOLEAN + +--*/ +{ + WNDCLASS wc; + + // + // Fill in window class structure with parameters that describe the + // main window. + // + + wc.style = 0L; + wc.lpfnWndProc = MainWndProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = hInstance; + wc.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_CPSUISAMPLE); + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.hbrBackground = GetStockObject(WHITE_BRUSH); + wc.lpszMenuName = MenuName; + wc.lpszClassName = ClassName; + + // + // Register the window class and return success/failure code. + // + return RegisterClass(&wc); +} + + +INT +APIENTRY +WinMain +( + _In_ HINSTANCE hInstance, + _In_opt_ HINSTANCE hPrevInstance, + _In_ LPSTR lpCmdLine, + _In_ INT nCmdShow +) +/*++ + +Routine Description: + + calls initialization function, processes message loop + + Windows recognizes this function by name as the initial entry point + for the program. This function calls the application initialization + routine, if no other instance of the program is running, and always + calls the instance initialization routine. It then executes a message + retrieval and dispatch loop that is the top-level control structure + for the remainder of execution. The loop is terminated when a WM_QUIT + message is received, at which time this function exits the application + instance by returning the value passed by PostQuitMessage(). + + If this function must abort before entering the message loop, it + returns the conventional value NULL. + + +Arguments: + + + +Return Value: + + Integer + + +--*/ +{ + MSG Msg; + + UNREFERENCED_PARAMETER(lpCmdLine); + + // + // Other instances of app running? + // + + if (!hPrevInstance) + { + if (!InitApplication(hInstance)) + { + // + // Initialize shared things, Exits if unable to initialize + // + return FALSE; + } + } + + // + // Perform initializations that apply to a specific instance + // + if (!InitInstance(hInstance, nCmdShow)) + { + return FALSE; + } + + // + // Acquire and dispatch messages until a WM_QUIT message is received. + // + while (GetMessage(&Msg, NULL, 0L, 0L)) + { + // + // Translates virtual key codes and Dispatches message to window + // + TranslateMessage(&Msg); + DispatchMessage(&Msg); + } + + // + // Returns the value from PostQuitMessage + // + return((INT)Msg.wParam); +} + diff --git a/print/cpsuisam/cpsuisam.sln b/print/cpsuisam/cpsuisam.sln new file mode 100644 index 00000000..334867da --- /dev/null +++ b/print/cpsuisam/cpsuisam.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0 +MinimumVisualStudioVersion = 12.0 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpsuisam", "cpsuisam.vcxproj", "{F7BAD220-8095-4F67-A75B-0250FCB2B670}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F7BAD220-8095-4F67-A75B-0250FCB2B670}.Debug|Win32.ActiveCfg = Debug|Win32 + {F7BAD220-8095-4F67-A75B-0250FCB2B670}.Debug|Win32.Build.0 = Debug|Win32 + {F7BAD220-8095-4F67-A75B-0250FCB2B670}.Release|Win32.ActiveCfg = Release|Win32 + {F7BAD220-8095-4F67-A75B-0250FCB2B670}.Release|Win32.Build.0 = Release|Win32 + {F7BAD220-8095-4F67-A75B-0250FCB2B670}.Debug|x64.ActiveCfg = Debug|x64 + {F7BAD220-8095-4F67-A75B-0250FCB2B670}.Debug|x64.Build.0 = Debug|x64 + {F7BAD220-8095-4F67-A75B-0250FCB2B670}.Release|x64.ActiveCfg = Release|x64 + {F7BAD220-8095-4F67-A75B-0250FCB2B670}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/print/cpsuisam/cpsuisam.vcxproj b/print/cpsuisam/cpsuisam.vcxproj new file mode 100644 index 00000000..91f302ef --- /dev/null +++ b/print/cpsuisam/cpsuisam.vcxproj @@ -0,0 +1,255 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{F7BAD220-8095-4F67-A75B-0250FCB2B670}</ProjectGuid> + <RootNamespace>$(MSBuildProjectName)</RootNamespace> + <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> + <Platform Condition="'$(Platform)' == ''">Win32</Platform> + <SampleGuid>{67BF1D0E-F90D-414D-A13C-543092176A80}</SampleGuid> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <TargetVersion>Windows10</TargetVersion> + <UseDebugLibraries>False</UseDebugLibraries> + <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverType /> + <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> + <ConfigurationType>Application</ConfigurationType> + </PropertyGroup> + <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <TargetVersion>Windows10</TargetVersion> + <UseDebugLibraries>True</UseDebugLibraries> + <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverType /> + <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> + <ConfigurationType>Application</ConfigurationType> + </PropertyGroup> + <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <TargetVersion>Windows10</TargetVersion> + <UseDebugLibraries>False</UseDebugLibraries> + <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverType /> + <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> + <ConfigurationType>Application</ConfigurationType> + </PropertyGroup> + <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <TargetVersion>Windows10</TargetVersion> + <UseDebugLibraries>True</UseDebugLibraries> + <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverType /> + <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> + <ConfigurationType>Application</ConfigurationType> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <PropertyGroup> + <OutDir>$(IntDir)</OutDir> + </PropertyGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> + </ImportGroup> + <ItemGroup Label="WrappedTaskItems" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <TargetName>cpsuisam</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <TargetName>cpsuisam</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <TargetName>cpsuisam</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <TargetName>cpsuisam</TargetName> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Link> + <AdditionalDependencies>%(AdditionalDependencies);comdlg32.lib;winspool.lib;comctl32.lib;shlwapi.lib;compstui.lib</AdditionalDependencies> + </Link> + <ResourceCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.</AdditionalIncludeDirectories> + </ResourceCompile> + <ClCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.</AdditionalIncludeDirectories> + </ClCompile> + <Midl> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.</AdditionalIncludeDirectories> + </Midl> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Link> + <AdditionalDependencies>%(AdditionalDependencies);comdlg32.lib;winspool.lib;comctl32.lib;shlwapi.lib;compstui.lib</AdditionalDependencies> + </Link> + <ResourceCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.</AdditionalIncludeDirectories> + </ResourceCompile> + <ClCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.</AdditionalIncludeDirectories> + </ClCompile> + <Midl> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.</AdditionalIncludeDirectories> + </Midl> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Link> + <AdditionalDependencies>%(AdditionalDependencies);comdlg32.lib;winspool.lib;comctl32.lib;shlwapi.lib;compstui.lib</AdditionalDependencies> + </Link> + <ResourceCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.</AdditionalIncludeDirectories> + </ResourceCompile> + <ClCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.</AdditionalIncludeDirectories> + </ClCompile> + <Midl> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.</AdditionalIncludeDirectories> + </Midl> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Link> + <AdditionalDependencies>%(AdditionalDependencies);comdlg32.lib;winspool.lib;comctl32.lib;shlwapi.lib;compstui.lib</AdditionalDependencies> + </Link> + <ResourceCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.</AdditionalIncludeDirectories> + </ResourceCompile> + <ClCompile> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.</AdditionalIncludeDirectories> + </ClCompile> + <Midl> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);.</AdditionalIncludeDirectories> + </Midl> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam</PreprocessorDefinitions> + </ClCompile> + <Midl> + <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam</PreprocessorDefinitions> + </Midl> + <ResourceCompile> + <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam</PreprocessorDefinitions> + </ResourceCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam</PreprocessorDefinitions> + </ClCompile> + <Midl> + <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam</PreprocessorDefinitions> + </Midl> + <ResourceCompile> + <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam</PreprocessorDefinitions> + </ResourceCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam</PreprocessorDefinitions> + </ClCompile> + <Midl> + <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam</PreprocessorDefinitions> + </Midl> + <ResourceCompile> + <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam</PreprocessorDefinitions> + </ResourceCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam</PreprocessorDefinitions> + </ClCompile> + <Midl> + <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam</PreprocessorDefinitions> + </Midl> + <ResourceCompile> + <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;STRICT;UNICODE;_UNICODE;cpsuisam</PreprocessorDefinitions> + </ResourceCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <ExceptionHandling> + </ExceptionHandling> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <ExceptionHandling> + </ExceptionHandling> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <ExceptionHandling> + </ExceptionHandling> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <ExceptionHandling> + </ExceptionHandling> + </ClCompile> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="cpsuidat.c"> + <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> + <PreCompiledHeader>Use</PreCompiledHeader> + <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> + </ClCompile> + <ClCompile Include="cpsuisam.c"> + <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> + <PreCompiledHeader>Use</PreCompiledHeader> + <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> + </ClCompile> + <ClCompile Include="debug.c"> + <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> + <PreCompiledHeader>Use</PreCompiledHeader> + <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> + </ClCompile> + <ClCompile Include="precompsrc.c"> + <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile> + <PreCompiledHeader>Create</PreCompiledHeader> + <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile> + </ClCompile> + <ResourceCompile Include="res.rc" /> + </ItemGroup> + <ItemGroup> + <Inf Exclude="@(Inf)" Include="*.inf" /> + <FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" /> + <FilesToPackage Include="@(Inf->'%(CopyOutput)')" Condition="'@(Inf)'!=''" /> + </ItemGroup> + <ItemGroup> + <None Exclude="@(None)" Include="*.txt;*.htm;*.html" /> + <None Exclude="@(None)" Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2" /> + <None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" /> + </ItemGroup> + <ItemGroup> + <ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> +</Project>
\ No newline at end of file diff --git a/print/cpsuisam/cpsuisam.vcxproj.Filters b/print/cpsuisam/cpsuisam.vcxproj.Filters new file mode 100644 index 00000000..44bbac68 --- /dev/null +++ b/print/cpsuisam/cpsuisam.vcxproj.Filters @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions> + <UniqueIdentifier>{50DC862B-95AC-4892-B963-876111462136}</UniqueIdentifier> + </Filter> + <Filter Include="Header Files"> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + <UniqueIdentifier>{5A8D8E11-1C44-4DD6-8615-57E54DDD4C6C}</UniqueIdentifier> + </Filter> + <Filter Include="Resource Files"> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions> + <UniqueIdentifier>{44FF2C70-58D4-464D-B774-C6C44F8E380B}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="cpsuidat.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="cpsuisam.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="debug.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="precompsrc.c"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="res.rc"> + <Filter>Resource Files</Filter> + </ResourceCompile> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/print/cpsuisam/icons/apple.ico b/print/cpsuisam/icons/apple.ico Binary files differnew file mode 100644 index 00000000..dd2f44f0 --- /dev/null +++ b/print/cpsuisam/icons/apple.ico diff --git a/print/cpsuisam/icons/cpsuisam.ico b/print/cpsuisam/icons/cpsuisam.ico Binary files differnew file mode 100644 index 00000000..33df6ef4 --- /dev/null +++ b/print/cpsuisam/icons/cpsuisam.ico diff --git a/print/cpsuisam/precompsrc.c b/print/cpsuisam/precompsrc.c new file mode 100644 index 00000000..5944cf51 --- /dev/null +++ b/print/cpsuisam/precompsrc.c @@ -0,0 +1 @@ +#include "precomp.h"
\ No newline at end of file diff --git a/print/cpsuisam/res.rc b/print/cpsuisam/res.rc new file mode 100644 index 00000000..f1e52605 --- /dev/null +++ b/print/cpsuisam/res.rc @@ -0,0 +1,51 @@ +// +// Copyright (c) 1990-2003 Microsoft Corporation +// All Rights Reserved +// + + +#include "windows.h" +#include "compstui.h" +#include "cpsuisam.h" + + + + +IDI_APPLE ICON PRELOAD icons\Apple.ico +IDI_CPSUISAMPLE ICON PRELOAD icons\cpsuisam.ico + + + +CPSUISampleMenu MENU +BEGIN + POPUP "&Test Options" + BEGIN + MENUITEM "&Default Printer Properties", IDM_DOCPROP + MENUITEM "CPSUI &TreeView Test", IDM_TVTEST + + MENUITEM SEPARATOR + + MENUITEM "&CPSUI Test All", IDM_DOCPROP_TVTEST + + MENUITEM SEPARATOR + + MENUITEM "&Permission", IDM_PERMISSION + MENUITEM "&Use Standard About" IDM_USESTDABOUT + + + END +END + + +#include "cpsuisam.dlg" + + +#include <ntverp.h> + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "Common Property Sheet UI Sample Applet" +#define VER_INTERNALNAME_STR "cpsuisam.exe" +#define VER_ORIGINALFILENAME_STR "cpsuisam.exe" + +#include "common.ver" |
