Je ne sais pas la façon dont tu procèdes... donc comment veux tu que je t'aide ?
d'apres ce que je crois avoir compris, tu utilises le code suivant:
require 'vr/vrcontrol'
require 'vr/vrtray'
module TrayHandler
include VRTrayiconFeasible
include VRMenuUseable
LoadIcon = Win32API.new("user32","LoadIcon","II","I")
QUESTION_ICON= LoadIcon.call(0,32514)
EXCLAMATION_ICON = LoadIcon.call(0,32515)
def construct
self.caption="Good Stuff"
# trayicon menu
@traymenu = newPopupMenu
@traymenu.set([
["Do Stuff","stuff"],["Update Me","update"],["Exit","exit"]
])
create_trayicon(EXCLAMATION_ICON,"installr",0)
end
def stuff_clicked
puts "Stuff done!"
end
def update_clicked
modify_trayicon(QUESTION_ICON,"modified",0)
end
def self_traylbuttondown(iconid)
end
def self_trayrbuttonup(iconid)
showPopup @traymenu
end
def exit_clicked
delete_trayicon(0)
exit
end
end
frm = VRLocalScreen.newform
frm.extend TrayHandler
frm.create
VRLocalScreen.messageloop
le probleme, c'est que la fonction require a été supprimée (ou plutot dé-définie) sous rmvx...
sous rmxp, cela peut marcher, mais si tu compte dffuser ton jeu, il faudra que le joueur installe ruby.
donc impossible d'appeler ces fichiers ruby !
je te propose une autre solution, codée à l'arrache. Il faut encore trouver le moyen de retrouver la fenetre en cliquant de le systemtray:
#------------------------------------------------------------------------------
# par berka: compatible rgss 1&2
#------------------------------------------------------------------------------
def handle
@jeu="\0"*256
ini=Win32API.new('kernel32','GetPrivateProfileStringA','pppplp', 'l')
ini.call('Game','Title','',@jeu,255,".\\Game.ini")
@jeu.delete!("\0")
return Win32API.new('user32','FindWindowEx','llpp','l').call(0,0,nil,@jeu)
end
ExtractIcon=Win32API.new('shell32','ExtractIcon','lp','l')
Shell_NotifyIcon=Win32API.new('shell32','Shell_NotifyIconA','lp','i')
args=[88,handle,'ruby'.hash,2|4,0,ExtractIcon.call(0,'Game.exe')].pack('l2I3l')
args<<@jeu<<"\0"*(64-@jeu.size)
Shell_NotifyIcon.call(0,args)
#~ Win32API.new('user32','ShowWindow','l','l').call(handle)