Skype for Desktop – 8.39.0.180

email me

Download

New Skype for Desktop (Windows) is available here:

https://go.skype.com/windows.desktop.download  mirror


Silent Install

setup.exe /VERYSILENT /SP- /NOCANCEL /NORESTART /SUPPRESSMSGBOXES /NOLAUNCH -ms


Uninstall

Reg Keys

“HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Skype_is1”

Command

“C:\Program Files (x86)\Microsoft\Skype for Desktop\unins000.exe” /SILENT

 

Notes

Disable Skype auto updates

Apple iTunes – 12.9.3.3

email me

Download

New iTunes app is available from here:

https://www.apple.com/itunes/download/win64


Contents of iTunes64Setup.exe
(using 7zip)


Size

256 MB


Command

iTunes64.msi /qn /norestart IAcceptLicense=Yes ALLUSERS=1 DESKTOP_SHORTCUTS=1 INSTALL_ASUW=0 NO_ASUW=1 SCHEDULE_ASUW=0


Notes

C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell -ExecutionPolicy Bypass -Command “Get-AppxPackage *AppleInc.iTunes* | Remove-AppxPackage”

msiexec /x “{56DDDFB8-7F79-4480-89D5-25E1F52AB28F}” /qn
msiexec /x “{5A659BE5-849B-484E-A83B-DCB78407F3A4}” /qn
msiexec /x “{F8060941-C0AB-4BCE-88AC-F2FDA2E9F286}” /qn
msiexec /x “{A30EA700-5515-48F0-88B0-9E99DC356B88}” /qn
msiexec /x “{5FA8C4BE-8C74-4B9C-9B49-EBF759230189}” /qn
msiexec /x “{D9D08A8F-5A03-486A-AD4D-3A438D521F8B}” /qn

Python – Simple Form, with Functions and Buttons

email me

Tested on a Mac > terminal > python script.py

import Tkinter as tk

root = tk.Tk()

# Function
counter = 0
def btn1():
button1.config(state="disabled")
counter = 0
def count():
global counter
counter += 1
label.config(text=str(counter))
label.after(1000, count)
count()

# setup form
root.title("Welcome to Commlink")
label = tk.Label(root, fg="dark green")
label.pack()

button1 = tk.Button(root, text='Start', width=25, command=btn1)
button1.pack()

button2 = tk.Button(root, text='Stop', width=25, command=root.destroy)
button2.pack()

root.mainloop()


Minimizing Window – Make Top Most


import Tkinter as tk
import webbrowser

# OPEN URL
new = 2
url = "http://google.com"
def btn3():
webbrowser.open(url,new=new)
command=quit(root)

# RUN TIMER
counter = 11
def btn1():
root.wm_state('iconic')
button1.config(state="disabled")
counter = 11
def count():
global counter
counter -= 1
if counter == 0:
retControl()
counter = 11
label1.config(text="")
root.deiconify()
return
label1.config(text=str(counter)+ " seconds")
label1.after(1000, count)
count()

# Return Snooze Button Control
def retControl():
button1.config(state="active")

# Kill Window
def quit(self):
self.destroy()
exit()

# form

root = tk.Tk()

root.title("Technology Notification")

# removes title bar
# root.overrideredirect(True)

label1 = tk.Label(root, fg="red")
label1.pack()

label2 = tk.Label(root, text = "Welcome to your first notification!\n\n")
label2.pack()

button1 = tk.Button(root, text='Snooze', width=25, command=btn1)
button1.pack()

button2 = tk.Button(root, text='Close', width=25, command=root.destroy)
button2.pack()

button3 = tk.Button(root, text='Open URL', width=25, command=btn3)
button3.pack()

# place window on top
root.attributes('-topmost', True)

root.mainloop()


Screenshot


Notes

Same code…

Tested in Windows > IDLE > script.py

C# – Flashing Taskbar Icon

email me

This is how you create those flashing Taskbar icons.

Form1.Designer.cs

Added to private void InitializeComponent (bottom of method)

FlashWindow.Tray(this);


Added under the private void InitializeComponent method

public static class FlashWindow
{
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool FlashWindowEx(ref FLASHWINFO pwfi);

/// Stop flashing. The system restores the window to its original state.
public const uint FLASHW_STOP = 0;

/// Flash the window caption.
public const uint FLASHW_CAPTION = 1;

/// Flash the taskbar button.
public const uint FLASHW_TRAY = 2;

/// Flash both the window caption and taskbar button.
/// This is equivalent to setting the FLASHW_CAPTION | FLASHW_TRAY flags.
public const uint FLASHW_ALL = 3;

/// Flash continuously, until the FLASHW_STOP flag is set.
public const uint FLASHW_TIMER = 4;

/// Flash continuously until the window comes to the foreground.
public const uint FLASHW_TIMERNOFG = 12;

[StructLayout(LayoutKind.Sequential)]
private struct FLASHWINFO
{

/// The size of the structure in bytes.
public uint cbSize;

/// A Handle to the Window to be Flashed. The window can be either opened or minimized.
public IntPtr hwnd;

/// The Flash Status.
public uint dwFlags;

/// The number of times to Flash the window.
public uint uCount;

/// The rate at which the Window is to be flashed, in milliseconds. If Zero, the function uses the default cursor blink rate.
public uint dwTimeout;
}

/// Flash the specified Window (Form) until it receives focus.
public static bool Flash(System.Windows.Forms.Form form)
{
// Make sure we're running under Windows 2000 or later
if (Win2000OrLater)
{
FLASHWINFO fi = Create_FLASHWINFO(form.Handle, FLASHW_ALL | FLASHW_TIMERNOFG, uint.MaxValue, 0);
return FlashWindowEx(ref fi);
}
return false;
}

/// Flash the specified Window (form) for the specified number of times
public static bool Flash(System.Windows.Forms.Form form, uint count)
{
if (Win2000OrLater)
{
FLASHWINFO fi = Create_FLASHWINFO(form.Handle, FLASHW_ALL, count, 0);
return FlashWindowEx(ref fi);
}
return false;
}

private static FLASHWINFO Create_FLASHWINFO(IntPtr handle, uint flags, uint count, uint timeout)
{
FLASHWINFO fi = new FLASHWINFO();
fi.cbSize = Convert.ToUInt32(Marshal.SizeOf(fi));
fi.hwnd = handle;
fi.dwFlags = flags;
fi.uCount = count;
fi.dwTimeout = timeout;
return fi;
}

/// helper methods
public static bool Tray(System.Windows.Forms.Form form)
{
if (Win2000OrLater)
{
FLASHWINFO fi = Create_FLASHWINFO(form.Handle, FLASHW_TRAY, uint.MaxValue, 0);
return FlashWindowEx(ref fi);
}
return false;
}

public static bool TrayAndWindow(System.Windows.Forms.Form form)
{
if (Win2000OrLater)
{
FLASHWINFO fi = Create_FLASHWINFO(form.Handle, FLASHW_ALL, uint.MaxValue, 0);
return FlashWindowEx(ref fi);
}
return false;
}

/// Stop Flashing the specified Window (form)
public static bool Stop(System.Windows.Forms.Form form)
{
if (Win2000OrLater)
{
FLASHWINFO fi = Create_FLASHWINFO(form.Handle, FLASHW_STOP, uint.MaxValue, 0);
return FlashWindowEx(ref fi);
}
return false;
}

/// A boolean value indicating whether the application is running on Windows 2000 or later.
private static bool Win2000OrLater
{
get { return System.Environment.OSVersion.Version.Major >= 5; }
}

}


Notes

https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-flashwindowex

https://www.pinvoke.net/default.aspx/user32/flashwindowex.html?diff=y

C++ Number Tree

email me
#include "stdafx.h"
#include <iostream>

using namespace std;
int main()
{
int n;
cout << "Enter number: "; cin >> n;

for (int i = 1; n>0; n--, i++)
{
for (int j = 1; j<n; j++)
cout << " ";
for (int j = 1; j<i; j++)
cout << "0";
cout << i % 10;
for (int j = 1; j<i; j++)
cout << "0";
cout << "\n";
}
cout << "\npress any key to exit...";
getchar(); getchar();
}


Output

C# – Display Triangle Patterns

email me

using System;

namespace ConsoleApp20
{
class Program
{
static void Main(string[] args)
{
const int ROWS = 5;
const int COLUMNS = 5;

Console.WriteLine(" Left to Right");
for (int i1 = 1, i2 = 1; i1 &lt; COLUMNS * 2; i1++)
{
for (int j = 1; j &lt;= i2; j++)
{
Console.Write(" *");
}

if (i1 &lt; 5)
i2++;
else
i2--;
Console.WriteLine();
}
Console.WriteLine();

Console.WriteLine(" Right to Left");
for (int i1 = 1, i2 = COLUMNS - 1, i3 = 1; i1 &lt; COLUMNS * 2; i1++)
{
for (int j = 1; j &lt;= i2; j++)
Console.Write(" ");

for (int j = 1; j &lt;= i3; j++)
Console.Write(" *");

if (i1 &lt; COLUMNS)
{
i3++;
i2--;
}
else
{
i3--;
i2++;
}
Console.WriteLine();
}
Console.WriteLine();

Console.WriteLine(" Bottom to Top");
for (int i1 = 1; i1 &lt;= ROWS; i1++)
{
for (int j = i1; j &lt; ROWS; j++)
Console.Write("  ");

for (int j = 1; j &lt;= (2 * i1 - 1); j++)
Console.Write(" *");
Console.WriteLine();
}

Console.WriteLine("\n Top to Bottom");
for (int i1 = 1; i1 &lt;= ROWS; i1++)
{
for (int j = 1; j &lt; i1; j++)
Console.Write("  ");

for (int j = 1; j &lt;= (ROWS * 2 - (2 * i1 - 1)); j++)
Console.Write(" *");

Console.WriteLine();
}
Console.WriteLine();
Console.ReadKey();
}
}
}


Output

C# – Simple Desktop Notification With Two Return Codes

email me

This creates a custom notification with two return codes. These return codes can be recorded using desktop management software, such as LANDesk or SCCM. Thus giving you the ability to notify and instantly collect responses from end-users; it provides a method to communicate with an entire fleet of machines.

It works by assigning exit values of 100 and 200 to answer buttons, whatever the user selects becomes the output value, which shows up in the description or return code column of most desktop management software. In SCCM, the value appears in description, in custom queries, and in SSRS reports.

Full Project

Compiled in Visual 2017, and tested under Windows 10.


Output

Yes = 100
No = 200


Form1.cs

using System;
using System.Drawing;
using System.Windows.Forms;

namespace WindowsFormsApp6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();

Rectangle r = Screen.PrimaryScreen.WorkingArea;
StartPosition = FormStartPosition.Manual;
Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - Width, Screen.PrimaryScreen.WorkingArea.Height - Height);
}

private void Button1_Click(object sender, EventArgs e)
{
Environment.Exit(exitCode: 100);
}

private void Button2_Click(object sender, EventArgs e)
{
Environment.Exit(exitCode: 200);
}
}
}


Form1.Designer.cs

namespace WindowsFormsApp6
{
partial class Form1
{
///

<summary>
/// Required designer variable.
/// </summary>private System.ComponentModel.IContainer components = null;

///

<summary>
/// Clean up any resources being used.
/// </summary>/// <param name="disposing">true if managed resources should be disposed; otherwise, false.
protected override void Dispose(bool disposing)
{
if (disposing  (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}

#region Windows Form Designer generated code

///

<summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>private void InitializeComponent()
{
Form1 form1 = this;
form1.button1 = new System.Windows.Forms.Button();
form1.label1 = new System.Windows.Forms.Label();
form1.button2 = new System.Windows.Forms.Button();
form1.pictureBox1 = new System.Windows.Forms.PictureBox();
form1.label2 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)form1.pictureBox1).BeginInit();
form1.SuspendLayout();
//
// button1
//
form1.button1.BackColor = System.Drawing.SystemColors.ButtonFace;
form1.button1.ForeColor = System.Drawing.SystemColors.InfoText;
form1.button1.Location = new System.Drawing.Point(76, 68);
form1.button1.Margin = new System.Windows.Forms.Padding(6);
form1.button1.Name = "button1";
form1.button1.Size = new System.Drawing.Size(88, 39);
form1.button1.TabIndex = 0;
form1.button1.Text = "Yes";
form1.button1.UseVisualStyleBackColor = false;
form1.button1.Click += new System.EventHandler(form1.Button1_Click);
//
// label1
//
form1.label1.AutoSize = true;
form1.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
form1.label1.ForeColor = System.Drawing.SystemColors.ControlText;
form1.label1.Location = new System.Drawing.Point(54, 22);
form1.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
form1.label1.Name = "label1";
form1.label1.Size = new System.Drawing.Size(243, 20);
form1.label1.TabIndex = 2;
form1.label1.Text = "Is your Chrome browser working?";
//
// button2
//
form1.button2.BackColor = System.Drawing.SystemColors.ButtonFace;
form1.button2.ForeColor = System.Drawing.SystemColors.InfoText;
form1.button2.Location = new System.Drawing.Point(184, 68);
form1.button2.Margin = new System.Windows.Forms.Padding(6);
form1.button2.Name = "button2";
form1.button2.Size = new System.Drawing.Size(88, 39);
form1.button2.TabIndex = 6;
form1.button2.Text = "No";
form1.button2.UseVisualStyleBackColor = false;
form1.button2.Click += new System.EventHandler(form1.Button2_Click);
//
// pictureBox1
//
form1.pictureBox1.Image = global::WindowsFormsApp6.Properties.Resources.google;
form1.pictureBox1.Location = new System.Drawing.Point(117, 130);
form1.pictureBox1.Name = "pictureBox1";
form1.pictureBox1.Size = new System.Drawing.Size(108, 101);
form1.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
form1.pictureBox1.TabIndex = 5;
form1.pictureBox1.TabStop = false;
//
// label2
//
form1.label2.AutoSize = true;
form1.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
form1.label2.ForeColor = System.Drawing.SystemColors.ControlText;
form1.label2.Location = new System.Drawing.Point(108, 246);
form1.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
form1.label2.Name = "label2";
form1.label2.Size = new System.Drawing.Size(127, 13);
form1.label2.TabIndex = 7;
form1.label2.Text = "Commlink Industries 2019";
//
// Form1
//
form1.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
form1.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
form1.BackColor = System.Drawing.SystemColors.ButtonHighlight;
form1.ClientSize = new System.Drawing.Size(340, 274);
form1.ControlBox = false;
form1.Controls.Add(form1.label2);
form1.Controls.Add(form1.button2);
form1.Controls.Add(form1.pictureBox1);
form1.Controls.Add(form1.button1);
form1.Controls.Add(form1.label1);
form1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
form1.ForeColor = System.Drawing.SystemColors.Window;
form1.Margin = new System.Windows.Forms.Padding(6);
form1.MaximizeBox = false;
form1.MinimizeBox = false;
form1.Name = "Form1";
form1.Opacity = 0.8D;
form1.ShowIcon = false;
form1.ShowInTaskbar = false;
form1.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
form1.Text = "Notification";
form1.TopMost = true;
((System.ComponentModel.ISupportInitialize)form1.pictureBox1).EndInit();
form1.ResumeLayout(false);
form1.PerformLayout();

}

#endregion

private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label label2;
}
}


Program.cs

using System;
using System.Windows.Forms;

namespace WindowsFormsApp6
{
static class Program
{
///

<summary>
/// The main entry point for the application.
/// </summary>[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

 

Notes

SCCM WQL Query

select sys.Name, sys.LastLogonUserName, offer.LastExecutionResult, sys.ResourceDomainORWorkgroup from sms_r_system as sys inner join SMS_ClientAdvertisementStatus as offer on sys.ResourceID=offer.ResourceID WHERE AdvertisementID = ‘ABC10589’ and (LastStateName = “Failed”)
SCCM Reporting

 

Launch a website with button

// the button event
private void Button1_Click(object sender, EventArgs e)
{
// launch the webpage
Process.Start("https://google.com");

// the return code, which is recorded in SCCM
Environment.Exit(exitCode: 100);
}

 

Handling a timed, async event

// the button event
private async void Button2_Click_1(object sender, EventArgs e)
{

// minimizes to taskbar
WindowState = FormWindowState.Minimized;

// waits for delay before continuing
await Task.Delay(30000);

// do this after delay
WindowState = FormWindowState.Normal;
}

 

Do not show if specific process is running

public async void CheckProcess()
{
Process[] pname = Process.GetProcessesByName("notepad"); //presentationsettings
if (pname.Length == 0)
WindowState = FormWindowState.Normal;
else
WindowState = FormWindowState.Minimized;
await Task.Delay(10000);      // 10 sec
//await Task.Delay(3600000);  // 1 hour
CheckProcess();
}

 

More Advanced CheckProcess

This will check for specific running apps. If the apps are running, hide notification.

public async void CheckProcess()
{
do
{
bool ScanTitles = false;
bool sTitles = ScanTitles;

Process[] processlist = Process.GetProcesses();
foreach (Process process in processlist)
{
if (!String.IsNullOrEmpty(process.MainWindowTitle))
{
string str = process.MainWindowTitle;
if (str.Contains("Meet")) { sTitles = true; } // Google Hangouts
}
}

ScanTitles = sTitles;
//MessageBox.Show(ScanTitles.ToString());

Process[] pname1 = Process.GetProcessesByName("presentationsettings");  // presentationsettings(presentation mode)
Process[] pname2 = Process.GetProcessesByName("POWERPNT"); // powerpoint
if (pname1.Length == 0  pname2.Length == 0  ScanTitles == false)
{
Show();
}
else
Hide();
await Task.Delay(1000);      // 1 sec

} while (true);

}

 

How I got the Notify Icon to work

Form1.Designer.cs

// notifyIcon1
//
this.notifyIcon1.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info;
this.notifyIcon1.BalloonTipText = "Technology Notification";
this.notifyIcon1.BalloonTipTitle = "Notification";
this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
this.notifyIcon1.Text = "You have a notification!";
this.notifyIcon1.Visible = true;
this.notifyIcon1.Click += new System.EventHandler(this.NotifyIcon1_Click);

Form1.cs

notifyIcon1.Visible = true;

The Event

private void NotifyIcon1_Click(object sender, System.EventArgs e)
{
notifyIcon1.Visible = false;
Show();
WindowState = FormWindowState.Normal;
}