onOpenProcess = function(pid)
yourlabel.Caption = "Attached to " .. pid
end
That won't update if you close the process (or it crashes). If you want that then as far as I know you'd need to create a timer and have it check eg.
Code:
-- on (re)attach update label
onOpenProcess = function(pid)
CETrainer.CELabel1.Caption = "Attached to " .. pid
reinitializeSymbolhandler() -- wait until fully attached
local tmr = createTimer()
tmr.OnTimer = function(this)
-- getOpenedProcessID() did not update when I closed the test process
local currentpid = getProcessIDFromProcessName(process)
if currentpid == nil then
CETrainer.CELabel1.Caption = "No longer attached"
this.destroy() -- quit checking
end
end
tmr.Interval = 1000 -- 1 second
end
Though at that point you may also want it to reattach automatically as well
Code:
-- on (re)attach update label
onOpenProcess = function(pid)
local tmr = createTimer()
tmr.OnTimer = function(this)
-- getOpenedProcessID() did not update when I closed the test process
local currentpid = getProcessIDFromProcessName(process)
if currentpid == nil then
CETrainer.CELabel1.Caption = "No longer attached"
openProcess(targetprocess) -- try to reattach (if reopened)
else
CETrainer.CELabel1.Caption = "Attached to " .. currentpid
end
end
tmr.Interval = 3000 -- 3 seconds
end
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