Avatar billede krojserpoul Nybegynder
30. januar 2000 - 19:50 Der er 2 kommentarer og
1 løsning

WinLib

Dav

Nogen der kender et Api kald der returnerer Windows biblioteket?
Avatar billede webster Nybegynder
30. januar 2000 - 19:57 #1
Jep

Jeg har i hvert fald et eksempel på brugen af det:

This project needs a PictureBox, called 'Picture1

'In general section
Private Declare Function DrawIcon Lib "user32" Alias "DrawIcon" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon 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 GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long


Private Sub Form_Load()

    Dim Path as String, strSave as string
    'Create a buffer string
    strSave = String(200, Chr$(0))
    'Get the windows directory and append '\REGEdit.exe' to it
    Path = Left$(strSave, GetWindowsDirectory(strSave, Len(strSave))) + "\REGEdit.exe"
    'No pictures
    Picture1.Picture = LoadPicture()
    'Set graphicmode to 'persistent
    Picture1.AutoRedraw = True
    'Extract the icon from REGEdit
    return& = ExtractIcon(Me.hWnd, Path, 2)
    'Draw the icon on the form
    return2& = DrawIcon(Picture1.hdc, 0, 0, return&)
End Sub

Avatar billede webster Nybegynder
30. januar 2000 - 19:58 #2
Det du skal bruger er selvfølgelig:

Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long


Avatar billede krojserpoul Nybegynder
30. januar 2000 - 20:06 #3
Lige hvad jeg skulle bruge. Det er hvad man kan kalde et hurtigt svar!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester