faqts : Computers : Programming : Languages : Bbcbasic

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

Entry

BBCBASIC: Windows: Microsoft Windows: Icon: How to extract an icon from .exe application?

Feb 3rd, 2007 04:00
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 02 February 2007 - 09:55 pm -------------------

BBCBASIC: Windows: Microsoft Windows: Icon: How to extract an icon 
from .exe application?

--- cut here: begin --------------------------------------------------

 IconPath$ = "C:\WINDOWS\notepad.exe"
 REM IconPath$ = "C:\Program Files\BBC BASIC for Windows\bbcwin.exe"
 SYS "ExtractAssociatedIconA", 0, IconPath$, ^lpiIcon% TO hIcon%
 REM offset in pixels from top left-hand corner of screen: horizontal
 x% = 10
 REM offset in pixels from top left-hand corner of screen: vertical
 y% = 10
 REM width of icon (e.g. choose 32 for small, ..., 1024 for large,... )
 w% = 32
 REM height of icon (e.g. choose 32 for small, ..., 1024 for large,...)
 h% = 32
 SYS "DrawIconEx", @memhdc%, x%, y%, hIcon%, w%, h%, 0, 0, 3 TO ret%
 END

--- cut here: end ----------------------------------------------------

===

Tested successfully on
Microsoft Windows XP Professional (service pack 2),
running
BBCBASIC for Windows v5.50a

===

Internet: see also:

---

Extract an icon from an Windows application and paint on a Form
http://delphi.about.com/cs/adptips1999/a/bltip0599_4.htm

----------------------------------------------------------------------