Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Betriebssysteme (https://www.delphipraxis.net/27-betriebssysteme/)
-   -   Konsolenapplikation mit Windows starten, aber bevor Windows hochgefahren wurde (https://www.delphipraxis.net/190544-konsolenapplikation-mit-windows-starten-aber-bevor-windows-hochgefahren-wurde.html)

devidespe 14. Okt 2016 12:23

Betriebssystem: Win XP,Win Vista,Win 7,Win 8,Win 8.1,Win 10

Konsolenapplikation mit Windows starten, aber bevor Windows hochgefahren wurde
 
Hallo zusammen,

ich habe eine harmlose Konsolenanwendung geschrieben, welche die Größe des Arbeitsspeichers ermittelt und anzeigt, gefolgt von einem "pause", so dass der Anwender das bestätigen muss. Soweit erstmal so gut.

Nun möchte ich das Programm aber beim Windows-Start automatisch starten lassen, aber nicht sobald Windows fertig hochgefahren wurde, sondern direkt am Anfang sobald das Windows-Logo erscheint. Ich meine diejenige Stelle, wo CHKDSK ausgeführt wird, wenn Windows nicht korrekt heruntergefahren wurde oder wo auch einige Low-Level-Programme (z.B. zum Löschen von Datenträgern oder Image-Lösungen) von den Herstellern geladen werden.

Weiß jemand, wo ich hierzu weitere Informationen herbekomme bzw. wie ich das Programm dort hinein bekomme?

Danke vorab.

Der schöne Günther 14. Okt 2016 12:31

AW: Konsolenapplikation mit Windows starten, aber bevor Windows hochgefahren wurde
 
Irgendwie habe ich grade einen Flashback an Windows 98-Zeiten als Windows noch auf DOS aufbaute. So mit Autoexec.bat und all dem. So etwas gibt es doch seit Windows NT nicht mehr?

Vor allem: Was soll das bezwecken?

bra 14. Okt 2016 12:52

AW: Konsolenapplikation mit Windows starten, aber bevor Windows hochgefahren wurde
 
Funktionieren muss es irgendwie, weil auch einige Partitioniertungstools direkt am Anfang des Windowsstarts geladen werden. Wie genau das allerdings geht weiss ich auch nicht :oops:

himitsu 14. Okt 2016 12:57

AW: Konsolenapplikation mit Windows starten, aber bevor Windows hochgefahren wurde
 
Mit Delphi NEIN.

Da vorne steht die Win32-API nicht zur Verfügung, auf welcher Delphi aufsetzt.
Du mußt dafür eine "Native Application" schreiben.

Delphi erzeugt eine "User Mode Application" welche auf der "Windows Base API" ab der Kernel32.dll aufsetzen.
Eine "Native Application" setzt auf der "Windows Native API" der NTDLL.dll auf.
Wenn man ganz hart drauf ist, dann geht man direkt auf den "Windows Hardware Abstraction Layer" der HAL.dll und schreibt Kernel-Mode-Anwendungen (z.B. Treiber)
und die richtig Harten, wenden sich direkt an die Hartware.

t.roller 14. Okt 2016 13:02

AW: Konsolenapplikation mit Windows starten, aber bevor Windows hochgefahren wurde
 
Userinit - Specifies the programs that Winlogon runs when a user logs on.

Zitat:
By default, Winlogon runs Userinit.exe, which runs logon scripts, reestablishes network connections, and then starts Explorer.exe, the Windows user interface.

You can change the value of this entry to add or remove programs. For example, to have a program run before the Windows Explorer user interface starts, substitute the name of that program for Userinit.exe in the value of this entry (HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon), then include instructions in that program to start Userinit.exe. You might also want to substitute Explorer.exe for Userinit.exe if you are working offline and are not using logon scripts.

Luckie 14. Okt 2016 13:47

AW: Konsolenapplikation mit Windows starten, aber bevor Windows hochgefahren wurde
 
Das wird ihm schon zu spät sein.

Davon unabhängig dass die keine API zur Verfügung steht, bist du auch noch selbst für die Bildschirmausgabe verantwortlich. Da ist nichts mit DrawText oder Writeln.

Darf man nach dem Sinn und Zweck fragen?

himitsu 14. Okt 2016 15:08

AW: Konsolenapplikation mit Windows starten, aber bevor Windows hochgefahren wurde
 
Zitat:

Zitat von Luckie (Beitrag 1350886)
bist du auch noch selbst für die Bildschirmausgabe verantwortlich. Da ist nichts mit DrawText oder Writeln.

Jupp, GDI ist halt Win32-API :stupid:
Das Speichermanagement darf man och sleber machen (z.B. RTL Heap API ... VirtualAlloc ist ja och Win32-API)

Ich hatte mir da mal 'ne kurze Windows-API-Übersicht gebastelt.
Ist nur 'nen kleiner Ausschnitt und schon hier kann man das Meiste gleich wieder vergessen, wenn man so früh laufen will.
Code:
  Internal
    HAL.dll        Windows Hardware Abstraction Layer      Kernel-Mode: for Drivers (access to CPU, Chipset, APCI, ...)
                                                               Advanced Programmable Interrupt Controller (APIC)
    NTDLL.dll      Windows Native API                      User-Mode: for Native Applications (run at boot time)

  Win32 API
    Kernel32.dll   Windows Base API                        for User Mode Applications (memory management, input/output, process/thread creation and synchronization)
    AdvAPI32.dll   Advanced Windows Base API               Registry, Windows Services, Windows Management Instrumentation Driver Extensions (WMI)
    GDI.dll        Graphics Device Interface (GDI)         low-level drawing functions for output to video displays and printers
    User32.dll     Windows User Component                  Graphical User Interface (GUI)
    ComDlg32.dll   Common Dialog Box Library               dialogs
    ComCtl32.dll   Common Control Library                  file dialogs, progress bars, list views, ...
    Shell32.dll    Windows Shell API                       access to operating system shell
    ShLWAPI.dll    Shell Lightweight Utility Functions     -
    WS2_32.dll     Winsock API                             TCP/IP networking functions
    NetAPI32.dll   Network API                             NetBIOS, Winsock, NetDDE, remote procedure call (RPC)

  Other API
    WinMM.dll      Windows Multimedia Audio API
    ShDocVw.dll    Embeddable Web Browser Control (IE)     Trident ActiveX Control
    MSHTML.dll     Windows HTML View (IE)                  Trident Layout Engine
    URLMon.dll     URL moniker service (IE)                own URL handlers for other application
    WinINet.dll    HTTP client library (IE)                which also takes into account system-wide Proxy settings
    WinHTTP.dll    HTTP client library (IE)                smaller and more suitable for some applications
    MSXML*.dll     Microsoft XML Components                XML DOM classes (document object model)
    MLang.dll      Multi-Language                          international text support

  Runtime Library
    MSVCRT.dll     Microsoft Visual C run-time Library     string manipulation, memory allocation, C-style input/output calls
    MSVCP60.dll    Microsoft Visual C++ Library (v6.0)     same as MSVCRT.dll for Microsoft Visual C++ (MSVC)
    MSVCIRT.DLL    Microsoft Visual C++ run-time (iostream)
    CCRUNTIME*.DLL Microsoft Visual C++ run-time (v14.0)
    CRTDLL.dll     C run-time library
    ATL*.dll       Active Template Library                 base classes for COM/OLE/ActiveX objects
    MFC*.dll       Microsoft Foundation Classes Library    wraps WinAPI as C++ classes
    MSVBVM*.dll    Visual Basic Virtual Machine
    VCOMP*.dll     Microsoft C/C++ OpenMP runtime          Open Multi-Processing


Alle Zeitangaben in WEZ +1. Es ist jetzt 19:13 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz