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 


[delphi]global prototype function ?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Thu Aug 28, 2008 9:30 am    Post subject: [delphi]global prototype function ? Reply with quote

in C, you can declare a sexy function like this:

Code:
HWND roflWindow = FindWindow()


then everyone can use it, how can i do it in delphi ?

i tried with type/const, thanks !!
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Thu Aug 28, 2008 9:33 am    Post subject: Reply with quote

You mean variable?
Back to top
View user's profile Send private message MSN Messenger
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Thu Aug 28, 2008 9:35 am    Post subject: Reply with quote

noz3001 wrote:
You mean variable?


not variable, i already know how to do global variables, a function without making it.
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Thu Aug 28, 2008 10:11 am    Post subject: Reply with quote

"a function without making it"...?
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Thu Aug 28, 2008 10:14 am    Post subject: Reply with quote

Prototype?
Back to top
View user's profile Send private message MSN Messenger
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Thu Aug 28, 2008 10:29 am    Post subject: Reply with quote

Symbol wrote:
"a function without making it"...?


i showed an example, -_-

look, in C you can do it like this:

Code:
#include <windows.h>

HWND dd = FindWindow(NULL, L"Calc");

void main()
{
if(dd != NULL)
 //your code
}


how can i do it in Delphi ?
Back to top
View user's profile Send private message
Renkokuken
GO Moderator
Reputation: 4

Joined: 22 Oct 2006
Posts: 3249

PostPosted: Thu Aug 28, 2008 10:34 am    Post subject: Reply with quote

...LOL
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Thu Aug 28, 2008 10:37 am    Post subject: Reply with quote

I don't think you can initialize variables outside the code, you can just initialize them in Form_Create.
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Thu Aug 28, 2008 10:39 am    Post subject: Reply with quote

Symbol wrote:
I don't think you can initialize variables outside the code, you can just initialize them in Form_Create.


But i disline events ;_;

@Renko: my hair is still sexier ;]
Back to top
View user's profile Send private message
Renkokuken
GO Moderator
Reputation: 4

Joined: 22 Oct 2006
Posts: 3249

PostPosted: Thu Aug 28, 2008 10:41 am    Post subject: Reply with quote

Symbol wrote:
I don't think you can initialize variables outside the code, you can just initialize them in Form_Create.
Delphi has initialization and finalization sections.

http://delphi.about.com/od/beginners/l/aa051199.htm
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Thu Aug 28, 2008 10:56 am    Post subject: Reply with quote

Renkokuken wrote:
Symbol wrote:
I don't think you can initialize variables outside the code, you can just initialize them in Form_Create.
Delphi has initialization and finalization sections.

http://delphi.about.com/od/beginners/l/aa051199.htm


what's the finalization routine for ?
Back to top
View user's profile Send private message
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Thu Aug 28, 2008 12:26 pm    Post subject: Reply with quote

Rot1 wrote:
Renkokuken wrote:
Symbol wrote:
I don't think you can initialize variables outside the code, you can just initialize them in Form_Create.
Delphi has initialization and finalization sections.

http://delphi.about.com/od/beginners/l/aa051199.htm


what's the finalization routine for ?
http://delphi.about.com/od/beginners/l/aa051199.htm wrote:
If your unit needs to perform any cleanup when the application terminates, such as freeing any resources allocated in the initialization part; you can add a finalization section to your unit. The finalization section comes after the initialization section, but before the final end.

Read before you ask please.
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Thu Aug 28, 2008 12:36 pm    Post subject: Reply with quote

HolyBlah wrote:
Rot1 wrote:
Renkokuken wrote:
Symbol wrote:
I don't think you can initialize variables outside the code, you can just initialize them in Form_Create.
Delphi has initialization and finalization sections.

http://delphi.about.com/od/beginners/l/aa051199.htm


what's the finalization routine for ?
http://delphi.about.com/od/beginners/l/aa051199.htm wrote:
If your unit needs to perform any cleanup when the application terminates, such as freeing any resources allocated in the initialization part; you can add a finalization section to your unit. The finalization section comes after the initialization section, but before the final end.

Read before you ask please.


i usually do finalization OnDestory event -.-"
Back to top
View user's profile Send private message
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Thu Aug 28, 2008 12:51 pm    Post subject: Reply with quote

From here its easy. If you need some more help or an example just ask.
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Thu Aug 28, 2008 1:28 pm    Post subject: Reply with quote

HolyBlah wrote:
From here its easy. If you need some more help or an example just ask.


thanks, i tried using init in my .dll (importing it from unit.pas) and it won't work ! why =/ ?

can i have an example of a .dll initializing a HWND variable ? thanks man !

i tried doing this:

Code:
var hWindow:HWND;
procedure Initialize;
begin
  hWindow:=FindWindow(Target, nil);
end;

begin
Initialize;
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 -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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