Willkommen bei dotnet-snippets.de! Snippet hinzufügen Login Registrieren
Snippets in der Datenbank: 1563 | Anzahl registrierter User: 1895 | Besucher online: 92
Hauptmenü
Home
Top Ten
Zufälliger Snippet
FAQs
.NET Community
dotnet-forum.de
dotnet-kicks.de
Social

RSS Feeds
Rss Alle Snippets
Rss C#
Rss VB.NET
Rss C++
Rss ASP.NET
Partner
Member of Microsoft Community Leader/Insider Program (CLIP)

Anzahl der Desktop Icons ermitteln


Autor: Tim Hartwig
Sprache: VB.NET
Bewertung:
noch nicht bewertet
Anzahl der Aufrufe: 6628
  
Kick it on dotnet-kicks.de  

Beschreibung:

Wie der Name schon sagt ermittelt diese Funktion wieviel Icons auf dem Desktop liegen.

Abgelegt unter: Desktop, Icon, Anzahl.



Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" ( _
    ByVal lpClassName As String, _
    ByVal lpWindowName As String) _
As Int32

Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" ( _
    ByVal hWnd1 As Int32, _
    ByVal hWnd2 As Int32, _
    ByVal lpsz1 As String, _
    ByVal lpsz2 As String) _
As Int32

Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" ( _
    ByVal hwnd As Int32, _
    ByVal wMsg As Int32, _
    ByVal wParam As Int32, _
    ByVal lParam As Int32) _
As Int32


Public Function GetDesktopIconsCount()
    Dim LVWHandle As Int32

    'Handle zum Hauptprogramm finden
    LVWHandle = FindWindow(vbNullString, "Program Manager")

    'Handle zum Desktop Fenster ermitteln
    LVWHandle = FindWindowEx(LVWHandle, 0, "shelldll_defview", vbNullString)

    'Handle zur Desktop ListView ermitteln
    LVWHandle = FindWindowEx(LVWHandle, 0, "SysListView32", vbNullString)

    Return SendMessage(LVWHandle, 4100, 0, 0)
End Function
Sie haben Fragen zu diesem Snippet oder brauchen Hilfe bei der .NET Entwicklung?
Freundliche und kompetente Entwickler helfen Ihnen gern weiter im Forum für .NET Entwicklung.



Kommentare:
(Zum Schreiben von Kommentaren bitte anmelden.)



schlecht sehr gut
1 2 3 4 5 6 7 8 9 10
Nur angemeldete User können Snippets bewerten.