Cytron писал(а):открытие эксплорером не работает (shell "explorer.exe file.lnk")?
Dim FileName As String
FileName = "C:\WINDOWS\explorer.exe C:\homelink.lnk"
X = Shell("rundll32.exe url.dll,FileProtocolHandler" & " " & FileName, vbNormalFocus)
alibek писал(а):Да? А как ты его применял?
Private Type SHELLEXECUTEINFO
cbSize As Long
fMask As Long
hwnd As Long
lpVerb As String
lpFile As String
lpParameters As String
lpDirectory As String
nShow As Long
hInstApp As Long
lpIDList As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type
Private Declare Function ShellExecuteEx Lib "shell32.dll" (SEI As SHELLEXECUTEINFO) As Long
Private Sub Form_Load()
Dim SEI As SHELLEXECUTEINFO
Dim X As Long
Dim FilePath As String
FilePath = "C:\homelink.lnk" 'Иконка
With SEI
.cbSize = Len(SEI)
.lpFile = FilePath
End With
X = ShellExecuteEx(SEI)
End Sub
Jurist писал(а):alibek писал(а):Зацени мембер fMask и флаг SEE_MASK_CLASSKEY (скорее всего).
Это как?
Private Const SEE_MASK_CLASSKEY = &H3
Private Type SHELLEXECUTEINFO
cbSize As Long
fMask As Long
hwnd As Long
lpVerb As String
lpFile As String
lpParameters As String
lpDirectory As String
nShow As Long
hInstApp As Long
lpIDList As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type
Private Declare Function ShellExecuteEx Lib "shell32.dll" (SEI As SHELLEXECUTEINFO) As Long
Private Sub Form_Load()
Dim SEI As SHELLEXECUTEINFO
Dim X As Long
Dim FilePath As String
FilePath = "C:\homelink.lnk" 'Иконка
With SEI
.cbSize = Len(SEI)
.lpFile = FilePath
.fMask = SEE_MASK_CLASSNAME
End With
X = ShellExecuteEx(SEI)
End Sub
!Viper! писал(а):из чего можно сделать вывод, что таки работает.
Private Const SEE_MASK_CLASSKEY = &H3 ' !!!!!
...........
With SEI
.cbSize = Len(SEI)
.lpFile = FilePath
.fMask = SEE_MASK_CLASSNAME ' !!!!!
End With
............
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 26