Hi,
ich habe einen kleinen Denkfehler und zwar wenn ich den unten aufgefuehrten quellcode versuche zu starten dann bricht mir das proggi ab mit einer Fehlermeldung welches besagt das vb aufgrund eines ungueltigen Vorgangs geschlossen wird.
Ursache dafür ist eine ungültige Seite im Modul Shell32.dll bei 0167:7fcbf63c
Was habe ich bei der ganzen Sache falsch gemacht?
Für eure Hilfe bedanke ich mich im voraus
Hier der quelltext:
Option Explicit
Dim hInst As Long
Dim hicon As Long
Dim zaehler As Long
Dim file As String
Private Declare Function GetClassWord Lib „user32“ (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function ExtractIcon Lib „shell32.dll“ Alias „ExtractIconA“ (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long
Private Sub Command1_Click()
Dim file$, verz$
verz = Tools.windir
file = Tools.fileopen(„Dateien (*.exe *.dll) | *.exe;*.dll“, verz & „“)
If file = „“ Then
Exit Sub
Else
Label4.Caption = "Gewählte Datei: " & file
anzeigen
End If
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub anzeigen()
Dim i As Long
hInst = GetClassWord(hwnd, -16&:wink:
hicon = ExtractIcon(hInst, file, 1)
If hicon = 0 Then
MsgBox „In dem File: " & file & " sind keine Symbole enthalten!“, 64
file = „“
Exit Sub
End If
If hicon > 6 Then
For i = 7 To hicon
Load Picture1(i)
Load Label2(i)
Picture1(i).Visible = False
Label2(i).Visible = False
Next i
HScroll1.Max = hicon - 6
HScroll1.Value = 0
HScroll1.Enabled = True
End If
End Sub
Private Sub Form_Load()
HScroll1.Enabled = False
End Sub
PS: Der Fehler tritt beim Aufruf von
hicon = ExtractIcon(hInst, file, 1)
auf.