AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Projekte Manifest-Creator
Thema durchsuchen
Ansicht
Themen-Optionen

Manifest-Creator

Ein Thema von himitsu · begonnen am 2. Sep 2009 · letzter Beitrag vom 26. Dez 2015
 
hathor
(Gast)

n/a Beiträge
 
#21

AW: Manifest-Creator

  Alt 10. Nov 2013, 13:01
Mit level="requireAdministrator" und WIN 8.0 funktioniert es sehr gut -
VIELEN DANK!

Eine Frage habe ich:
Wenn ein bereits gestartetes Programm minimiert ist und mit folgendem Code wieder angezeigt wird, statt es zum 2.Mal zu starten, ist es eigentlich unnötig, dass die Benutzerkontensteuerung aufpoppt - lässt sich das ändern?

Delphi-Quellcode:
program MyProg;

uses
  Forms, Windows, SysUtils,
  Unit1 in 'Unit1.pas{Form1};

{$R *.res}

procedure SwitchToThisWindow(h1: hWnd; x: bool); stdcall; external user32 Name
'SwitchToThisWindow'; {x = false: Size unchanged, x = true: normal size}

var
  hMutex: Cardinal;
  PreviousHandle : THandle;

BEGIN
  hMutex := CreateMutex(nil, True, PChar(UpperCase(ExtractFileName(ParamStr(0)))));
  if GetLastError = ERROR_ALREADY_EXISTS then
  begin
  PreviousHandle := Windows.FindWindow(NIL,PChar(UpperCase(ExtractFileName(ParamStr(0)))));
    if Windows.IsIconic(PreviousHandle) then
                Windows.ShowWindow(PreviousHandle, SW_RESTORE);
    SwitchToThisWindow(PreviousHandle, TRUE);
    SetForegroundWindow(PreviousHandle);
    SetWindowPos(PreviousHandle,
                HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_SHOWWINDOW);
  end else
  begin
    Application.Initialize;
    Application.MainFormOnTaskbar := True;
    Application.CreateForm(TForm1, Form1);
    Application.Run;
  end;
end.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

(?)

LinkBack to this Thread

Erstellt von For Type Datum
Manifest ? BytecoreWiki This thread Refback 4. Aug 2010 18:08

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:14 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz