Remote Desktop Shortcuts

Remote Desktop has some really handy shortcuts that are documented right there in the help file:

Shortcut key Description
ALT+PAGE UP Switches between programs from left to right.
ALT+PAGE DOWN Switches between programs from right to left.
ALT+INSERT Cycles through the programs in the order they were started.
ALT+HOME Displays the Start menu.
CTRL+ALT+BREAK Switches the client between a window and full screen.
CTRL+ALT+END Brings up the Windows Security dialog box.
ALT+DELETE Displays the Windows menu.
CTRL+ALT+Minus (-) symbol on the numeric keypad Places a snapshot of the active window, within the client, on the Terminal server clipboard (provides the same functionality as pressing PrintScrn on a local computer.)
CTRL+ALT+Plus (+) symbol on the numeric keypad Places a snapshot of the entire client window area on the Terminal server clipboard (provides the same functionality as pressing ALT+PrintScrn on a local computer.)

courtesy : Mike Wilbur’s Blog

Preventing multiple instance of an Application

Hi,

.Net framework’s System.Threading namespace provides Mutex class which is a synchronization primitive that can also be used for interprocess synchronization. Using this mutex object we can also control running of multiple instances of a same application. Here is the sample code to do that. The code should be wriiten on the starting point of the application obviously for a windows or console application it would be the Main() function.

static class Program
{
///<summary>
/// The main entry point for the application.
///</summary>
[STAThread]
static void Main()
{
bool instanceCountOne = false;
using (Mutex mtex = new Mutex(true, “MyRunningApp”, out instanceCountOne))
{
if (instanceCountOne)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
mtex.ReleaseMutex();
}
else
{
MessageBox.Show(“An application instance is already running”);
}
}
}
}

Note: Replace the application name with your corresponding application name. Include the namespace System.Threading.

Happy coding…

yenkay

Finding Start and End Dates of Previous Week

private void GetDates(ref System.DateTime stDate, ref System.DateTime endDate)
{
double offset = 0;
switch (System.DateTime.Today.DayOfWeek)
{
case DayOfWeek.Monday:
offset = 0;
break;
case DayOfWeek.Tuesday:
offset = -1;
break;
case DayOfWeek.Wednesday:
offset = -2;
break;
case DayOfWeek.Thursday:
offset = -3;
break;
case DayOfWeek.Friday:
offset = -4;
break;
case DayOfWeek.Saturday:
offset = -5;
break;
case DayOfWeek.Sunday:
offset = -6;
break;
}
endDate = System.DateTime.Today.AddDays(offset);
stDate = System.DateTime.Today.AddDays(-7 + offset);
}

courtesy : http://www.knowdotnet.com/articles/getpreviousmonday.html