Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Visual Basic 6 - Impostare come icona di un form un file facente parte della libreria C:\Windows\system32\shell32.dll
Forum - Visual Basic 6 - Impostare come icona di un form un file facente parte della libreria C:\Windows\system32\shell32.dll

Avatar
alceus (Normal User)
Pro


Messaggi: 61
Iscritto: 11/06/2008

Segnala al moderatore
Postato alle 12:23
Giovedė, 12/06/2008
Ciao a tutti,
qualcuno sa dirmi se č possibile impostare come icona di un form un file .ico della libreria C:\WINDOWS\system32\shell32.dll? Io ci ho provato, ma sono riuscito massimo ad inserirla come immagine di una picture:

Codice sorgente - presumibilmente VB.NET

  1. Option Explicit
  2.       Private Const MAX_PATH = 260
  3.  
  4.       Private Declare Function GetSystemDirectory Lib "kernel32" Alias _
  5.       "GetSystemDirectoryA" (ByVal lpBuffer As String, _
  6.                              ByVal nSize As Long) As Long
  7.  
  8.       Private Declare Function ExtractIcon Lib "shell32.dll" Alias _
  9.       "ExtractIconA" (ByVal hInst As Long, _
  10.                       ByVal lpszExeFileName As String, _
  11.                       ByVal nIconIndex As Long) As Long
  12.  
  13.       Private Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, _
  14.       ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
  15.  
  16.       Dim path$, nIcon As Long
  17.  
  18.       Private Sub Command1_Click()
  19.           Dim hIcon As Long
  20.  
  21.           hIcon = ExtractIcon(App.hInstance, path$, nIcon)
  22.           Set Picture1.Picture = LoadPicture("")
  23.           Picture1.AutoRedraw = True
  24.           Call DrawIcon(Picture1.hdc, 0, 0, hIcon)
  25.           Picture1.AutoRedraw = False
  26.           Picture1.Refresh
  27.           nIcon = nIcon + 1
  28.       End Sub
  29.  
  30.       Private Sub Form_Load()
  31.           path$ = Space$(MAX_PATH)
  32.           Call GetSystemDirectory(path$, MAX_PATH)
  33.           path$ = Trim$(path$)
  34.           path$ = Left$(path$, Len(path$) - 1) & "\Shell32.dll"
  35.           nIcon = 0
  36.       End Sub
  37.           nIcon = 0
  38.       End Sub



Help me, please 8-|

Ultima modifica effettuata da alceus il 12/06/2008 alle 12:26
PM Quote
Avatar
alceus (Normal User)
Pro


Messaggi: 61
Iscritto: 11/06/2008

Segnala al moderatore
Postato alle 15:02
Venerdė, 13/06/2008
problema risolto scaricando icon sushi

PM Quote