Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
Privacywetgeving
Het is bij Helpmij.nl niet toegestaan om persoonsgegevens in een voorbeeld te plaatsen. Alle voorbeelden die persoonsgegevens bevatten zullen zonder opgaaf van reden verwijderd worden. In de vraag zal specifiek vermeld moeten worden dat het om fictieve namen gaat.
#If Win64 Then
Private Declare PtrSafe Function RegOpenKeyEx Lib "advapi32" _
Alias "RegOpenKeyExA" ( _
ByVal hKey As LongPtr, _
ByVal lpSubKey As String, _
ByVal ulOptions As Long, _
ByVal samDesired As Long, _
phkResult As Long) As LongPtr
Private Declare PtrSafe Function RegEnumValue Lib "advapi32.dll" _
Alias "RegEnumValueA" ( _
ByVal hKey As Long, _
ByVal dwIndex As Long, _
ByVal lpValueName As String, _
lpcbValueName As Long, _
ByVal lpReserved As Long, _
lpType As Long, _
lpData As Byte, _
lpcbData As Long) As Long
Private Declare PtrSafe Function RegCloseKey Lib "advapi32.dll" ( _
ByVal hKey As LongPtr) As Long
#Else
Private Declare Function RegOpenKeyEx Lib "advapi32" _
Alias "RegOpenKeyExA" ( _
ByVal HKey As Long, _
ByVal lpSubKey As String, _
ByVal ulOptions As Long, _
ByVal samDesired As Long, _
phkResult As Long) As Long
Private Declare Function RegEnumValue Lib "advapi32.dll" _
Alias "RegEnumValueA" ( _
ByVal HKey As Long, _
ByVal dwIndex As Long, _
ByVal lpValueName As String, _
lpcbValueName As Long, _
ByVal lpReserved As Long, _
lpType As Long, _
lpData As Byte, _
lpcbData As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" ( _
ByVal HKey As Long) As Long
#End If
#If Win64 Then
Dim hKey As LongPtr ' registry key handle
#Else
Dim hKey As Long ' registry key handle
#End If
Sub M_snb_printers()
Application.Dialogs(9).Show
c00 = "Activeprinter:" & vbTab & ActivePrinter & vbLf
With CreateObject("Wscript.network")
For j = 0 To .EnumPrinterConnections.Count - 1 Step 2
c00 = c00 & vbLf & .EnumPrinterConnections(j + 1) & " on " & .EnumPrinterConnections(j)
Next
End With
MsgBox c00
End Sub
Daar heb je gelijk in, ik bedoel dan ook, als het niet nodig is, niet gebruiken.Ik zou niet weten waarom zonder API's altijd beter is. Het ligt aan je eisen en wensen zou ik zeggen.
Sub M_snb_printer_poort()
Set Sh = CreateObject("wscript.shell")
c00 = "HKCU\software\Microsoft\Windows NT\Currentversion\Devices\"
With CreateObject("Wscript.network")
For j = 1 To .EnumPrinterConnections.Count Step 2
pr = .EnumPrinterConnections(j)
c01 = c01 & vbLf & pr & " on " & Replace(Sh.regread(c00 & pr), "winspool,", "")
Next
End With
MsgBox c01
End Sub
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.