Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo die Damen und Herren,

Folgendes Problem hat sich mir ergeben. Ich habe mir einen neuen Process angelegt, der eine .exe startet. Allerdings wird diese .exe irgendwie im Hintergrund meines Programms angezeigt und ist so für den Benutzer schwer zu finden. Der schlaue Herr Google hat mir verraten, dass man dieses Problem irgendwie mit der user32.dll beheben kann. Allerdings kommt mir das ein wenig umständlich vor und deswegen wollte ich hier einfach mal nachfragen ob jemand eine einfachere Lösung parat hat.


Process myProcess = new Process();

myProcess.StartInfo.FileName = param.SetupPath;

     if (!String.IsNullOrEmpty(param.SetupParams))

        {                                      

          myProcess.StartInfo.Arguments = param.SetupParams;

        }

myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal;

myProcess.Start();

// irgendwie hier hab ich mir vorgestellt das Fenster von dem Prozess nach vorne zu bringen.

myProcess.WaitForExit();

Wäre echt nett wenn mir jemand da ein kleines Beispiel zeigen könnte.

Wünsche noch einen schönen Tag :)

ich habs gefunden =) danke

ich habs gefunden =) danke

Hast du nun eins der beiden Posts oben benutzt ?

Oder eine andere möglichkeit gefunden ?

Schön wäre, wenn du uns dies noch mitteilen könntest.

Ist immer besser, falls jemand mal danach sucht,

bringt ihm dein "ich habs gefunden" leider nix...

Danke dir !

oh du hast natürlich recht =) sorry xD

Ich habe den Rat von Guybrush Threewood befolgt und die Windows API benutzt. Eine andere Lösung habe ich nicht gefunden.

Die Methode heisst SetForegroundWindow

Das Beispiel was Guybrush gepostet hat, hat mir sehr geholfen. Danke an der Stelle nochmal ;)

Hier das Beispiel :

[DllImport("user32.dll")]

[return: MarshalAs(UnmanagedType.Bool)]

static extern bool SetForegroundWindow(IntPtr hWnd);

public static void Main(string[] args)

{

// test code here...

CheckAutFocus(myProcess.MainWindowHandle);

// more test code...

}

public static void CheckAutFocus(hWnd)

{

if (GetForegroundWindow() != hWnd)

{

SetForegroundWindow(hWnd);

}

}

Der Code ist von http://www.pinvoke.net/default.aspx/user32/SetForegroundWindow.html copiert

Bearbeitet von Dessou

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.