Page 1 of 1

Catch ICON's from DLLs and use in own Gadgets

Posted: Thu Nov 21, 2002 7:07 pm
by BackupUser
Code updated For 5.20+

Restored from previous forum. Originally posted by Rings.

Code is 80% from german 'PCFreak'

Code: Select all

SSystemPath.s=Space(255)
Result=GetSystemDirectory_(SystemPath.s,255)
OpenWindow(0,0,0,237,50,"Icon-Test",#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
If CreateGadgetList(WindowID(0))
  For a=0 To 5
    ButtonImageGadget(a,10+a*36,10,36,36,ExtractIcon_(0,SystemPath+"\SetupAPI.dll",a))
  Next
EndIf
Repeat : Until WindowEvent()=#PB_Event_CloseWindow
End
Its a long way to the top if you wanna .....CodeGuru

Posted: Thu Nov 21, 2002 9:24 pm
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

Very nice example Rings!
Here is an example showing all available icons of the DLL rings used in his example... Original code by Rings.

Code: Select all

SystemPath.s=Space(255)
Result=GetSystemdirectory_(SystemPath.s,255)
OpenWindow(0,0,0,800,150,#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered,"Icon-Test")
If CreateGadgetList(WindowID())
 For a=0 To 19
  ButtonImageGadget(a,10+a*36,10,36,36,ExtractIcon_(0,SystemPath+"\SetupAPI.dll",a))
  ButtonImageGadget(a,10+a*36,50,36,36,ExtractIcon_(0,SystemPath+"\SetupAPI.dll",a+19))
 Next
EndIf
Repeat : Until WindowEvent()=#PB_EventCloseWindow
End

PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten