| |
|
|
Jörg Sellmeyer | Repariert and updates:
'Source watts on the 15.07.2007 from the MMJ-Quellcodesammlung (Dietmar horn) into Babyklappe on XProfan.com stored:
'graphic: CreateIcon for Icon from external File
'PRFellow-Presentation
'Author: Thomas Hölzer - any rights vorbehalten
'Umsetzung the Profan-Befehls CreateIcon for Icon from externem Module
Def ExtractIcon(3) !"SHELL32","ExtractIconA"
Def SetWindowLong(3) !"USER32","SetWindowLongA"
Def GetWindowLong(2) !"USER32","GetWindowLongA"
Declare ifile#
Proc CreateExtIcon
Parameters hparent&,file$,x%,y%,index%
Declare hresult&,hicon&
Case (hparent& = 0): hparent&=GetActiveWindow()
hresult&=Create("Text",hparent&,"",x%,y%,0,0)
SetWindowLong(hresult&,-16,(GetWindowLong(hresult&,-16) | 3))
Dim ifile#,(Len(file$) + 1)
String ifile#,0=file$
hicon&=ExtractIcon(%hinstance,ifile#,index%)
Dispose ifile#
SendMessage(hresult&,$0172,2,hicon&)
'goes too:
'SendMessage(hresult&,$0170,hicon&,0)
Return hresult&
ENDPROC
'example:
Cls
Window Title "Das Icon hike at clicking mit"
Declare hi&
hi&=CreateExtIcon(%hwnd,"SHELL32.DLL",10,10,32)
While 1
WaitInput
SetWindowPos hi&=%mouseX,%mouseY-32,32
Wend
|
|
|
| |
|
|