Hallo,
Application.Caption hast du ja schon selbst herausgefunden.
Ändern des Icon:
Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" (ByVal Classname As String, _
ByVal WindowName As String) As Long
Private Declare Function ExtractIcon Lib "shell32" _
Alias "ExtractIconA" (ByVal Inst As Long, ByVal FName As String, _
ByVal Indx As Long) As Long
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal Handle As Long, ByVal Message As Long, _
ByVal Param1 As Integer, ByVal Param2 As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" ( _
ByVal Handle As Long) As Long
Public Sub InstallIcon(strFileName As String, lngIdx As Long)
Dim lngWHnd As Long, lngIcon As Long
lngWHnd = FindWindow(vbNullString, Application.Caption)
If lngWHnd <> 0 Then
lngIcon = ExtractIcon(0, strFileName, lngIdx)
If lngIcon <> 0 Then
SendMessage lngWHnd, &H80, 0, lngIcon
DrawMenuBar lngWHnd
End If
End If
End Sub
Parameter strFileName der Sub InstallIcon ist entweder eine
Coderessource, die Icons enthält (*.dll, *.exe) oder eine explizite
Bilddatei (*.ico, *.bmp) mit der Icondarstellung inkl. vollständigem
Pfad. Im ersten Fall ist lngIdx die nullbasierte lfd. Nr. des Icons
in der Datei, anderenfalls 0.
Die Buttons oben recht lassen sich auch entfernen oder deaktivieren,
das muss ich aber erst mal raussuchen.
Gruß
|