From 2997e9adb4527740a2e6357b154d8cec2cdef2d4 Mon Sep 17 00:00:00 2001 From: jrtechs Date: Sun, 31 Jan 2016 08:40:23 -0500 Subject: [PATCH] Connected the program to skype. --- Skype History Viewer/Form1.Designer.cs | 3 + Skype History Viewer/Form1.cs | 66 +++++++++++++++++++ .../Skype History Viewer.csproj | 11 ++++ 3 files changed, 80 insertions(+) diff --git a/Skype History Viewer/Form1.Designer.cs b/Skype History Viewer/Form1.Designer.cs index 025b6ee..92d7de9 100644 --- a/Skype History Viewer/Form1.Designer.cs +++ b/Skype History Viewer/Form1.Designer.cs @@ -62,6 +62,7 @@ this.cmdExportAll.TabIndex = 2; this.cmdExportAll.Text = "Export All To Text File"; this.cmdExportAll.UseVisualStyleBackColor = true; + this.cmdExportAll.Click += new System.EventHandler(this.cmdExportAll_Click); // // cmdExport // @@ -71,6 +72,7 @@ this.cmdExport.TabIndex = 3; this.cmdExport.Text = "Export Selected to Text File"; this.cmdExport.UseVisualStyleBackColor = true; + this.cmdExport.Click += new System.EventHandler(this.cmdExport_Click); // // cmdAdd // @@ -80,6 +82,7 @@ this.cmdAdd.TabIndex = 4; this.cmdAdd.Text = "View History for Selected User"; this.cmdAdd.UseVisualStyleBackColor = true; + this.cmdAdd.Click += new System.EventHandler(this.cmdAdd_Click); // // cmdClear // diff --git a/Skype History Viewer/Form1.cs b/Skype History Viewer/Form1.cs index 66a4dc6..fb3c7db 100644 --- a/Skype History Viewer/Form1.cs +++ b/Skype History Viewer/Form1.cs @@ -7,14 +7,80 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using SKYPE4COMLib; namespace Skype_History_Viewer { public partial class FrmMain : Form { + private Boolean connected = false; + private Skype skype = new Skype(); + public FrmMain() { InitializeComponent(); + connected = connectToSkype(); + } + + private void cmdAdd_Click(object sender, EventArgs e) + { + if(!connected) + { + errorMessage(); + } + else + { + + } + } + + private void errorMessage() + { + connected = connectToSkype(); + if(!connected) + { + MessageBox.Show("Could not connect to skype, please make sure that skype is running and this plugin is allowed."); + } + + } + + + private Boolean connectToSkype() + { + try + { + //attaches the program to skype + skype.Attach(); + return true; + } + catch + { + return false; + } + } + + private void cmdExport_Click(object sender, EventArgs e) + { + if (!connected) + { + errorMessage(); + } + else + { + + } + } + + private void cmdExportAll_Click(object sender, EventArgs e) + { + if (!connected) + { + errorMessage(); + } + else + { + + } } } } diff --git a/Skype History Viewer/Skype History Viewer.csproj b/Skype History Viewer/Skype History Viewer.csproj index e6bc11b..f10df98 100644 --- a/Skype History Viewer/Skype History Viewer.csproj +++ b/Skype History Viewer/Skype History Viewer.csproj @@ -79,6 +79,17 @@ + + + {03282B5D-B38F-469D-849A-09B0A7F4881B} + 1 + 0 + 0 + tlbimp + False + True + +