Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Set Icon From lua Script

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
HyberCode
Cheater
Reputation: 0

Joined: 17 Feb 2016
Posts: 40

PostPosted: Sat Feb 20, 2016 4:33 pm    Post subject: Set Icon From lua Script Reply with quote

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 Wink
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 62

Joined: 01 Oct 2008
Posts: 959

PostPosted: Sat Feb 20, 2016 6:44 pm    Post subject: Reply with quote

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')



iconTest.CT
 Description:

Download
 Filename:  iconTest.CT
 Filesize:  1.07 KB
 Downloaded:  732 Time(s)


_________________
- Retarded.
Back to top
View user's profile Send private message
HyberCode
Cheater
Reputation: 0

Joined: 17 Feb 2016
Posts: 40

PostPosted: Sun Feb 21, 2016 12:20 am    Post subject: Reply with quote

yeah thank you it works ... but what about the taskbar ? same cheat engine icon appere
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 62

Joined: 01 Oct 2008
Posts: 959

PostPosted: Sun Feb 21, 2016 1:59 am    Post subject: Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25833
Location: The netherlands

PostPosted: Sun Feb 21, 2016 5:22 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
HyberCode
Cheater
Reputation: 0

Joined: 17 Feb 2016
Posts: 40

PostPosted: Sun Feb 21, 2016 11:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites