Skip to content

Commit

Permalink
Added Alert Icon for Notification Tray
Browse files Browse the repository at this point in the history
Added the notify icon for alerts. This will change the icon in both the
main interface and the notification icon (if it's used).
  • Loading branch information
Ben0xA committed Jul 25, 2014
1 parent 65403a4 commit dab145e
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 27 deletions.
Binary file removed Binary/poshsecframework.exe
Binary file not shown.
Binary file modified Binary/poshsecframework.zip
Binary file not shown.
Binary file added poshsecframework/Images/psficon_alert.ico
Binary file not shown.
23 changes: 12 additions & 11 deletions poshsecframework/Interface/frmMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions poshsecframework/Interface/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2723,6 +2723,36 @@ private void cmbLibraryTypes_SelectedIndexChanged(object sender, EventArgs e)
}
#endregion

#region Tab Pages
private void tbpAlerts_TextChanged(object sender, EventArgs e)
{
int alertcnt = lvwAlerts.Items.Count;
if (alertcnt > 0)
{
nimain.Icon = Properties.Resources.psficon_alert;
this.Icon = Properties.Resources.psficon_alert;
nimain.Text = StringValue.psftitle + " - Alerts (" + alertcnt.ToString() + ")";
if (alertcnt > 1)
{
nimain.BalloonTipText = String.Format(StringValue.AlertsBalloon, alertcnt.ToString());
}
else
{
nimain.BalloonTipText = StringValue.AlertBalloon;
}
nimain.ShowBalloonTip(5);
}
else
{
nimain.Icon = Properties.Resources.psficon_ico;
this.Icon = Properties.Resources.psficon_ico;
nimain.Text = StringValue.psftitle;
nimain.BalloonTipText = "";
}
}
#endregion

#region Tab Control
private void tcMain_Selected(object sender, TabControlEventArgs e)
{
if (e.TabPage == tbpPowerShell)
Expand All @@ -2731,11 +2761,14 @@ private void tcMain_Selected(object sender, TabControlEventArgs e)
txtPShellOutput.DrawCaret();
}
}
#endregion

#region NotifyIcon
private void nimain_DoubleClick(object sender, EventArgs e)
{
this.WindowState = lastwindowstate;
}
#endregion

#endregion

Expand All @@ -2745,6 +2778,8 @@ public bool CancelIPScan
get { return cancelscan; }
}
#endregion



}
}
45 changes: 30 additions & 15 deletions poshsecframework/Interface/frmMain.resx
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,11 @@
<metadata name="tbMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>957, 17</value>
</metadata>
<metadata name="cmnuScripts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>367, 17</value>
<metadata name="tsScripts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>253, 56</value>
</metadata>
<metadata name="tsModules.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>145, 56</value>
</metadata>
<metadata name="imgList16.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1047, 17</value>
Expand All @@ -137,16 +140,16 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACI
KQAAAk1TRnQBSQFMAgEBCQEAARABDgEQAQ4BEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
KQAAAk1TRnQBSQFMAgEBCQEAATgBDgE4AQ4BEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
AwABMAMAAQEBAAEgBgABMBYAAxoBJAMz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Ab8BiQEHAv8BlAEAAv8BlAEAAv8BlAEAAv8BlAEAAv8BlAEABf8DMwFSyAADMwFSBf8BlAEA
Bf8BvwGJAQcC/wGUAQAC/wGUAQAC/wGUAQAC/wGUAQAC/wGUAQAC/wGUAQAC/wGUAQAF/wMzAVLIAAMz
AVIF/wGUAQAC/wGUAQAC/wGUAQAC/wGUAQAC/wGUAQAC/wGUAQAC/wGUAQAC/wGUAQAC/wGUAQAC/wGU
AQAF/wMzAVLIAAMzAVIw/wMzAVLIAAMzAVIw/wMzAVLIAAMzAVIw/wMzAVLIAAMWAR8DMwFSAzMBUgMz
AVIDMwFSAzMBUgMzAVIDMwFSAzMBUgMzAVIDMwFSAzMBUgMzAVIDGgEkxAAI/wO3Af8DnwH/A58B/wOf
Expand Down Expand Up @@ -317,6 +320,15 @@
AQMBAQGABP8B/gEPAccB4ws=
</value>
</data>
<metadata name="tsNetworks.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1264, 17</value>
</metadata>
<metadata name="tsSystems.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>694, 56</value>
</metadata>
<metadata name="cmnuScripts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>367, 17</value>
</metadata>
<metadata name="tsScripts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>253, 56</value>
</metadata>
Expand All @@ -331,7 +343,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACW
DgAAAk1TRnQBSQFMAgEBBAEAASABDQEgAQ0BEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
DgAAAk1TRnQBSQFMAgEBBAEAAUgBDQFIAQ0BEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
AwABIAMAAQEBAAEgBgABIP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8AQgADJgE4AxYBHjgA
AyYBOAMWAR44AAMmATgDFgEeOAADJgE4AxYBHjQAAyYBOANiAfYDtgH/AxgBITAAAyYBOANiAfYDtgH/
AxgBITAAAyYBOANiAfYDtgH/AxgBITAAAyYBOANiAfYDtgH/AxgBISwAAyYBOANiAfYD4AH/A9gB/wO2
Expand Down Expand Up @@ -399,9 +411,6 @@
<metadata name="tsModules.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>145, 56</value>
</metadata>
<metadata name="tsNetworks.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>1264, 17</value>
</metadata>
<metadata name="tsSystems.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>694, 56</value>
</metadata>
Expand All @@ -411,6 +420,9 @@
<metadata name="cmnuScheduleCommands.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>501, 56</value>
</metadata>
<metadata name="tsAlerts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>275, 17</value>
</metadata>
<metadata name="cmnuAlerts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
Expand All @@ -422,7 +434,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAe
GAAAAk1TRnQBSQFMAgEBBQEAASgBDQEoAQ0BEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
GAAAAk1TRnQBSQFMAgEBBQEAAVABDQFQAQ0BEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
AwABIAMAAQEBAAEgBgABIP8AIwADGQEjA0UBfQJaAV8B2wJMAV8B8wJMAV8B8wJaAV8B2wNFAX0DGQEj
3AADMwFTAlgBYQHmAgAB1AH/AYQBkAHnAf8BlQGgAe4B/wGVAZ8B7QH/AYMBjgHlAf8CAAHOAf8CWAFh
AeYDMwFT1AADMwFTAlIBZQH0AQABhAHjAf8BoQGsAfQB/wEAAYsB7AH/AgAB5AH/AgAB4wH/AQABhwHq
Expand Down Expand Up @@ -530,6 +542,9 @@
<metadata name="tsAlerts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>275, 17</value>
</metadata>
<metadata name="tsActiveScripts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>485, 17</value>
</metadata>
<metadata name="cmnuActiveScripts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>350, 56</value>
</metadata>
Expand Down Expand Up @@ -3104,7 +3119,7 @@
</value>
</data>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
<value>166</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
Expand Down
22 changes: 21 additions & 1 deletion poshsecframework/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions poshsecframework/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,10 @@
<data name="dialogyes" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\dialog-yes.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="psficon_ico" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Images\psficon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="psficon_alert" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Images\psficon_alert.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file added poshsecframework/Resources/psficon.ico
Binary file not shown.
Binary file added poshsecframework/Resources/psficonalert.ico
Binary file not shown.
2 changes: 2 additions & 0 deletions poshsecframework/Strings/StringValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ namespace poshsecframework.Strings
internal static class StringValue
{
public const string psftitle = "PoshSec Framework";
public const string AlertBalloon = "You have an alert!";
public const string AlertsBalloon = "You have {0} alerts!";
public const string PSRequirements = "It appears that your environment is not configured correctly for PoshSec Framework to work correctly.\r\nYou need PowerShell 3.0 (Windows Management Framework 3.0) and Microsoft .NET 4.5\r\nPlease download and install WMF 3.0 before running PoshSec Framework.";
public const string ActiveScriptsRunning = "You have active scripts running. If you exit, all running scripts will be terminated. Are you sure you want to exit?";
public const string ReloadScriptsRunning = "Can not reload the framework because there are scripts running. Please stop all scripts before issuing the reload command again.";
Expand Down
3 changes: 3 additions & 0 deletions poshsecframework/poshsecframework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@
<ItemGroup />
<ItemGroup>
<Content Include="Images\psficon.ico" />
<None Include="Images\psficon_alert.ico" />
<Content Include="Resources\psficon.ico" />
<Content Include="Resources\psficonalert.ico" />
<None Include="Resources\dialog-yes.png" />
<None Include="Resources\dialog-no-2.png" />
<None Include="Resources\application-x-shellscript1.png" />
Expand Down

0 comments on commit dab145e

Please sign in to comment.