• ¡Welcome to Square Theme!
  • This news are in header template.
  • Please ignore this message.
مهمان عزیز خوش‌آمدید. ورود عضــویت


امتیاز موضوع:
  • 9 رای - 3.33 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
Title: This code allows to extract icons from .dll and .exe files
حالت موضوعی
#1
با کد زیر میتونی ایکون های dll , exe رو از فایل استخراج کنید.

Task: This code allows to extract icons from .dll and .exe files


Declarations
کد:
Option Explicit

Global lIcon&
Global sSourcePgm$
Global sDestFile$

Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long
Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As Long

Code

کد:
'www.parsicoders.com
' Add VScrollBar, Label, Tow CommnandButtons and CommonDialog
'Then Add the Following:
Option Explicit

Private Sub Command1_Click()
  On Error Resume Next
  With CommonDialog1
    .FileName = sDestFile
    .CancelError = True
    .Action = 2
    If Err Then
      Err.Clear
      Exit Sub
    End If
    sDestFile = .FileName
    SavePicture Picture1.Image, sDestFile
  End With
End Sub

Private Sub Command2_Click()
  Dim a%
  
  On Error Resume Next
  With CommonDialog1
    .FileName = sSourcePgm
    .CancelError = True
    .DialogTitle = "Select a DLL or EXE which includes Icons"
    ........ = "Icon Resources (*.ico;*.exe;*.dll)|*.ico;*.exe;*.dll|All files|*.*"
    .Action = 1
    If Err Then
      Err.Clear
      Exit Sub
    End If
    sSourcePgm = .FileName
    DestroyIcon lIcon
    Do
      lIcon = ExtractIcon(App.hInstance, sSourcePgm, a)
      If lIcon = 0 Then Exit Do
      a = a + 1
      DestroyIcon lIcon
    Loop
    If a = 0 Then
      MsgBox "No Icons in this file!"
    End If
    Label1.Caption = a & IIf(a = 1, " Image", " Images")
    VScroll1.Max = IIf(a = 0, 0, a - 1)
    VScroll1.Value = 0
    VScroll1_Change
  End With
End Sub

Private Sub Form_Load()
Command1.Caption = "save"
Command2.Caption = "open"
  Command2_Click
End Sub


Private Sub VScroll1_Change()
  DestroyIcon lIcon
  Picture1.Cls
  lIcon = ExtractIcon(App.hInstance, sSourcePgm, VScroll1.Value)
  Picture1.AutoSize = True
  Picture1.AutoRedraw = True
  DrawIcon Picture1.hdc, 0, 0, lIcon
  Picture1.Refresh
End Sub


گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
 
پاسخ
  


موضوعات مشابه ...
موضوع نویسنده پاسخ بازدید آخرین ارسال
  Open File Binary And Search String In Files Amin_Mansouri 1 4,772 01-24-2017، 04:15 PM
آخرین ارسال: aminjannoukaretam
  source code Mini-Task Amin_Mansouri 1 4,085 08-11-2012، 04:09 PM
آخرین ارسال: alakimalaki
  Split Files of Any Size Amin_Mansouri 0 2,863 10-06-2011، 10:44 AM
آخرین ارسال: Amin_Mansouri
  Get Shortcut or link destination in code Amin_Mansouri 0 3,073 09-26-2011، 09:27 AM
آخرین ارسال: Amin_Mansouri
  Source code Insert & Delete data from a file Amin_Mansouri 0 3,704 04-29-2011، 03:56 PM
آخرین ارسال: Amin_Mansouri
  Source Code Services Installer Amin_Mansouri 0 3,237 04-22-2011، 12:32 PM
آخرین ارسال: Amin_Mansouri
  Source Code PlayStation MemoryCard image reader and editor Amin_Mansouri 0 3,012 04-19-2011، 12:04 PM
آخرین ارسال: Amin_Mansouri
  Source Code Burn Iso File Amin_Mansouri 0 3,421 04-19-2011، 11:38 AM
آخرین ارسال: Amin_Mansouri

پرش به انجمن:


Browsing: