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 


Change Form Title of ce.createForm with Free Pascal

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source -> Plugin development
View previous topic :: View next topic  
Author Message
redplug
How do I cheat?
Reputation: 0

Joined: 20 Jun 2012
Posts: 9

PostPosted: Wed Jun 20, 2012 4:21 pm    Post subject: Change Form Title of ce.createForm with Free Pascal Reply with quote

Hi.

I currently developing a CE Plugin. I am creating a form with ce.createForm and want to change the Caption of the form. In Lua i could use the setProperty methode but this is not available in your SDK.

In general. Can i call CE internal functions from the plugin?

Tanks Maximilian
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 332

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

PostPosted: Wed Jun 20, 2012 4:58 pm    Post subject: Reply with quote

It's recommended to create your own window with it's own message handler in your dll instead of using the plugin's createForm export if you wish to do more advanced things, like changing the caption...

Alternatively, you could do a lua_call with the luavm you can get from the pluginexport and call setProperty and all other functions from there.
Note that if you are in a different thread, make use of MainThreadCall so the lua command gets called from inside the main thread

And alternate method 2 (not recommended): Get the same lcl and fpc version that ce was build with and use the TForm class to control that object.
Again, do all commands using a MainThreadCall call. The gui components are not threadsafe except the few I explicitly exported

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
redplug
How do I cheat?
Reputation: 0

Joined: 20 Jun 2012
Posts: 9

PostPosted: Thu Jun 21, 2012 5:13 am    Post subject: Reply with quote

Thanks. I Created my own Form.

Code:

{...}

procedure TWoWBotForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
  CEExported.closeCE();
end;

procedure TWoWBotForm.ButtonShowCEMainWindowClick(Sender: TObject);
begin
  CEExported.unhideMainCEwindow();
end;

procedure TWoWBotForm.ButtonHideCEMAinWindowClick(Sender: TObject);
begin
  CEExported.hideAllCEWindows();
end;

function GetVersion(var PluginVersion: TPluginVersion; SizeOfPluginVersion: Integer): BOOL; stdcall;
begin
  Result := false;
  if SizeOfPluginVersion <> SizeOf(TPluginVersion) then exit;

  PluginVersion.version := 1;
  PluginVersion.pluginname := 'WoW Bot';


  Result := true;
end;


function InitializePlugin(ExportedFunctions: PExportedFunctions; PluginId: DWord): BOOL; stdcall;
begin
  Application.Initialize;
  CEExported := ExportedFunctions^;

  CEExported.hideAllCEWindows();

  WoWBotForm := TWoWBotForm.Create(Application);
  WoWBotForm.Show();
  Result := true;

end;

function DisablePlugin:BOOL; stdcall;
begin
  Result := true;
end;

{...}

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 Source -> Plugin development 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