Printing 如何获取默认重定向打印机

Printing 如何获取默认重定向打印机,printing,vb6,terminal-services,Printing,Vb6,Terminal Services,我在终端服务器中进行远程连接。包括打印机作为我的本地资源。然后在设备设置中,我将默认设置为重定向打印机 Dim pr As Printer MsgBox Printer.DeviceName '- return the default printer which I believe pulled from registry entry ' "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device" For Each p

我在终端服务器中进行远程连接。包括打印机作为我的本地资源。然后在设备设置中,我将默认设置为重定向打印机

Dim pr As Printer
MsgBox Printer.DeviceName
'- return the default printer which I believe pulled from registry entry
'  "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device"

For Each pr In Printers
    MsgBox pr.DeviceName
Next pr
'- return the list of all available printer including from other users       ' session
我在这里试图实现的是返回正确的默认打印机,即重定向打印机。不是这个打印机。DeviceName

我相信从这个注册表
HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device\SessionDefaultDevices\{SessionID}

这里是否有拉取数据的现有功能