Deklaration: Declare Function PickIconDlg Lib "shell32.dll" _ Alias "#62" ( _ ByVal hwndOwner As Long, _ ByVal lpstrFile As String, _ ByVal nMaxFile As Long, _ lpdwIconIndex As Long) As Long Beschreibung: Parameter:
Rückgabewert: Beispiel: Private Declare Function PickIconDlg Lib "shell32.dll" _ Alias "#62" ( _ ByVal hwndOwner As Long, _ ByVal lpstrFile As String, _ ByVal nMaxFile As Long, _ lpdwIconIndex 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 Declare Function DrawIcon Lib "user32" ( _ ByVal hdc As Long, _ ByVal x As Long, _ ByVal y As Long, _ ByVal hIcon As Long) As Long Private Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As Long ' Icon per Dialog wählen und in ein Bildfeld übertragen Private Sub Command1_Click() Dim hIco As Long, TmpIndex As Long, RetVal As Long, TmpIconFile As String * 256 ' Icon-Dialog aufrufen. ' Achtung!!! Unter Windows NT vorher in Unicode Konvertieren TmpIconFile = "c:\windows\system\pifmgr.dll" & vbNullChar RetVal = PickIconDlg(Me.hWnd, TmpIconFile, Len(TmpIconFile), TmpIndex) If RetVal = 0 Then MsgBox "Sie haben kein Icon gewählt", vbOKOnly + vbInformation, _ "Abbrechen" Exit Sub End If ' Extrahieren und Zeichnen hIcon = ExtractIcon(App.hInstance, Left$(TmpIconFile, InStr(1, _ TmpIconFile, vbNullChar) - 1), TmpIndex) Picture1.Cls DrawIcon Picture1.hdc, 0, 0, hIcon Picture1.Refresh DestroyIcon hIcon End Sub Diese Seite wurde bereits 8.447 mal aufgerufen. |
Neu! sevPopUp 2.0 Dynamische Kontextmenüs! Erstellen Sie mit nur wenigen Zeilen Code Kontextmenüs dynamisch zur Laufzeit. Vordefinierte Styles (XP, Office, OfficeXP, Vista oder Windows 8) erleichtern die Anpassung an die eigenen Anwendung... Buchempfehlung Tipp des Monats April 2024 Skyfloy Chart von Microsoft und dazu noch gratis Tutorial für Microsoft Chart Controls für Microsoft .NET Framework 3.5 TOP Entwickler-Paket TOP-Preis!! Mit der Developer CD erhalten Sie insgesamt 24 Entwickler- komponenten und Windows-DLLs. Die Einzelkomponenten haben einen Gesamtwert von 1605.50 EUR... |
||||||||||||||||||
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. |