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 


Cheat Engine Forum Index
PostGo back to topic
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011
Posts: 1066
Location: 0x90

PostPosted: Fri Feb 04, 2022 12:22 pm    Post subject:

++METHOS wrote:

...

I tried both suggestions, but could not get them to work. I am too stupid to implement LeFiXER's code, and the MouseUp solution probably does not work in this case without changing more.

Thanks.


No need to apologise. Just trying to help where I can. Providing the code gives a little more context for me so thank you, with this you can actually do it like DB mentioned:
Code:

--handy helper function
function forEachAndFutureForm(classname, func)
  local i
  for i=0,getFormCount()-1 do
    local f
    f=getForm(i)
    if f.ClassName==classname then
      func(f)
    end
  end

  registerFormAddNotification(function(f)
    if classname==f.ClassName then
      f.registerFirstShowCallback(function()
        func(f)
      end)
    end
  end)
end


forEachAndFutureForm('TfrmAutoInject',function(f)
  b=createButton(f)
  b.Caption='Add to Table'
--b.OnClick=f.Assigntocurrentcheattable1.OnClick
--
  b.OnMouseDown=f.Assigntocurrentcheattable1.OnClick
  b.OnMouseUp=myfunction() -- whatever function you want to execute on mouseup
--
  b.parent=f.Panel3
  b.SetHeight(30)
  b.SetWidth(130)
  b.AutoSize=false
  b.AnchorSideLeft.Control=f.btnExecute
  b.AnchorSideLeft.Side=asrRight

  b.AnchorSideTop.Control=f.btnExecute
  b.AnchorSideTop.Side=asrTop

  end)


As for which events you can use for the button control, you have:
    OnChange
    OnClick
    OnEnter
    OnExit
    OnMouseDown
    OnMouseUp
    OnMouseLeave
    OnMouseMove
    OnMouseUp
    OnMouseWheel
    OnMouseWheelDown
    OnMouseWheelUp
Back to top
View user's profile Send private message
Post reviews:   Approve 1
Author Review
++METHOS
Review: Approve
Post reference:
ReviewPosted: Fri Feb 04, 2022 12:39 pm


Back to top
View user's profile Send private message
Display:  
Cheat Engine Forum Index


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites