View previous topic :: View next topic |
Author |
Message |
FIRESKY Cheater Reputation: 0
Joined: 01 Mar 2017 Posts: 34
|
Posted: Mon Apr 29, 2024 8:04 am Post subject: messageDialog in FormShow (Always In Foreground). |
|
|
I thought is it possible that a Dialogmessage launched automatically and inserted on "function FormShow(sender)" is always seen in the foreground on windows?
|
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 34
Joined: 16 Feb 2017 Posts: 1418
|
|
Back to top |
|
|
FIRESKY Cheater Reputation: 0
Joined: 01 Mar 2017 Posts: 34
|
Posted: Tue Apr 30, 2024 4:15 am Post subject: |
|
|
Hey AylinCE Thanks as usual for the reply,
To explain the problem in more detail,
I noticed that if I write a simple Dialogmessage, exemple:
if messageDialog([[
HELLO WORLD!
BLA BLA]],mtConfirmation, mbYes, mbNo) ==mrNo then
closeCE()
end
end
And I make this appear as a message before the CETRAINER appears,
then connecting it to the SHOWFORM, which is the first thing that will appear when launching a CETRAINER,
for some strange reason this won't appear in the foreground for any reason.
My goal would be that, even if I am browsing or watching a video, it always appears in the foreground.
I also think that it is possible that this happens due to a BUG in the cheat engine [7.4],
I currently use version 7.4 because the new versions have a serious BUG with the CETRAINERS that do not allow them to be opened after a certain number of times, about 10, a unless the "Reset Windows Position" checkbox from the CE setting is disabled, and honestly I don't like that every time I launch CE it starts again from a formatting of 0.
But this is another different problem of the new CE like the latest version which probably only can know,
but even having tried to inform he of this BUG also with any VIDEO, doesn't seem like the problem has been solved.
But returning to the minor problem, that of the message not appearing in the foreground,
I'm not sure if this is a CE 7.4 bug or a general problem that messages like this don't appear in the foreground.
|
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 34
Joined: 16 Feb 2017 Posts: 1418
|
Posted: Tue Apr 30, 2024 6:35 am Post subject: |
|
|
These are also ideas;
Code: |
UDF1.Hide() -- or your trainer name ..
function startMsg()
if f1 then f1.Destroy() f1=nil end
if messageDialog([[
HELLO WORLD!
BLA BLA]],mtConfirmation, mbYes, mbNo) == mrNo then
closeCE()
else
-- UDF1.Show()
-- start form gui and all controls ..
f1=createForm()
b1=createButton(f1) b1.Caption="Click me"
b1.OnClick=startMsg
end
end
startMsg() |
Bringing the window forward;
Code: | local ctpid = 0
if ctpid==0 then ctpid = getForegroundProcess() end
if tmr22 then tmr22.Destroy() tmr22=nil end
tmr22=createTimer()
tmr22.Interval=5000 -- Some time was devoted to leaving the window in the background while testing.
tmr22.Enabled=false
function startMsg()
if f1 then f1.Destroy() f1=nil end
if messageDialog([[
HELLO WORLD!
BLA BLA]],mtConfirmation, mbYes, mbNo) == mrNo then
closeCE()
else
-- start form gui and all controls ..
f1=createForm()
b1=createButton(f1) b1.Caption="Click me"
b1.OnClick=startMsg
end
end
function foregroundW1()
tmr22.Enabled=false
--print(ctpid)
sl=createStringList()
sltext=getWindowlist(sl)
for i=0, sl.count -1 do
pd = tonumber((sl[i]):sub(1,8),16)
name = (sl[i]):sub(10,80)
if tonumber(pd)==tonumber(ctpid) then
--print(name,pd,ctpid)
hwnd = findWindow(nil, name)
executeCodeLocal('SetForegroundWindow',hwnd)
return startMsg()
end
end
end
tmr22.OnTimer=function()
foregroundW1()
tmr22.Enabled=false
end
tmr22.Enabled=true |
_________________
|
|
Back to top |
|
|
FIRESKY Cheater Reputation: 0
Joined: 01 Mar 2017 Posts: 34
|
Posted: Tue Apr 30, 2024 7:43 am Post subject: |
|
|
This is certainly a great idea
with this method the CETRAINER opens and only AFTER then the message appears and it goes to the foreground perfectly.
But what if you wanted to do it the other way around?
I'll explain
First the message appears and only after clicking yes does the CETRAINER to appear, or NO to close all.
|
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 34
Joined: 16 Feb 2017 Posts: 1418
|
Posted: Tue Apr 30, 2024 8:57 am Post subject: |
|
|
Added automatic shutdown if no selection is made.
Code: | function startMsg()
if f1 then f1.Destroy() f1=nil end
local ansver = messageDialog([[
HELLO WORLD!
BLA BLA]],mtConfirmation, mbYes, mbNo)
if ansver==mrNo then
closeCE()
elseif ansver==mrYes then
-- Trainer.Show() -- your trainer gui
-- start form gui and all controls .. (test gui)
f1=createForm()
b1=createButton(f1) b1.Caption="Click me"
b1.OnClick=startMsg
else -- click "X" close message box
closeCE()
return cafree
end
end
startMsg() |
_________________
|
|
Back to top |
|
|
FIRESKY Cheater Reputation: 0
Joined: 01 Mar 2017 Posts: 34
|
Posted: Tue Apr 30, 2024 1:54 pm Post subject: |
|
|
Thanks great idea!
|
|
Back to top |
|
|
|