Posts
40
Comments
79
Trackbacks
0
November 2010 Entries
All-In-One Interop and Fusion Code Samples

All-In-One Interop and Fusion Code Samples 

Introduction

The All-In-One Interop and Fusion code samples demonstrate the typical programming topics about .NET - native interop, COM interop, fusion, .NET Reflection, etc. These topics are either frequently asked in MSDN forums and Microsoft Support, or are requested by many developers via our code sample request function. We want to alleviate the frustration felt by developers when they are interoperating between .NET and native, or loading libraries.

 

Visual Studio 2008 Library and Fusion Code Samples

Sample Description Download ReadMe
CppCallNETAssemblyWrapper C++ indirectly call .NET assembly via C++/CLI wrapper Download ReadMe.txt
CppCLINativeDllWrapper C++/CLI Wrapper for native DLL Download ReadMe.txt
CppCLINETAssemblyWrapper C++/CLI Wrapper for .NET assembly Download ReadMe.txt
CppDelayloadDll C++ delay-loads a DLL Download ReadMe.txt
CppDynamicLinkLibrary C++ Dynamic-link Library Download ReadMe.txt
CppHostCLR C++ host CLR and call .NET assembly Download ReadMe.txt
CppImplicitlyLinkDll C++ implicitly links a DLL Download ReadMe.txt
CppLoadLibrary C++ dynamically loads a DLL Download ReadMe.txt
CppStaticallyLinkLib C++ statically links a static library Download ReadMe.txt
CppStaticLibrary A C++ Static Library Download ReadMe.txt
CSCallNativeDllWrapper C# indirectly call native DLL via C++/CLI wrapper Download ReadMe.txt
CSClassLibrary A C# Class Library Download ReadMe.txt
CSEmitAssembly C# emits an assembly with types in runtime Download ReadMe.txt
CSLoadLibrary C# dynamically loads a native DLL Download ReadMe.txt
CSPInvokeDll C# P/Invokes a native DLL Download ReadMe.txt
CSReflection C# dynamically loads and uses the types of an assembly Download ReadMe.txt
VBCallNativeDllWrapper VB.NET indirectly call native DLL via C++/CLI wrapper Download ReadMe.txt
VBClassLibrary A VB.NET Class Library Download ReadMe.txt
VBLoadLibrary Dynamically load native dll (VB.NET) Download ReadMe.txt
VBPInvokeDll PInvoke native dll (VB.NET) Download ReadMe.txt
VBReflection VB.NET dynamically loads and uses the types of an assembly Download ReadMe.txt

 

Visual Studio 2010 Library and Fusion Code Samples

Sample Description Download ReadMe
CppHostCLR C++ host CLR 4 and call .NET assembly Download ReadMe.txt
CSClassLibrary A C# Class Library Download ReadMe.txt

Download all code samples: http://1code.codeplex.com/releases

 

Submit your request of Interop and Fusion code samples (Guidance)

 

Posted On Tuesday, November 30, 2010 9:21 PM | Feedback (0)
All-In-One Windows Shell Code Samples

All-In-One Windows Shell Code Samples

Introduction

The All-In-One Windows Shell code samples demonstrate the typical programming topics about extending Windows Shell and using the Windows Shell APIs. These topics are either frequently asked in MSDN forums and Microsoft Support, or are requested by many developers via our code sample request function. We want to alleviate the frustration felt by developers when they are developing against Windows Shell.

 

Visual Studio 2008 Windows Shell Code Samples

Sample Description Download ReadMe
ATLShellExtColumnHandler Shell Column Extension Handler Download ReadMe.txt
ATLShellExtContextMenuHandler Shell Context Menu Extension Handler Download ReadMe.txt
ATLShellExtDragAndDropHandler Shell Drag and Drop Extension Handler Download ReadMe.txt
ATLShellExtIconHandler Shell Icon Extension Handler Download ReadMe.txt
ATLShellExtIconOverlayHandler Shell Icon Overlay Extension Handler Download ReadMe.txt
ATLShellExtInfotipHandler Shell Infotip Extension Handler Download ReadMe.txt
ATLShellExtPropSheetHandler Shell Property Sheet Extension Handler Download ReadMe.txt
CppShellCommonFileDialog Use of Shell common file dialog (C++) Download ReadMe.txt
CppShellKnownFolders Shell Knownfolder API (C++) Download ReadMe.txt
CppWin7ShellLibrary Operate on Win7 Shell Library (C++) Download ReadMe.txt
CppWin7TaskbarAppID Win7 Application ID in taskbar (C++) Download ReadMe.txt
CppWin7TaskbarOverlayIcons Win7 Overlay Icons in taskbar (C++) Download ReadMe.txt
CppWin7TaskbarProgressBar Win7 Progressbar in taskbar (C++) Download ReadMe.txt
CSShellCommonFileDialog Use of Shell common file dialog (C#) Download ReadMe.txt
CSShellKnownFolders Shell Knownfolder API (C#) Download ReadMe.txt
CSWin7ShellLibrary Operate on Win7 Shell Library (C#) Download ReadMe.txt
CSWin7TaskbarAppID Win7 Application ID in taskbar (C#) Download ReadMe.txt
CSWin7TaskbarJumpList Win7 Jumplist in taskbar (C#) Download ReadMe.txt
CSWin7TaskbarOverlayIcons Win7 Overlay Icons in taskbar (C#) Download ReadMe.txt
CSWin7TaskbarProgressbar Win7 Progressbar in taskbar (C#) Download ReadMe.txt
CSWin7TaskbarThumbnail Win7 Thumbnail in taskbar (C#) Download ReadMe.txt
VBShellKnownFolders Shell Knownfolder API (VB.NET) Download ReadMe.txt
VBWin7ShellLibrary Operate on Win7 Shell Library (VB.NET) Download ReadMe.txt
VBWin7TaskbarAppID Win7 Application ID in taskbar (VB.NET) Download ReadMe.txt
VBWin7TaskbarJumpList Win7 Jumplist in taskbar (VB.NET) Download ReadMe.txt
VBWin7TaskbarOverlayIcons Win7 Overlay Icons in taskbar (VB.NET) Download ReadMe.txt
VBWin7TaskbarProgressbar Win7 Progressbar in taskbar (VB.NET) Download ReadMe.txt
VBWin7TaskbarThumbnail Win7 Thumbnail in taskbar (VB.NET) Download ReadMe.txt

 

Visual Studio 2010 Code Samples

Sample Description Download ReadMe
CppShellExtContextMenuHandler Shell context menu handler (C++) Download ReadMe.txt
CppShellExtDragDropHandler Shell drag-and-drop handler (C++) Download ReadMe.txt
CppShellExtInfotipHandler Shell infotip handler (C++) Download ReadMe.txt
CppShellExtPropSheetHandler Shell property sheet handler (C++) Download ReadMe.txt
CppShellExtThumbnailHandler Shell thumbnail handler (C++) Download ReadMe.txt
CSShellExtContextMenuHandler Shell context menu handler (C#) Download ReadMe.txt
CSShellExtInfotipHandler Shell infotip handler (C#) Download ReadMe.txt
CSShellExtThumbnailHandler Shell thumbnail handler (C#) Download ReadMe.txt
VBShellExtContextMenuHandler Shell context menu handler (VB.NET) Download ReadMe.txt
VBShellExtInfotipHandler Shell infotip handler (VB.NET) Download ReadMe.txt
VBShellExtThumbnailHandler Shell thumbnail handler (VB.NET) Download ReadMe.txt

Download all code samples: http://1code.codeplex.com/releases

 

Submit your request of Windows Shell code samples (Guidance)

Posted On Tuesday, November 30, 2010 9:20 PM | Feedback (1)
All-In-One Office Development Code Samples

All-In-One Office Development Code Samples

Introduction

The All-In-One Office development code samples demonstrate the typical programming topics about Microsoft Office. These topics are either frequently asked in MSDN forums and Microsoft Support, or are requested by many developers via our code sample request function. We want to alleviate the frustration felt by developers when they are developing Office projects. 

 

Visual Studio 2008 Office Development Code Samples

Sample Description Download ReadMe
CppAutomateExcel Automate Excel in a VC++ application Download ReadMe.txt
CppAutomateOutlook Automate Outlook in a VC++ application Download ReadMe.txt
CppAutomatePowerPoint Automate PowerPoint in a VC++ application Download ReadMe.txt
CppAutomateVisio Automate Visio in a VC++ application Download ReadMe.txt
CppAutomateWord Automate Word in a VC++ application Download ReadMe.txt
CppOfficeManagedCOMAddInShim Shim of Office Managed COM AddIn Download ReadMe.txt
CSAutomateExcel Automate Excel in a C# application Download ReadMe.txt
CSAutomateOutlook Automate Outlook in a C# application Download ReadMe.txt
CSAutomatePowerPoint Automate PowerPoint in a C# application Download ReadMe.txt
CSAutomateVisio Automate Visio in a C# application Download ReadMe.txt
CSAutomateWord Automate Word in a C# application Download ReadMe.txt
CSExcelAutomationAddIn Excel Automation Add-in in C# Download ReadMe.txt
CSOfficeSharedAddIn Office shared add-in (C#) Download ReadMe.txt
CSOutlookImportedFormRegion Build an Outlook look custom form via Outlook Form Region (C#) Download ReadMe.txt
CSOutlookRibbonXml Customize Outlook UI using Ribbon XML (C#) Download ReadMe.txt
CSOutlookUIDesigner Customize Outlook UI using VSTO Designers (C#) Download ReadMe.txt
CSVstoExcelWorkbook Customize Excel workbook using VSTO Download ReadMe.txt
CSVstoGetWrapperObject Get VSTO Wrapper Object (C#) Download ReadMe.txt
CSVstoServerDocument Use VSTO ServerDocument class (C#) Download ReadMe.txt
CSVstoVBAInterop VSTO Interop with Excel VBA macros (C#) Download ReadMe.txt
CSVstoWordDocument VSTO Word document-level addin (C#) Download ReadMe.txt
VBAutomateExcel Automate Excel in a VB.NET application Download ReadMe.txt
VBAutomateOutlook Automate Outlook in a VB.NET application Download ReadMe.txt
VBAutomatePowerPoint Automate PowerPoint in a VB.NET application Download ReadMe.txt
VBAutomateVisio Automate Visio in a VB.NET application Download ReadMe.txt
VBAutomateWord Automate Word in a VB.NET application Download ReadMe.txt
VBExcelAutomationAddIn Excel Automation Add-in in VB.NET Download ReadMe.txt
VBOutlookImportedFormRegion Build an Outlook look custom form via Outlook Form Region (VB.NET) Download ReadMe.txt
VBOutlookRibbonXml Customize Outlook UI using Ribbon XML (VB.NET) Download ReadMe.txt
VBVstoExcelWorkbook VSTO Excel workbook (VB.NET) Download ReadMe.txt
VBVstoGetWrapperObject Get VSTO Wrapper Object (VB.NET) Download ReadMe.txt
VBVstoServerDocument Use VSTO ServerDocument class (VB.NET) Download ReadMe.txt
VBVstoVBAInterop VSTO Interop with Excel VBA macros (VB.NET) Download ReadMe.txt
VBVstoWordDocument VSTO Word document-level addin (VB.NET) Download ReadMe.txt

 

Visual Studio 2010 Office Development Code Samples

Sample Description Download ReadMe
CSOfficeRibbonAccessibility Automate Office ribbon through MSAA (C#) Download ReadMe.txt
VBOfficeRibbonAccessibility Automate Office ribbon through MSAA (VB.NET) Download ReadMe.txt

Download all code samples: http://1code.codeplex.com/releases

 

Submit your request of Office Development code samples (Guidance)

 

Posted On Tuesday, November 30, 2010 9:17 PM | Feedback (1)
All-In-One Windows Base and .NET General Code Samples

All-In-One Windows Base and .NET General Code Samples

 

Introduction

The code samples demonstrate the typical programming topics about Windows Base and .NET General. These topics are either frequently asked in MSDN forums and Microsoft Support, or are requested by many developers via our code sample request function.

 

Visual Studio 2008 Windows Base and .NET General Code Samples

Sample Description Download ReadMe
CppCheckOSBitness Check OS bitness (C++) Download ReadMe.txt
CppCheckProcessBitness Check process bitness (C++) Download ReadMe.txt
CSCheckOSBitness Check OS bitness (C#) Download ReadMe.txt
CSCheckProcessBitness Check process bitness (C#) Download ReadMe.txt
CSProcessWatcher Receive process creation notification (C#) Download ReadMe.txt
CSSetDesktopWallpaper Set the desktop wallpaper (C#) Download ReadMe.txt
VBCheckOSBitness Check OS bitness (VB.NET) Download ReadMe.txt
VBCheckProcessBitness Check process bitness (VB.NET) Download ReadMe.txt
VBProcessWatcher Receive process creation notification (C#) Download ReadMe.txt
VBSetDesktopWallpaper Set the desktop wallpaper (VB) Download ReadMe.txt

 

Visual Studio 2010 Windows Base and .NET General Code Samples

Sample Description Download ReadMe
CppPlatformDetector Detect the process running platform (C++) Download ReadMe.txt
CSMonitorRegistryChange Monitor registry change in C# Download ReadMe.txt
CSPlatformDetector Detect the process running platform (C#) Download ReadMe.txt
CSSetPowerAvailabilityRequest Set power availability request (C#) Download ReadMe.txt
VBMonitorRegistryChange Monitor registry change in VB Download ReadMe.txt
VBPlatformDetector Detect the process running platform (VB.NET) Download ReadMe.txt

Download all code samples: http://1code.codeplex.com/releases

 

Submit your request of Windows Base and .NET General code samples (Guidance)

Posted On Tuesday, November 30, 2010 9:15 PM | Feedback (0)
All-In-One Data Platform Code Samples

All-In-One Data Platform Code Samples

 

Introduction

The All-In-One Data Platform code samples demonstrate the typical programming topics about ADO.NET, Entity Framework, WCF Data Services, ADO, and other Data Platform technologies. These topics are either frequently asked in MSDN forums and Microsoft Support, or are requested by many developers via our code sample request function. We want to alleviate the frustration felt by developers when they are developing against data in projects.

 

Visual Studio 2008 Code Samples

Sample Description Download ReadMe
CppUseADO Use ADO in a C++ application Download ReadMe.txt
CppUseADONET Use ADO.NET in a C++ application Download ReadMe.txt
CSADONETDataService ADO.NET Data Service in C# Download ReadMe.txt
CSADONETDataServiceClient Use ADO.NET Data Service in C# Download ReadMe.txt
CSADONETDataServiceSL3Client Use ADO.NET Data Service in Silverlight (C#) Download ReadMe.txt
CSEFEntityDataModel Entity Data Model (C#) Download ReadMe.txt
CSLinqExtension Extend LINQ in C# Download ReadMe.txt
CSLinqToDataSets Use LINQ to DataSets in C# Download ReadMe.txt
CSLinqToEntities Use LINQ to Entities in C# Download ReadMe.txt
CSLinqToObject Use LINQ to Objects in C# Download ReadMe.txt
CSLinqToSQL Use LINQ to SQL in C# Download ReadMe.txt
CSUseADO Use ADO in a C# application Download ReadMe.txt
CSUseADONET Use ADO.NET in a C# application Download ReadMe.txt
SQLServer2005DB A SQL Server 2005 Database project Download ReadMe.txt
VBADONETDataService ADO.NET Data Service in VB.NET Download ReadMe.txt
VBADONETDataServiceClient Use ADO.NET Data Service in VB.NET Download ReadMe.txt
VBADONETDataServiceSL3Client Use ADO.NET Data Service in Silverlight (VB.NET) Download ReadMe.txt
VBEFEntityDataModel Entity Data Model (VB.NET) Download ReadMe.txt
VBLinqExtension Extend LINQ in VB.NET Download ReadMe.txt
VBLinqToDataSets Use LINQ to DataSets in VB.NET Download ReadMe.txt
VBLinqToEntities Use LINQ to Entities in VB.NET Download ReadMe.txt
VBLinqToObject Use LINQ to Objects in VB.NET Download ReadMe.txt
VBLinqToSQL Use LINQ to SQL in VB.NET Download ReadMe.txt
VBUseADO Use ADO in a VB.NET application Download ReadMe.txt
VBUseADONET Use ADO.NET in a VB.NET application Download ReadMe.txt

 

Visual Studio 2010 Code Samples

Sample Description Download ReadMe
CSEFCodeOnly EF4 CodeOnly Feature (C#) Download ReadMe.txt
CSEFComplexType EF4.0 Complex Type Objects (C#) Download ReadMe.txt
CSEFForeignKeyAssociation EF4.0 Foreign Key Association (C#) Download ReadMe.txt
CSEFLazyLoading EF4 Lazy Loading Feature (C#) Download ReadMe.txt
CSEFModelFirst EF4.0 Model First feature (C#) Download ReadMe.txt
CSEFPOCOChangeTracking Update POCO entity properties and relationships (C#) Download ReadMe.txt
VBEFCodeOnly EF4 CodeOnly Feature (VB.NET) Download ReadMe.txt
VBEFComplexType EF4.0 Complex Type Objects (VB.NET) Download ReadMe.txt
VBEFForeignKeyAssociation EF4.0 Foreign Key Association (VB.NET) Download ReadMe.txt
VBEFLazyLoading EF4 Lazy Loading Feature (VB.NET) Download ReadMe.txt
VBEFModelFirst EF4.0 Model First feature (VB.NET) Download ReadMe.txt
VBEFPOCOChangeTracking Update POCO entity properties and relationships (VB.NET) Download ReadMe.txt

Download all code samples: http://1code.codeplex.com/releases

 

Submit your request of Data Platform code samples (Guidance)

 

Posted On Tuesday, November 30, 2010 9:14 PM | Feedback (0)
All-In-One Windows 7 Code Samples

All-In-One Windows 7 Code Samples

 

Introduction

Windows 7 provides many new programmable features, e.g. the new Taskbar, the Shell Library, the service trigger-start feature. The All-In-One Windows 7 code samples demonstrate the typical programming topics about Windows 7. These topics are either frequently asked in MSDN forums and Microsoft Support, or are requested by many developers via our code sample request function. We want to alleviate the frustration felt by developers when they are leveraging Windows 7 new features in applications.

 

Visual Studio 2008 Code Samples

Sample Description Download ReadMe
CppWin7Direct2D Win7 new 2-D graphics API (C++) Download ReadMe.txt
CppWin7ShellLibrary Operate on Win7 Shell Library (C++) Download ReadMe.txt
CppWin7TaskbarAppID Win7 Application ID in taskbar (C++) Download ReadMe.txt
CppWin7TaskbarOverlayIcons Win7 Overlay Icons in taskbar (C++) Download ReadMe.txt
CppWin7TaskbarProgressBar Win7 Progressbar in taskbar (C++) Download ReadMe.txt
CppWin7TriggerStartService Win7 Trigger Start Service (C++) Download ReadMe.txt
CSWin7Direct2D Win7 new 2-D graphics API (C#) Download ReadMe.txt
CSWin7ShellLibrary Operate on Win7 Shell Library (C#) Download ReadMe.txt
CSWin7TaskbarAppID Win7 Application ID in taskbar (C#) Download ReadMe.txt
CSWin7TaskbarJumpList Win7 Jumplist in taskbar (C#) Download ReadMe.txt
CSWin7TaskbarOverlayIcons Win7 Overlay Icons in taskbar (C#) Download ReadMe.txt
CSWin7TaskbarProgressbar Win7 Progressbar in taskbar (C#) Download ReadMe.txt
CSWin7TaskbarThumbnail Win7 Thumbnail in taskbar (C#) Download ReadMe.txt
CSWin7TriggerStartService Win7 Trigger Start Service (C#) Download ReadMe.txt
VBWin7Direct2D Win7 new 2-D graphics API (VB.NET) Download ReadMe.txt
VBWin7ShellLibrary Operate on Win7 Shell Library (VB.NET) Download ReadMe.txt
VBWin7TaskbarAppID Win7 Application ID in taskbar (VB.NET) Download ReadMe.txt
VBWin7TaskbarJumpList Win7 Jumplist in taskbar (VB.NET) Download ReadMe.txt
VBWin7TaskbarOverlayIcons Win7 Overlay Icons in taskbar (VB.NET) Download ReadMe.txt
VBWin7TaskbarProgressbar Win7 Progressbar in taskbar (VB.NET) Download ReadMe.txt
VBWin7TaskbarThumbnail Win7 Thumbnail in taskbar (VB.NET) Download ReadMe.txt
VBWin7TriggerStartService Win7 Trigger Start Service (VB.NET) Download ReadMe.txt

 

Visual Studio 2010 Code Samples

Sample Description Download ReadMe
CppWin7MultiTouch Use Win7 Multi-touch feature in C++ Download ReadMe.txt
CSWPF3DMultiTouch Use Win7 Multi-touch feature in WPF (C#) Download ReadMe.txt
VBWPF3DMultiTouch Use Win7 Multi-touch feature in WPF (VB.NET) Download ReadMe.txt

Download all code samples: http://1code.codeplex.com/releases

 

Submit your request of Windows 7 code samples (Guidance)

Posted On Tuesday, November 30, 2010 9:12 PM | Feedback (0)
All-In-One WPF Code Samples

All-In-One WPF Code Samples

Introduction

Windows Presentation Foundation (WPF) provides developers with a unified programming model for building rich Windows smart client user experiences that incorporate UI, media, and documents. The All-In-One WPF code samples demonstrate the typical programming topics about WPF. These topics are either frequently asked in MSDN forums and Microsoft Support, or are requested by many developers via our code sample request function. We want to alleviate the frustration felt by developers when they are developing WPF projects.

 

Visual Studio 2008 WPF Code Samples

Sample Description Download ReadMe
CSWPFAnimatedImage WPF animated image (C#) Download ReadMe.txt
CSWPFAutoCompleteTextBox Auto-complete textbox in WPF (C#) Download ReadMe.txt
CSWPFCascadeDataGridComboBoxColumns Cascade the loopup list in two WPF DataGrid combobox columns (C#) Download ReadMe.txt
CSWPFClipboardViewer WPF clipboard viewer (C#) Download ReadMe.txt
CSWPFDataBinding Data binding in WPF (C#) Download ReadMe.txt
CSWPFMasterDetailBinding Master-detail data binding in WPF (C#) Download ReadMe.txt
CSWPFMVVMPractice WPF MVVM Practice (C#) Download ReadMe.txt
CSWPFNavigationUsage Navigation usage in WPF Download ReadMe.txt
CSWPFPaging Data paging in WPF ListView (C#) Download ReadMe.txt
CSWPFThreading Threading in WPF (C#) Download ReadMe.txt
CSWPFTwoLevelGrouping Two level grouped data in WPF (C#) Download ReadMe.txt
VBWPFAnimatedImage WPF animated image (VB.NET) Download ReadMe.txt
VBWPFAutoCompleteTextBox Auto-complete textbox in WPF (VB.NET) Download ReadMe.txt
VBWPFCascadeDataGridComboBoxColumns Cascade the loopup list in two WPF DataGrid combobox columns (VB.NET) Download ReadMe.txt
VBWPFClipboardViewer WPF clipboard viewer (VB.NET) Download ReadMe.txt
VBWPFDataBinding Data binding in WPF (VB.NET) Download ReadMe.txt
VBWPFMasterDetailBinding Master-detail data binding in WPF (VB.NET) Download ReadMe.txt
VBWPFPaging Data paging in WPF ListView (VB.NET) Download ReadMe.txt
VBWPFThreading WPF Multi-threading Handling (VB.NET) Download ReadMe.txt
VBWPFTwoLevelGrouping Two level grouped data in WPF (VB.NET) Download ReadMe.txt

 

Visual Studio 2010 WPF Code Samples

Sample Description Download ReadMe
CSWPFCascadeDataGridComboBoxColumns Cascade the loopup list in two WPF DataGrid combobox columns (C#) Download ReadMe.txt
VBWPFCascadeDataGridComboBoxColumns Cascade the loopup list in two WPF DataGrid combobox columns (VB) Download ReadMe.txt
VBWPFMVVMPractice WPF MVVM Practice (VB.NET) Download ReadMe.txt

Download all code samples: http://1code.codeplex.com/releases

 

Submit your request of WPF code samples (Guidance)

 

Posted On Tuesday, November 30, 2010 9:03 PM | Feedback (1)
All-In-One Windows Forms Code Samples

All-In-One Windows Forms Code Samples

Introduction

The All-In-One Windows Forms code samples demonstrate the typical programming topics about Windows Forms. These topics are either frequently asked in MSDN forums and Microsoft Support, or are requested by many developers via our code sample request function. We want to alleviate the frustration felt by developers when they are developing Windows Forms projects.

 

Visual Studio 2008 Code Samples

Sample Description Download ReadMe
CSWinFormBindingNestedProperties WinForms binding nested properties Download ReadMe.txt
CSWinFormControls WinForm Control Customization in C# Download ReadMe.txt
CSWinFormDataGridView DataGridView in WinForm (C#) Download ReadMe.txt
CSWinFormDesigner WinForm Designers in C# Download ReadMe.txt
CSWinFormDesignerCodeDom Use CodeDom to generate code for WinForms Designer (C#) Download ReadMe.txt
CSWinFormDragAndDrop Drag and Drop operations in WinForm (C#) Download ReadMe.txt
CSWinFormGraphics Use GDI+ to do Graphics in WinForm (C#) Download ReadMe.txt
CSWinFormGroupRadioButtons Group RadioButtons in different containers (C#) Download ReadMe.txt
CSWinFormLayeredWindow Layered windows in WinForms (C#) Download ReadMe.txt
CSWinFormLocalization Localize WinForms application (C#) Download ReadMe.txt
CSWinFormObjPersistence Object Persistence in WinForm Download ReadMe.txt
CSWinFormPrinting Printing in WinForm Download ReadMe.txt
CSWinFormSingleInstanceApp WinForm Singleton application (C#) Download ReadMe.txt
CSWinFormSplashScreen WinForm Splash Screen Download ReadMe.txt
CSWinFormTimeConsumingOpr Time-consuming Operations in WinForm Download ReadMe.txt
CSWinFormTreeViewLoad Load TreeView nodes from a DataTable (C#) Download ReadMe.txt
CSWinFormTreeViewTraversal WinForms Treeview Traversal (C#) Download ReadMe.txt
VBWinFormControls WinForm Control Customization in VB.NET Download ReadMe.txt
VBWinFormDataBinding WinForm Data-binding in VB.NET Download ReadMe.txt
VBWinFormDataGridView DataGridView in WinForm (VB.NET) Download ReadMe.txt
VBWinFormDesigner WinForm Designers in C# Download ReadMe.txt
VBWinFormDesignerCodeDom Use CodeDom to generate code for WinForms Designer (VB.NET) Download ReadMe.txt
VBWinFormDragAndDrop Drag and Drop operations in WinForm (VB.NET) Download ReadMe.txt
VBWinFormGraphics Use GDI+ to do Graphics in WinForm (VB.NET) Download ReadMe.txt
VBWinFormGroupRadioButtons Group RadioButtons in different containers (VB) Download ReadMe.txt
VBWinFormLocalization Localize WinForms application (VB.NET) Download ReadMe.txt
VBWinFormTreeViewLoad Load TreeView nodes from a DataTable (VB.NET) Download ReadMe.txt
VBWinFormTreeViewTraversal WinForms Treeview Traversal (VB.NET) Download ReadMe.txt

Download all code samples: http://1code.codeplex.com/releases

 

Submit your request of Windows Forms code samples (Guidance)

Posted On Tuesday, November 30, 2010 9:01 PM | Feedback (2)
All-In-One Windows Azure Code Samples

Please use the links on the following page to find code samples and solution information for developers of Windows Azure applications.

Windows Azure Code Samples Index

Posted On Tuesday, November 30, 2010 8:12 PM | Feedback (3)
All-In-One ASP.NET Code Samples

All-In-One ASP.NET Code Samples

 

Introduction

The All-In-One ASP.NET code samples demonstrate the typical programming topics about ASP.NET. These topics are either frequently asked in MSDN forums and Microsoft Support, or are requested by many developers via our code sample request function. We want to alleviate the frustration felt by developers when they are developing ASP.NET projects.

 

Visual Studio 2008 ASP.NET Code Samples

Sample Description Download ReadMe
CSASPNETAjaxExtender ASP.NET AJAX Extender (C#) Download ReadMe.txt
CSASPNETAjaxScriptControl ASP.Net Ajax ScriptControl (C#) Download ReadMe.txt
CSASPNETCacheAPI ASP.NET Cache API (C#) Download ReadMe.txt
CSASPNETCascadingDropDownList Cascading Drop Down List in ASP.NET (C#) Download ReadMe.txt
CSASPNETCustomDataSourceForRDLC ASP.NET custom data source for rdlc (C#) Download ReadMe.txt
CSASPNETCustomHttpHandlerandModule ASP.NET custom HTTP handler and module (C#) Download ReadMe.txt
CSASPNETDataPager ASP.NET DataPager control (C#) Download ReadMe.txt
CSASPNETExcelImportExport Import and export Excel worksheet in ASP.NET (C#) Download ReadMe.txt
CSASPNETFormViewUpload ASP.NET FormView control (C#) Download ReadMe.txt
CSASPNETGridView ASP.NET GridView control (C#) Download ReadMe.txt
CSASPNETImageMap ASP.NET ImageMap control (C#) Download ReadMe.txt
CSASPNETMenu Menu in ASP.NET (C#) Download ReadMe.txt
CSASPNETMVCCustomActionFilter Custom ActionFilters for ASP.NET MVC (C#) Download ReadMe.txt
CSASPNETMVCFileDownload ASP.NET MVC File Download sample Download ReadMe.txt
CSASPNETMVCPager ASP.NET MVC Pager (C#) Download ReadMe.txt
CSASPNETOutputCache Output cache in ASP.NET (C#) Download ReadMe.txt
CSASPNETPageValidation ASP.NET Validator Controls (C#) Download ReadMe.txt
CSASPNETRDLCMainSubReport   Download ReadMe.txt
CSASPNETReportViewerExport Export report viewer data (C#) Download ReadMe.txt
CSASPNETRssFeeds Create a RSS feed using ASP.NET (C#) Download ReadMe.txt
CSASPNETSendMail Send email in ASP.NET (C#) Download ReadMe.txt
CSASPNETUserControlEventExpose   Download ReadMe.txt
VBASPNETAjaxExtender ASP.NET AJAX Extender (VB.NET) Download ReadMe.txt
VBASPNETFileUpload File upload in ASP.NET (VB.NET) Download ReadMe.txt
VBASPNETFormViewUpload ASP.NET FormView control (VB.NET) Download ReadMe.txt
VBASPNETImageMap ASP.NET ImageMap control (VB.NET) Download ReadMe.txt
VBASPNETLocalization Globalization and localization in ASP.NET (VB.NET) Download ReadMe.txt
VBASPNETMasterPage ASP.NET Master Page (VB.NET) Download ReadMe.txt
VBASPNETMenu Menu in ASP.NET (VB.NET) Download ReadMe.txt
VBASPNETRadioButtonTreeView Radio button in ASP.NET TreeView (VB.NET) Download ReadMe.txt
VBASPNETRssFeeds Create a RSS feed using ASP.NET (VB.NET) Download ReadMe.txt
VBASPNETUserControlEventExpose   Download ReadMe.txt

 

Visual Studio 2010 ASP.NET Code Samples

Sample Description Download ReadMe
CSASPNETAddControlDynamically Add controls dynamically in ASP.NET (C#) Download ReadMe.txt
CSASPNETAJAXAutoComplete Use AJAX AutoCompleteExtender (C#) Download ReadMe.txt
CSASPNETAJAXConsumeExternalWebService Consume an external Web Service from a different domain (C#) Download ReadMe.txt
CSASPNETAJAXHTMLEditorExtender Extend HTMLEditor in AJAX Control Toolkit (C#) Download ReadMe.txt
CSASPNETAJAXImagePreviewExtender An AJAX control extender for previewing image (C#) Download ReadMe.txt
CSASPNETAJAXWebChat Ajax web chat application (C#) Download ReadMe.txt
CSASPNETBingMaps Embed Bing Maps in ASP.NET pages (C#) Download ReadMe.txt
CSASPNETChart Use ASP.NET Chart control (C#) Download ReadMe.txt
CSASPNETCMD Run batch/cmd from ASP.NET (C#) Download ReadMe.txt
CSASPNETCurrentOnlineUserList   Download ReadMe.txt
CSASPNETShareSessionBetweenSubDomains Share ASP.NET sessions between domains (C#) Download ReadMe.txt
CSASPNETTheme Apply theme in ASP.NET (C#) Download ReadMe.txt
VBASPNETAddControlDynamically Add controls dynamically in ASP.NET (VB) Download ReadMe.txt
VBASPNETAJAXConsumeExternalWebService Consume an external Web Service from a different domain (VB.NET) Download ReadMe.txt
VBASPNETAJAXImagePreviewExtender An AJAX control extender for previewing image (VB.NET) Download ReadMe.txt
VBASPNETAJAXWebChat Ajax web chat application (VB.NET) Download ReadMe.txt
VBASPNETBingMaps Embed Bing Maps in ASP.NET pages (C#) Download ReadMe.txt
VBASPNETChart Use ASP.NET Chart control (VB.NET) Download ReadMe.txt
VBASPNETCMD Run batch/cmd from ASP.NET (VB.NET) Download ReadMe.txt

Download all code samples: http://1code.codeplex.com/releases

 

Submit your request of ASP.NET code samples (Guidance)

 

Posted On Tuesday, November 30, 2010 8:11 PM | Feedback (0)
All-In-One Silverlight Code Samples

All-In-One Silverlight Code Samples

Introduction

Silverlight is a powerful development platform for creating engaging, interactive applications for many screens across the Web, desktop, and mobile devices. The All-In-One Silverlight code samples demonstrate the typical programming topics about Silverlight. These topics are either frequently asked in MSDN forums and Microsoft Support, or are requested by many developers via our code sample request function. We want to alleviate the frustration felt by developers when they are developing Silverlight projects.

 

Visual Studio 2008 Silverlight Code Samples

Sample Description Download ReadMe
CSSL3Animation Animation in SL3 (C#) Download ReadMe.txt
CSSL3CustomControl Custom control in SL3 (C#) Download ReadMe.txt
CSSL3DataBinding Data binding in SL3 (C#) Download ReadMe.txt
CSSL3DeepZoom Deep zoom in SL3 (C#) Download ReadMe.txt
CSSL3FullScreen Full screen in SL3 (C#) Download ReadMe.txt
CSSL3HTMLBridge Interaction between HTML and managed code (C#) Download ReadMe.txt
CSSL3Input Mouse and keyboard inputs in SL3 (C#) Download ReadMe.txt
CSSL3IsolatedStorage Isolated storage in silverlight (C#) Download ReadMe.txt
CSSL3LocalMessage Communication between local Silverlight-based applications (C#) Download ReadMe.txt
CSSL3MediaElement Silverlight3 MediaElement (C#) Download ReadMe.txt
CSSL3OOB Out-of-browser Silverlight3 application (C#) Download ReadMe.txt
CSSL3PixelShader Pixel shader in SL3 (C#) Download ReadMe.txt
CSSL3PlaneProjection Plane projection in SL3 (C#) Download ReadMe.txt
CSSL3SocketClient Silverlight 3 socket client (C#) Download ReadMe.txt
CSSL3SocketServer Socket server for Silverlight 3 (C#) Download ReadMe.txt
CSSL3Text Work with text in SL3 (C#) Download ReadMe.txt
CSSL3WriteableBitmap Writeable bitmap in SL3 (C#) Download ReadMe.txt
VBSL3Animation Animation in SL3 (VB.NET) Download ReadMe.txt
VBSL3CustomControl Custom control in SL3 (VB.NET) Download ReadMe.txt
VBSL3DeepZoom Deep zoom in SL3 (VB.NET) Download ReadMe.txt
VBSL3FullScreen Full screen in SL3 (VB.NET) Download ReadMe.txt
VBSL3HTMLBridge Interaction between HTML and managed code (VB.NET) Download ReadMe.txt
VBSL3Input Mouse and keyboard inputs in SL3 (VB.NET) Download ReadMe.txt
VBSL3IsolatedStorage Isolated storage in silverlight (VB.NET) Download ReadMe.txt
VBSL3LocalMessage Communication between local Silverlight-based applications (VB.NET) Download ReadMe.txt
VBSL3MediaElement Silverlight3 MediaElement (VB.NET) Download ReadMe.txt
VBSL3OOB Out-of-browser Silverlight3 application (VB.NET) Download ReadMe.txt
VBSL3PixelShader Pixel shader in SL3 (VB.NET) Download ReadMe.txt
VBSL3PlaneProjection Plane projection in SL3 (VB.NET) Download ReadMe.txt
VBSL3SocketClient Silverlight 3 socket client (VB.NET) Download ReadMe.txt
VBSL3SocketServer Socket server for Silverlight 3 (VB.NET) Download ReadMe.txt
VBSL3Text Work with text in SL3 (VB.NET) Download ReadMe.txt
VBSL3WriteableBitmap Writeable bitmap in SL3 (VB.NET) Download ReadMe.txt
XAMLSL3SplashScreen Splash screen in SL3 (XAML) Download ReadMe.txt
XAMLSL3StyleControlTemplate Style and control template in SL3 Download ReadMe.txt
XAMLSL3Text Work with text in SL3 (Xaml) Download ReadMe.txt

 

Visual Studio 2010 Silverlight Code Samples

Sample Description Download ReadMe
CSSL4COMInterop Silverlight 4 interoperate with COM (C#) Download ReadMe.txt
CSSL4DataFormCancelButton Show Cancel button in Silverlight DataForm (C#) Download ReadMe.txt
CSSL4DataGridGroupHeaderStyle   Download ReadMe.txt
CSSL4MEF Using MEF in Silverlight (C#) Download ReadMe.txt
CSSL4WCFNetTcp Silverlight 4 netTcp transport binding element (C#) Download ReadMe.txt
VBSL4COMInterop Silverlight 4 interoperate with COM (VB.NET) Download ReadMe.txt
VBSL4DataFormCancelButton Show Cancel button in Silverlight DataForm (VB.NET) Download ReadMe.txt
VBSL4WCFNetTcp Silverlight 4 netTcp transport binding element (VB.NET) Download ReadMe.txt

Download all code samples: http://1code.codeplex.com/releases

 

Submit your request of Silverlight code samples (Guidance)

Posted On Tuesday, November 30, 2010 1:21 PM | Feedback (1)
Writing Windows Shell Extension with .NET 4 - Part 3

Sample download

In Part 1 and Part 2 of the series, we gave an introduction of writing Windows Shell extension in .NET Framework 4, and demonstrated a "skeleton" Context Menu Handler, and a "skeleton" Infotip Handler.


- Context Menu Handler


- Infotip Handler

You are looking at the third part of the series. It introduces writing Windows Shell Thumbnail Handler with .NET Framework 4.

CSShellExtThumbnailHandler:   Shell thumbnail handler (C#) 
VBShellExtThumbnailHandler:   Shell thumbnail handler (VB.NET)
CppShellExtThumbnailHandler: Shell thumbnail handler (C++)


A thumbnail image handler provides an image to represent the item. It lets you customize the thumbnail of files with a specific file extension. Windows Vista and newer operating systems make greater use of file-specific thumbnail images than earlier versions of Windows. Thumbnails of 32-bit resolution and as large as 256x256 pixels are often used. File format owners should be prepared to display their thumbnails at that size.

Demo

Here is a quick demo of the thumbnail image handler code sample. After you successfully build the sample project in Visual Studio 2010, you will get a DLL: CSShellExtThumbnailHandler.dll. Run 'Visual Studio
Command Prompt (2010)' (or 'Visual Studio x64 Win64 Command Prompt (2010)' if you are on a x64 operating system) in the Microsoft Visual Studio 2010 \ Visual Studio Tools menu as administrator. Navigate to the folder that contains the build result CSShellExtThumbnailHandler.dll and enter the command:

    Regasm.exe CSShellExtThumbnailHandler.dll /codebase

The thumbnail handler is registered successfully if the command prints:

    "Types registered successfully"

Step2. Find the chocolatechipcookies.recipe file in the sample folder. You will see a picture of chocoate chip cookies as its thumbnail.

The .recipe file type is simply an XML file registered as a unique file name extension. It includes an element called "Picture", embedding an image file. The thumbnail handler extracts the embedded image and asks the Shell to display it as a thumbnail.

Step3. In the same Visual Studio command prompt, run the command

    Regasm.exe CSShellExtThumbnailHandler.dll /unregister

to unregister the Shell thumbnail handler.

Implementation Details

A. Creating and configuring the project

In Visual Studio 2010, create a Visual C# / Windows / Class Library project named "CSShellExtThumbnailHandler". Open the project properties, and in the Signing page, sign the assembly with a strong name key file.

-----------------------------------------------------------------------------

B. Implementing a basic Component Object Model (COM) DLL

Shell extension handlers are all in-process COM objects implemented as DLLs. Making a basic .NET COM component is very straightforward. You just need to define a 'public' class with ComVisible(true), use the Guid attribute to specify its CLSID, and explicitly implements certain COM interfaces. For example,

    [ClassInterface(ClassInterfaceType.None)]
    [Guid("2A736503-DDE4-4876-801D-60063E9E2215"), ComVisible(true)]
    public class SimpleObject : ISimpleObject
    {
        ... // Implements the interface
    }

You even do not need to implement IUnknown and class factory by yourself because .NET Framework handles them for you.

-----------------------------------------------------------------------------

C. Implementing the thumbnail handler and registering it for a certain file class

-----------
Implementing the thumbnail handler:

The FileThumbnailProvider.cs file defines an thumbnail handler. The thumbnail handler implements the IInitializeWithStream and IThumbnailProvider interfaces.

    [ComImport(), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    [Guid("e357fccd-a995-4576-b01f-234630154e96")]
    internal interface IThumbnailProvider
    {
        void GetThumbnail(uint cx, out IntPtr hbmp, out WTS_ALPHATYPE dwAlpha);
    }

    [ComImport(), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    [Guid("b824b49d-22ac-4161-ac8a-9916e8fa3f7f")]
    internal interface IInitializeWithStream
    {
        void Initialize(IStream stream, STGM grfMode);
    }

    [ClassInterface(ClassInterfaceType.None)]
    [Guid("2A736503-DDE4-4876-801D-60063E9E2215"), ComVisible(true)]
    public class FileThumbnailProvider : IInitializeWithStream, IThumbnailProvider
    {
        #region IInitializeWithStream Members

        public void Initialize(IStream stream, STGM grfMode)
        {
            ...
        }

        #endregion  


        #region IThumbnailProvider Members

        public void GetThumbnail(uint cx, out IntPtr hbmp, out WTS_ALPHATYPE dwAlpha)
        {
            ...
        }

        #endregion
    }

When you write your own handler, you must create a new CLSID by using the "Create GUID" tool in the Tools menu for the shell extension class, and specify the value in the Guid attribute.

    ...
    [Guid("2A736503-DDE4-4876-801D-60063E9E2215"), ComVisible(true)]
    public class FileThumbnailProvider : ...


  1. Implementing IThumbnailProvider

  The IThumbnailProvider interface has been introduced in Windows Vista to make providing a thumbnail easier and more straightforward than in the past, when IExtractImage would have been used instead. Note, that existing code that uses IExtractImage is still valid under Windows Vista. However, IExtractImage is not supported in the Details pane.

  IThumbnailProvider has only one method—GetThumbnail—that is called with the largest desired size of the image, in pixels. Although the parameter is called cx, this is used as the maximum size of both the x and y dimensions. If the retrieved thumbnail is not square, then the longer axis is limited by cx and the aspect ratio of the original image respected.

  On exit, GetThumbnail provides a handle to the retrieved image. It also provides a value that indicates the color format of the image and whether it has valid alpha information.

    public void GetThumbnail(uint cx, out IntPtr hbmp, out WTS_ALPHATYPE dwAlpha)
    {
        // Read the base64-encoded string value representing the thumbnail image
        // from the source stream.
        XDocument doc = XDocument.Load(this._stream);
        var picture = doc.Element("Recipe").Element("Attachments").Element("Picture");
        // The XML may provide images of different sizes, and the code can query
        // image matching the desired size (cx). For simplicity, this sample
        // omits the cx paramter and provides only one image for all situations.

        string imageString = picture.Attribute("Source").Value;

        // Convert the base64-encoded string to a stream.
        byte[] buffer = Convert.FromBase64String(imageString);
        Stream imageStream = new MemoryStream(buffer);

        // Construct a bitmap from the stream and get its handle.
        Bitmap bmp = new Bitmap(imageStream);
        hbmp = bmp.GetHbitmap();

        // Set the alpha type of the thumbnail image.
        dwAlpha = WTS_ALPHATYPE.WTSAT_ARGB;
    }

  The .recipe file type is simply an XML file registered as a unique file name extension. It includes an element called Picture that embeds images to be used as the thumbnail for this particular .recipe file. The XML may provide images of different sizes, and the code can query image matching the desired size specified by the cx parameter of GetThumbnail. For simplicity, this sample omits the cx paramter and provides only one image for all situations.

  2. Implementing IInitializeWithStream/IInitializeWithItem/IInitializeWithFile

  IThumbnailProvider must always be implemented in concert with one of these interfaces:
 
    IInitializeWithStream - provides the file stream
    IInitializeWithItem - provides the IShellItem
    IInitializeWithFile - provides the file path

  Whenever possible, it is recommended that initialization be done through a stream using IInitializeWithStream. Benefits of this include increased security and stability.

    private ReadOnlyIStreamStream _stream = null;

    public void Initialize(IStream stream, STGM grfMode)
    {
        // A handler instance should be initialized only once in its lifetime.
        if (this.stream == null)
        {
            // Initialize the stream if it has not been initialized yet.
            this._stream = new ReadOnlyIStreamStream(stream);
        }
        else
        {
            Marshal.ThrowExceptionForHR(WinError.HRESULT_FROM_WIN32(
                WinError.ERROR_ALREADY_INITIALIZED));
        }
    }

-----------
Registering the handler for a certain file class:

Thumbnail handlers can be associated with a file class. The handlers are registered by setting the default value of the following registry key to be the CLSID the handler class.

    HKEY_CLASSES_ROOT\<File Type>\shellex\{e357fccd-a995-4576-b01f-234630154e96}

The registration of the thumbnail handler is implemented in the Register method of FileThumbnailProvider. The ComRegisterFunction attribute attached to the method enables the execution of user-written code other than the basic registration of the COM class. Register calls the ShellExtReg.RegisterShellExtThumbnailHandler method in ShellExtLib.cs to associate the handler with a certain file type. If the file type starts with '.', it tries to read the default value of the HKCR\<File Type> key which may contain the Program ID to which the file type is linked. If the default value is not empty, use the Program ID as the file type to proceed the registration.

For example, this code sample associates the handler with '.recipe' files. The following keys and values are added in the registration process of the sample handler.

    HKCR
    {
        NoRemove .recipe
        {
            NoRemove shellex
            {
                {e357fccd-a995-4576-b01f-234630154e96} =
                    s '{2A736503-DDE4-4876-801D-60063E9E2215}'
            }
        }
    }

The unregistration is implemented in the Unregister method of FileThumbnailProvider. Similar to the Register method, the ComUnregisterFunction attribute attached to the method enables the execution of user-written code during the unregistration process. It removes the registry key: HKCR\<File Type>\shellex\{e357fccd-a995-4576-b01f-234630154e96}.

Diagnostic:

Debugging thumbnail handlers is difficult for several reasons.

1) The Windows Explorer hosts thumbnail providers in an isolated process to get robustness and improve security. Because of this it is difficult to debug your handler as you cannot set breakpoints on your code in the explorer.exe process as it is not loaded there. The isolated process is DllHost.exe and this is used for other purposes so finding the right instance of this process is difficult.

2) Once a thumbnail is computed for a particular file it is cached and your handler won't be called again for that item unless you invalidate the cache by updating the modification date of the file. Note that this cache works even if the files are renamed or moved.

Given all of these issues the easiest way to debug your code in a test application then once you have proven it works there test it in the context of the explorer.

Another thing to do is to disable the process isolation feature of explorer. You can do this by putting the following named value on the CLSID of your handler

    HKCR\CLSID\{CLSID of Your Handler}
        DisableProcessIsolation=REG_DWORD:1

Be sure to not ship your handler with this on as customers require the security and robustness benefits of the isolated process feature.

Download

http://1code.codeplex.com/releases

And find the CS/VB/CppShellExtThumbnailHandler samples in the Visual Studio 2010 folder.

If you have any feedback about the samples, please email onecode@microsoft.com.

Posted On Monday, November 08, 2010 8:48 PM | Feedback (1)
Microsoft Code Sample for developers
  • Microsoft All-In-One Code Framework
  • Microsoft SDKs
  • MSDN Code Gallery
     

Microsoft All-In-One Code Framework

SampleBrowser.png
The Microsoft All-In-One Code Framework is a free, centralized code sample library provided by the Microsoft Community team. Their goal is to provide typical code samples for all Microsoft development technologies.

The team listens to developers’ pains in MSDN forums, social media and various developer communities. They write code samples based on developers’ frequently asked programming tasks, and allow developers to download them with a short code sample publishing cycle. Additionally, their team offers a free code sample request service. This service is a proactive way for our developer community to obtain code samples for certain programming tasks directly from Microsoft.

Introduction Video

Get The Code You Need & Save Your Keyboard!
 

Microsoft SDKs

On this page you will find links to Microsoft Software Development Kits (SDKs), which provide documentation, code samples, tools, headers, libraries, and other files that developers can use to create software applications and libraries.
 

MSDN Code Gallery

Download and share sample applications, code snippets, and other resources with the developer community.

Posted On Monday, November 08, 2010 2:00 PM | Feedback (0)
Code Sample Update from Microsoft All-In-One Code Framework (2010-11-05)

The code samples in Microsoft All-In-One Code Framework are updated on 2010-10-10.

Download address: http://1code.codeplex.com/releases/view/55110#DownloadId=163650

If it’s the first time that you hear about Microsoft All-In-One Code Framework, please watch the introduction video on YouTube http://www.youtube.com/watch?v=cO5Li3APU58, or read the introduction on our homepage http://1code.codeplex.com/,  and this Port25 article http://port25.technet.com/archive/2010/01/18/the-all-in-one-code-framework.aspx

--------------

New ASP.NET Code Samples

VBASPNETBingMaps

This code sample shows how to use the Bing Maps API in an ASP.NET page. Sometimes we need to embed a map in our ASP.NET pages to locate a place and show the surroundings around the place. To achieve this task, Bing Maps API provide a map control. You can easily set the location, zoom level, display mode and other properties using only a few code.

CSASPNETAJAXConsumeExternalWebService, VBASPNETAJAXConsumeExternalWebService

When you request external web services by Ajax from client side, you may get the "Access Denied" error because of security issues. Web services do not allow cross-domain requests directly from the client. However, in many cases, we need cross-domain access to web services, then how to do? There are several ways to achieve it: If you visit the web service from outside the domain of your control, you can reference this from the server side, and then re-create a local web service to consume web services just quoted to visit the cross-domain services indirectly, which will be talked in this sample in details; if you can control the external web service, consider using JSONP directly from the client to consume cross domain web services or WCF services, MSDN has an article that discussed this method (http://msdn.microsoft.com/en-us/library/cc716898(VS.90).aspx).

 

CSASPNETShareSessionBetweenSubDomains

Sometimes we will publish a number of ASP.NET Web Sites on different Sub-Domains. We want these sites to share Session State, so that we can achieve one login and passing data etc. It seems that they are actually in the same site. This sample does demonstrating how to let two ASP.NET Web Sites share Session State on Sub-Domains.

New CLR and .NET General Code Samples

CSEnumerateAppDomains, VBEnumerateAppDomains

The sample demonstrates how to enumerate the managed processes and AppDomains using hosting API and debugging API. To identify whether a process is a managed process, you can check whether it loads CLRs using hosting API. If you want to enumerate the AppDomains in the process, attach a debugger to the process using debugging API.

CSMonitorRegistryChange, VBMonitorRegistryChange

The sample demonstrates how to monitor the registry key change event using WMI event. The change event will be raised when one of the following operations happened.

  • Rename or delete the key.
  • Add, rename or delete a sub key under the key.
  • Add, rename, edit or delete  a value of the key.

 

New Silverlight Code Samples

CSSL4DataFormCancelButton, VBSL4DataFormCancelButton

In this code sample, we create a data source with data item inherited from IEditableObject interface and implement BeginEdit, CancelEdit and EndEdit functions.  This will implement data reset functionality by pressing Cancel Button while editing on DataForm.

CSSL4DataGridGroupHeaderStyle

This project created a sample application, which illustrates how to define group header style of different levels and define group header style according to group header content in DataGrid Control.

CSSL4MEF

MEF(Managed Extensibility Framework) is a framework which could assist developers to design extensible application, it's supported by Silverlight 4. This sample utilize MEF to create a simple text formatter. By the predefined contract, user could create components to enhance the formatter’s functionality. The components could be loaded at runtime.

 

New Windows Workflow Code Samples

CSWF4CustomSequenceActivity

Generally, we use the built in Sequence activity to build a sequence workflow. Sequence activity is a composite activity. this sample demonstrated creating an customized composite activity: MySequenceActivity. and also
its activity designer so that you can use it in a workflow designer. If you are going to create your own WF4 activity, you can use this sample as a reference.

CSWF4LongRunningHost

In WF3, when a workflow is delayed and persisted in persistence store, after the timer expired, workflow will resume from database automatically. Now in WF4, we have to resume a persisted workflow manually, So can we create a long running WF4 that can monitor a delayed workflow and resume a workflow automatically after the delay timer expired? this sample include a host that can do this.

 

New Windows Shell Code Samples

CppShellExtThumbnailHandler, CSShellExtThumbnailHandler, VBShellExtThumbnailHandler


(thumbnail provider)

The .NET 4 code sample demonstrates the C# implementation of a thumbnail handler for a new file type registered with the .recipe extension.

A thumbnail image handler provides an image to represent the item. It lets you customize the thumbnail of files with a specific file extension. Windows Vista and newer operating systems make greater use of file-specific thumbnail images than earlier versions of Windows. Thumbnails of 32-bit resolution and as large as 256x256 pixels are often used. File format owners should be prepared to display their thumbnails at that size.

The handler implements the IInitializeWithStream and IThumbnailProvider interfaces, and provides thumbnails for .recipe files. The .recipe file type is simply an XML file registered as a unique file name extension. It includes
an element called "Picture", embedding an image file. The thumbnail handler extracts the embedded image and asks the Shell to display it as a thumbnail.

 

Download address: http://1code.codeplex.com/releases/view/55110#DownloadId=163650

If you have any suggestions, questions or feedback about this release, please email us: onecode@microsoft.com.

Posted On Monday, November 08, 2010 1:46 PM | Feedback (0)
Four hilarious video clips introducing Microsoft All-In-One Code Framework. LOL

Four hilarious video clips introducing Microsoft All-In-One Code Framework - a one-stop code sample library by Microsoft.

Which one do you like best?
 

Get The Code You Need & Save Your Keyboard!

 

Get the Code You Need & Get some Sleep!

 

Get the Code You Need & …………………………

 

Get the Code You Need & Save Your Brain!

 

Posted On Friday, November 05, 2010 10:56 PM | Feedback (0)
Advertise on this site through Lake Quincy Media
Tag Cloud