Tipp 3.10 - Betriebssystemdialoge
Wie kann ich verschiedene Betriebssystemdialoge aufrufen?
Mit dieser Funktion können Sie verschiedene Betriebssystemdialoge aufrufen. Kopieren Sie einfach nachfolgenden Quellcode in die Zwischenablage und fügen Sie anschließend den Inhalt der Zwischenablage in ein neues Modul ein. Die Aufrufparameter finden Sie im Quellcode beschrieben.
Beispiel:
Option Explicit '// ----------------------------------------------------- '// Verschiedene Betriebssystemdialoge aufrufen; '// je nach Betriebssystem werden unterschiedliche '// Dialoge angezeigt! '// ----------------------------------------------------- '// Methode |Dialog '// ----------------------------------------------------- '// RunDlg_FormatDisk |Formatieren von Disketten '// ----------------------------------------------------- '// RunDlg_Diskcopy |Kopieren von Disketten '// ----------------------------------------------------- '// RunDlg_CreateStartDisk |Erst. einer Startdiskette '// ----------------------------------------------------- '// RunDlg_Printer |Einrichten der Drucker '// ----------------------------------------------------- '// RunDlg_SetupScreenSaver |Einr. des Bildschirmschoners '// ----------------------------------------------------- '// RunDlg_SetupDateTime |Einstellen von Datum/Uhrzeit '// ----------------------------------------------------- '// RunDlg_ControlPanel |Systemeinstellungsdialog '// ----------------------------------------------------- '// RunDlg_DisplaySettings |Einstellen der Ansicht '// ----------------------------------------------------- '// RunDlg_GlobalSettings |Benutzerprofile (NT) '// ----------------------------------------------------- '// RunDlg_DeviceManager |Netzwerkeinstellungen (NT) '// ----------------------------------------------------- '// RunDlg_SystemSettings |allg. Systemeingenschaften '// ----------------------------------------------------- '// RunDlg_AudioSettings |Systemklänge '// ----------------------------------------------------- '// Autor: | Stefan Kulpa '// | EDV Innovation & Consulting '// | Dormagen '// ----------------------------------------------------- Public Sub RunDlg_FormatDisk() Const csCMD As String = _ "rundll32.exe shell32.dll,SHFormatDrive" Call Shell(csCMD, vbNormalFocus) End Sub Public Sub RunDlg_Diskcopy() Const csCMD As String = _ "rundll32.exe diskcopy.dll,DiskCopyRunDll" Call Shell(csCMD, vbNormalFocus) End Sub Public Sub RunDlg_CreateStartDisk() '// Achtung: funktioniert nicht unter NT! Const csCMD As String = _ "rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,3" Call Shell(csCMD, vbNormalFocus) End Sub Public Sub RunDlg_Printer() Const csCMD As String = _ "rundll32.exe shell32.dll,Control_RunDLL main.cpl @2" Call Shell(csCMD, vbNormalFocus) End Sub Public Sub RunDlg_SetupScreenSaver() Const csCMD As String = _ "rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1" Call Shell(csCMD, vbNormalFocus) End Sub Public Sub RunDlg_SetupDateTime() Const csCMD As String = _ "rundll32.exe shell32.dll,Control_RunDLL timedate.cpl" Call Shell(csCMD, vbNormalFocus) End Sub Public Sub RunDlg_ControlPanel() Const csCMD As String = _ "rundll32.exe shell32.dll,Control_RunDLL" Call Shell(csCMD, vbNormalFocus) End Sub Public Sub RunDlg_DisplaySettings() Const csCMD As String = _ "rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,3" Call Shell(csCMD, vbNormalFocus) End Sub Public Sub RunDlg_GlobalSettings() Const csCMD As String = _ "rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,3" Call Shell(csCMD, vbNormalFocus) End Sub Public Sub RunDlg_DeviceManager() Const csCMD As String = _ "rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,1" Call Shell(csCMD, vbNormalFocus) End Sub Public Sub RunDlg_SystemSettings() Const csCMD As String = _ "rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,0" Call Shell(csCMD, vbNormalFocus) End Sub Public Sub RunDlg_AudioSettings() Const csCMD As String = _ "rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl @1" Call Shell(csCMD, vbNormalFocus) End Sub