因为foxmail没有api调用接口,工作中又需要使用foxmail发送邮件(主要是附件)。在网上没有发现这方面的程序。特写一下自己写的一个示例
示例如下:
需要添加 using System.Runtime.InteropServices;
public class FoxmailHelper
{
[DllImport("user32.dll", EntryPoint = "FindWindow")]
private extern static IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll", EntryPoint = "GetWindow")]
private extern static IntPtr GetWindow(IntPtr hWnd, uint nCmd);
[DllImport("user32.dll")]
static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);
[DllImport("User32.dll", CharSet = CharSet.Auto)]
public static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int nMaxCount);
[DllImport("user32.dll", EntryPoint = "FindWindowEx", SetLastError = true)]
public static extern IntPtr FindWindowEx(IntPtr hw