Windows Runtime – C# Send EMail from App

Windows-Dev

I’m working on my About page for a Windows Phone Runtime app and needed to be able to send an email for feedback or support issues.

Below is the code for my event handler in the code behind (AboutPage.cs):

        async private void Image_Email(object sender, TappedRoutedEventArgs e)
        {
            //Define email address to send to
            EmailRecipient sendTo = new EmailRecipient()
            {
                Address = "mail@domain.com"
            };

            //New email and define email subject
            EmailMessage mail = new EmailMessage();
            mail.Subject = "Linux Essentials - Feedback";

            //Add addressee to email
            mail.To.Add(sendTo);

            //Open share contact with email only
            await EmailManager.ShowComposeNewEmailAsync(mail);
        }

The XAML on my About page is simply an image with the Tapped event:

      <Image Source="Assets/Images/Mail.png"
             Height="64"
             Width="64"
             Margin="0,0,22,0"
             Tapped="Image_Email"/>

When defining a new email you can also specify the mail body text:

mail.Body = "this is the Body";

Source: http://dotnet.dzone.com/articles/how-send-mail-your-windows

Windows Runtime – C# Launch Hyperlink

Windows-Dev

I’m working on my About page for a Windows Phone Runtime app and needed to open a hyperlink in my code behind (AboutPage.cs).

Below is the code for my Tapped event handler:

        private void Image_Wordpress(object sender, TappedRoutedEventArgs e)
        {
            Launcher.LaunchUriAsync(new Uri("https://pricklytech.wordpress.com/"));
        }

The XAML on my About page is simply an image with the Tapped event:

      <Image Source="Assets/Images/Wordpress.png"
             Height="64"
             Width="64"
             Tapped="Image_Wordpress"/>

Source: http://stackoverflow.com/questions/12501174/opening-a-url-in-the-default-browser-in-a-windows-8-desktop-application

Quick Tip: Removing Favorites, Frequent Folders and Recent Files from the Home folder in Windows 10

Windows 8 Logo

In the Windows 10 Technical Preview File Explorer defaults to the Home folder which shows Favorites, Frequent Folders and Recent Files.

Win 10 Home Folder

To remove these folders we need to edit the registry. Click the Start button and then type regedit.exe and press Enter.

Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HomeFolder. To make a backup of this folder right click it and then select Export and save it.

Expand the folders beneath HomeFolder and you will see the NameSpace and DelegateFolders. The latter contains three GUIDs for the Frequent Places Folder, Recent Items Instance Folder and the Favorites Folder respectively.

Win 10 Regedit Home Folders

Right click on each GUID that you wish to remove and then select Delete and they will no longer appear in your Home Folder in File Explorer.

Source: http://www.wpcentral.com/new-windows-10-home-folder-convenient-or-bad-privacy

 

Quick Tip: How to Enable Internet Explorer Modern App in Windows 10

Windows 8 Logo

The Modern (Metro) Internet Explorer (IE) app is missing from the Windows 10 Technical Preview.

I find this a bit curious as I use Modern IE to share URLs with the Reading List app.

Fortunately @adamUCF created a PowerShell script that launches Modern IE.

Copy the script into a text document and then change the file extension to .ps1. Right click the PowerShell script and then select Run with PowerShell to run Modern IE.

$code = @"
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace Win8 {

    [ComImport, Guid("2e941141-7f97-4756-ba1d-9decde894a3d"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    interface IApplicationActivationManager
    {
        IntPtr ActivateApplication([In] String appUserModelId, [In] String arguments, [In] UInt32 options, [Out] out UInt32 processId);
    }

[ComImport, Guid("45BA127D-10A8-46EA-8AB7-56EA9078943C")]//Application Activation Manager
    public class ApplicationActivationManager : IApplicationActivationManager
    {
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)/*, PreserveSig*/]
        public extern IntPtr ActivateApplication([In] String appUserModelId, [In] String arguments, [In] UInt32 options, [Out] out UInt32 processId);

    }

}
"@

add-type -TypeDefinition $code
$appman = new-object Win8.ApplicationActivationManager

$appman.ActivateApplication("DefaultBrowser_NOPUBLISHERID!Microsoft.InternetExplorer.Default",$null,0,[ref]0)

You will need to run this script each time that you want to open Modern IE.

Sources: http://www.wpcentral.com/heres-how-get-modern-version-ie-running-windows-10-technical-preview

Windows 8.1 – How to Change the Accent Color

Windows 8 Logo

I ran through the Out of Box Experience too quickly yesterday on Windows 8.1 and forgot to change the accent color. It’s fortunately simple to change.

On the Start Screen type personalize and then select Change the background and colors on start.

Next simply select the accent color from the Personalize panel:

Personalize

Inkscape – Change the white background workspace to a transparent color

Windows 8 Logo

If you want to change the default workspace color in Inkscape from white to another color – here’s how to do it:

  • Press Ctrl, Shift and D to open the Document Properties window
  • Click on the Background color

Inkscape-background

  • Change the RGBA value to 888888FF

Inkscape-Backround-Color

Note: 888888 defines the color in hex – FF makes the color fully transparent.

Your workspace will now have a grey background.

Source: http://stackoverflow.com/questions/3510482/transparency-vs-white-background-in-inkscape