vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
NEU! sevCoolbar 3.0 - Professionelle Toolbars im modernen Design!  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2024
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

VB & Windows API
Re: VBA Access Desktoplocking Programm 
Autor: Zupa
Datum: 07.01.12 18:10

2) CreateProcess soll entweder eine temporäre DB (während Runtime erzeugt) öffnen oder eine Batch-datei, die genau das übernimmt (Schema: CreateProcess "cmd.exe", "/c " & Batchdatei, ...). CreateProcess gibt mir auch wunderbare Handles aus, aber nichts passiert. (Es erscheint noch nicht mal im Taskmanager)
'Modul:
Option Explicit
 
'API Deklarationen
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
Private Declare Function CreateDesktop Lib "user32" Alias "CreateDesktopA" ( _
  ByVal lpszDesktop As Long, ByVal lpszDevice As Long, pDevmode As Any, ByVal _
  dwFlags As Long, ByVal dwDesiredAccess As Long, lpsa As Any) As Long
Private Declare Function SwitchDesktop Lib "user32" (ByVal hDesktop As Long) As _
Long
Private Declare Function GetThreadDesktop Lib "user32" (ByVal dwThread As Long) _
As Long
Private Declare Function GetCurrentThreadId Lib "kernel32" () As Long
Private Declare Function GetCurrentThread Lib "kernel32" () As Long
Private Declare Function OpenInputDesktop Lib "user32" (ByVal dwFlags As Long, _
  ByVal fInherit As Boolean, ByVal dwDesiredAccess As Long) As Long
Private Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" ( _
ByVal lpApplicationName As String, ByVal lpCommandLine As String, _
lpProcessAttributes As Any, lpThreadAttributes As Any, ByVal hInheritHandles As _
Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal _
lpCurrentDirectory As String, lpStartupInfo As STARTUPINFO, _
lpProcessInformation As PROCESS_INFORMATION) As Long
Private Declare Function CloseDesktop Lib "user32" (ByVal hDesktop As Long) As _
Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As _
Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As _
Long, ByVal dwMilliseconds As Long) As Long
'Hoffentlich nicht benötigt...
'Private Declare Function OpenProcessToken Lib "advapi32" (ByVal ProcessHandle 
' As Long, ByVal DesiredAccess As Long, TokenHandle As Long) As Long
'Private Declare Function LookupPrivilegeValue Lib "advapi32" Alias 
' "LookupPrivilegeValueA" (ByVal lpSystemName As String, ByVal lpName As 
' String, lpLuid As LUID) As Long
'Private Declare Function AdjustTokenPrivileges Lib "advapi32" (ByVal 
' TokenHandle As Long, ByVal DisableAllPrivileges As Long, NewState As 
' TOKEN_PRIVILEGES, ByVal BufferLength As Long, PreviousState As 
' TOKEN_PRIVILEGES, ReturnLength As Long) As Long
 
'Konstanten
Private Const NORMAL_PRIORITY_CLASS = &H20&
Private Const HIGH_PRIORITY_CLASS = &H80&
Private Const INFINITE = -1&
Private Const STARTF_USESHOWWINDOW& = &H1
'Hoffentlich nicht benötigt:
Private Const DACL_SECURITY_INFORMATION = &H4
 
'Typen
Private Enum DESKTOP_ACCESS_MASK
DESKTOP_DELETE = &H10000
DESKTOP_WRITE_DAC = &H40000
DESKTOP_WRITE_OWNER = &H80000
DESKTOP_NONE = 0
DESKTOP_READOBJECTS = &H1
DESKTOP_CREATEWINDOW = &H2
DESKTOP_CREATEMENU = &H4
DESKTOP_HOOKCONTROL = &H8
DESKTOP_JOURNALEDRECORD = &H10
DESKTOP_JOURNALEDPLAYBACK = &H20
DESKTOP_ENUMERATE = &H40
DESKTOP_WRITEOBJECTS = &H80
DESKTOP_SWITCHDESKTOP = &H100
GENERIC_ALL = (DESKTOP_DELETE Or DESKTOP_WRITE_DAC Or DESKTOP_WRITE_OWNER Or _
  DESKTOP_READOBJECTS Or DESKTOP_CREATEWINDOW Or DESKTOP_CREATEMENU Or _
  DESKTOP_HOOKCONTROL Or DESKTOP_JOURNALEDRECORD Or DESKTOP_JOURNALEDPLAYBACK _
  Or DESKTOP_ENUMERATE Or DESKTOP_WRITEOBJECTS Or DESKTOP_SWITCHDESKTOP)
GENERIC_SPECIFIC = (DESKTOP_CREATEWINDOW Or DESKTOP_SWITCHDESKTOP)
End Enum
 
 
Private Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessId As Long
dwThreadId As Long
End Type
 
Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As Long
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
 
Private Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Long
End Type
 
Private Enum enSW
SW_HIDE = 0
SW_NORMAL = 1
SW_MAXIMIZE = 3
SW_MINIMIZE = 6
End Enum
 
'Hoffentlich nicht benötig:
Private Type LUID
UsedPart As Long
IgnoredForNowHigh32BitPart As Long
End Type
 
Private Type TOKEN_PRIVILEGES
PrivilegeCount As Long
TheLuid As LUID
Attributes As Long
End Type
 
'Variablen
Private D As Long 'DesktopHandle
Private oldDT As Long 'oldDesktopThreadHandle
Private oldDI As Long 'oldInputDesktopHandle
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
VBA Access Desktoplocking Programm4.281Zupa07.01.12 18:05
Re: VBA Access Desktoplocking Programm3.206Zupa07.01.12 18:06
Re: VBA Access Desktoplocking Programm2.514Zupa07.01.12 18:09
Re: VBA Access Desktoplocking Programm2.622Zupa07.01.12 18:10
Re: VBA Access Desktoplocking Programm2.573Zupa07.01.12 18:12
Re: VBA Access Desktoplocking Programm2.654Zupa07.01.12 18:12
Re: VBA Access Desktoplocking Programm2.563Franki08.01.12 20:22
Re: VBA Access Desktoplocking Programm2.474Zupa09.01.12 17:37
Re: VBA Access Desktoplocking Programm2.612Franki10.01.12 00:05
Re: VBA Access Desktoplocking Programm2.662Zupa10.01.12 17:04

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2024 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel