Sorry, we found 0 results. Please try another query.
Showing max 10 of results

Windows 7: Open a new Form from the Jumplist

With the Windows API Code Pack, Microsoft released a really cool managed wrapper for most of the new Windows 7 features. See here for more details and download.

One thing you can do is to create a .NET app with Jumplist support. Jumplists are these cool menus appearing on right click on an icon in the task bar:

image

But there is something wrong with the jumplist: It can only launch new apps! The demo solution for the Code Pack launches notepad and some other things, but there is no word about how to open the same app but with a new form.

So here is my solution, which is not very nice, but it works like a charm.

Scencario:
AppInstance1 is running –> click on a jumplist item starts a new instance –> appInstance2 now knows, that this is the second instance, so appInstance2 calls appInstance1 through remoting (IPC) and terminates–> appInstance1 receives the remoting call und execute something.

Ok, how to implement this?

First of all, create a new Windows Forms app and go to the Program.cs file. Within this class create a new class which works as your service for the remoting part and also a static reference to your form:

static class Program
    {
        public class RemotingService : MarshalByRefObject
        {
            public RemotingService() { }

            public void ShowText(string text)
            {
                Program.formMain.SetTextToTextBox(text);
            }
        }

        internal static Form1 formMain;

Then you will need some remoting code for the communication. I created two methods “InitRemoting” and “CallRunningInstance”. InitRemoting is called from the main method if this is the first instance. CallRunningInstance is called if the main method detects, that this is the second instance.

For the detection I use a system wide mutex.

I hope you get the idea. Because there are some more lines of code I created a demo project for you to download:

 Download the entire working demo solution here.

 

Proxy Switcher 1.5 – Feature Preview

Hier gibt es heute schon mal eine kleine Vorschau auf die nächste Version.

Nach vielen Mails und Kommentaren wurden hoffentlich die meisten Wünsche weitestgehend erfüllt.

Zu den Neuerungen gehören:

  • Vollständige Integration in Windows 7, inklusive Jumplist support

  • image* Internet Explorer 8 support und damit auch unterstützung für Wählverbindungen

  • Standard Drucker wechseln

  • image* Scripting

  • Script kann nun mit dem proxy namen als Parameter aufgerufen werden

  • Beim deaktivieren der proxies kann nun ebenfalls ein script aufgerufen werden* Click-Once Anwendung. Damit gibt es automatische updates ohne Installation

 

Es ist natürlich weiterhin Zeit für Anregungen, Wünsche und Kommentare.
Als Release Termin für die Version 1.5 plane ich aktuell Ende Juni.

Browser Selector

UPDATE:

You can download the sources from https://github.com/mwiedemeyer/browserselector

 

Today I have created a little tool. I called it “Browser Selector”. It is for all people who uses more than one browser.

My scenario:

I’m using Opera and Internet Explorer. Opera for daily browsing and Internet Explorer for all Microsoft sites and for the company intranet.

Browser Selector now helps to avoid copy&paste url’s in one of the browsers depending on the url. Instead I can click directly on each url from all applications (Outlook, MSN Messenger, etc) or even enter the url in the start menu and it opens automatically in the correct browser!

Configuration:

To configure, which url will be opened in which browser, there is a config.xml file:

<?xml version="1.0" encoding="utf-8" ?>
<BrowserSelector>
  <Rules>
    <Rule Url="microsoft.com" Browser="IE" />
    <Rule Url="live.com" Browser="IE" />
  </Rules>
  <Browsers>
    <Browser Name="Opera" Path="C:\Program Files (x86)\Opera\opera.exe" Default="true" />
    <Browser Name="IE" Path="C:\Program Files (x86)\Internet Explorer\iexplore.exe" />
  </Browsers>
</BrowserSelector>

 

There you see a Rules section. In the Url attribute you can use regular expressions as well.
In the Browsers section you define all of your browsers and mark one as default which will be used if no rule matches.

Now download the msi, install it and configure it as you like. It is well tested with Windows 7 RC.

If you have any questions, problems or suggestions, write a comment.

Proxy Switcher v1.3.1

! ENGLISH VERSION BELOW !

Auf Anfrage eines freundlichen Nutzers gibt es ab sofort eine neue Auto Switch Funktion: “Adapter Description contains”.

Um ein klein wenig “Dokumentation” hinzuzufügen, hier ein Überblick über die verfügbaren Auto Switch Funktionen:

  • Adapter Description contains

  • Diese Funktion ermöglicht das wechseln des Proxies, sobald ein Netzwerk Adapter verfügbar wird, der den angegebenen Text enthält.
    Damit ist es möglich, einen proxy zu aktivieren, sobald z.B. eine UMTS Verbindung hergestellt wird. Den Namen des Adapters findet man raus, in dem man die Liste durchschaut, die Windows einem liefert, wenn man folgendes auf der Kommandozeile eingibt (ohne anführungszeichen): “ipconfig /all”
    Dort ausschau halten nach “Beschreibung: MeinUMTSAdapter”* DNS Suffix contains

  • Diese Funktion ermöglicht das wechseln des Proxies, sobald eine Netzwerkverbindung existiert, die als DNS suffix den angegebenen Text enthält. Dies ist z.B. in Firmennetzwerken sinnvoll. Auch hier liefert “ipconfig /all” die aktuellen DNS suffixe.* Gateway contains

  • Diese Funktion ermöglicht das wechseln des Proxies, sobald eine Netzwerkverbindung existiert, die als Gateway Adresse den angegebenen Text enthält. Auch hier liefert “ipconfig /all” die aktuellen Gateway Adressen.* WLAN SSID contains

Proxy Switcher wurde erfolgreich mit Windows XP, Windows Vista und Windows 7 getestet.

DOWNLOAD HIER


Here is now some “documentation” about the available auto switching methods.

  • Adapter Description contains

  • This function allows switching the proxy, if a network adapter becomes available which contains the specified text as the description.
    So from now on, it is possible for example to activate a proxy for a UMTS connection. Search for the “Description: AdapterName” after executing “ipconfig /all” in a command line.* DNS Suffix contains

  • This function allows switching the proxy, if a network connection with the specified DNS suffix becomes available. See “ipconfig /all” for the current DNS suffixes.* Gateway contains

  • This function allows switching the proxy, if a network connection with the specified gateway address becomes available. See “ipconfig /all” for the current gateway addresses.* WLAN SSID contains

Proxy Switcher was successfully tested with Windows XP, Windows Vista and Windows 7.

DOWNLOAD HERE