| View previous topic :: View next topic |
| Author |
Message |
HyberCode Cheater
Reputation: 0
Joined: 17 Feb 2016 Posts: 40
|
Posted: Sat Feb 20, 2016 4:33 pm Post subject: Set Icon From lua Script |
|
|
How To Set Icon From lua script ? not from the Form Design
like this maybe
control_setIcon(UDF1,"C:\Users\KingDark\Desktop\1.ico")
thank you
|
|
| Back to top |
|
 |
panraven Grandmaster Cheater
Reputation: 62
Joined: 01 Oct 2008 Posts: 959
|
Posted: Sat Feb 20, 2016 6:44 pm Post subject: |
|
|
Not sure it is the right way~
The 'ico' in the function seems necessary to tell it to load the right picture format.
I forget how to create/obtain the attached ico image.
Try search forum with 'loadFromStream' and 'Icon' and check main.lua (Picture Class) for more info.
| Code: | function newform()
local ff = createForm()
ff.Wdith,ff.Height,ff.OnClose=300,200,function(f)f.Destroy()end
return ff
end
function attachIcon(frm,tblFile)
local p = createPicture()
p.loadFromStream(findTableFile(tblFile).Stream,'ico')
local b = p.getBitmap()
frm.Icon = b
end
attachIcon(newform(),'kbh.ico') |
| Description: |
|
 Download |
| Filename: |
iconTest.CT |
| Filesize: |
1.07 KB |
| Downloaded: |
732 Time(s) |
_________________
- Retarded. |
|
| Back to top |
|
 |
HyberCode Cheater
Reputation: 0
Joined: 17 Feb 2016 Posts: 40
|
Posted: Sun Feb 21, 2016 12:20 am Post subject: |
|
|
| yeah thank you it works ... but what about the taskbar ? same cheat engine icon appere
|
|
| Back to top |
|
 |
panraven Grandmaster Cheater
Reputation: 62
Joined: 01 Oct 2008 Posts: 959
|
Posted: Sun Feb 21, 2016 1:59 am Post subject: |
|
|
May try add property of the form (ff) as
| Code: | | ff.ShowInTaskBar='stAlways' |
But it may be the image format.
In my case of the kbh.ico on windows 7, the icon show at taskbars when run as *.ct inside cheatengine, also as *.cetrainer & *.exe when the above ShowInTaskBar is set.
_________________
- Retarded. |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25832 Location: The netherlands
|
Posted: Sun Feb 21, 2016 5:22 am Post subject: |
|
|
No idea if it works, but try:
| Code: |
getApplication().Icon=b
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
HyberCode Cheater
Reputation: 0
Joined: 17 Feb 2016 Posts: 40
|
Posted: Sun Feb 21, 2016 11:54 am Post subject: |
|
|
yeah i already add this "ff.ShowInTaskBar='stAlways'" to show the icon on the taskbar ... but same cheat engine icon
i tried it dark byte ... Unfortunately didn't work
|
|
| Back to top |
|
 |
|