So hier mal eine möglichkeit, ein Fenstericon zu setzen, ohne einen Recourcenhacken zuhilfe zu nehmen!
Leider nur Windows ONLY!
SetIcon("icon.ico")
WHILE TRUE
PRINT "look at the window-icon!!",10,10
SHOWSCREEN
WEND
END
FUNCTION Close:
ENDFUNCTION
INLINE
DECLARE_C_ALIAS(u32_GetActiveWindow,"user32.dll", "GetActiveWindow",(),int);
DECLARE_C_ALIAS(u32_SetClassLong,"user32.dll", "SetClassLongA",(int,int,int), void);
DECLARE_C_ALIAS(shell32_LoadIcon,"Shell32.dll", "ExtractIconA",(int,const char*,int), int);
ENDINLINE
FUNCTION SetIcon: Iconname$ // use a 16x16 icon
LOCAL hwnd, icon
INLINE
hwnd = u32_GetActiveWindow();
icon = shell32_LoadIcon(hwnd,Iconname_Str.c_str(),0);
u32_SetClassLong(hwnd,-14,icon);
ENDINLINE
ENDFUNCTION
Wie erstelle ich ein Icon?
1.öffne Paint
2.bild auf 16x16 einstellen
3.was reinmalen
4.speichern unter "name.ico" , drücke ENTER
Fertig!
chic,
aber sind Icons normalerweise nicht 16x16 Pixel?
klappt zumindest auch damit.
Ok dann 16x16 ;)
Gernot deine Inline Funktion wird beliebter ;)
Ich bin übrigens aus meiner WinterDepri raus und kann endlich wieder proggen hehe
Yu-huuuuuuu!
:good: mach ich doch alles für meine geliebte Community ;)
Ich hab keine Ahnung ^^
das hast du doch selbst verschoben schranzi ^^
Deshalb sag ich ja kein Ahnung :D
Weils mit Inline und WinAPI war ?
:) dann ist ja gut :P