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 


DLL Console/GUI making?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Aviram
Grandmaster Cheater
Reputation: 0

Joined: 30 Jun 2006
Posts: 633

PostPosted: Sun Mar 09, 2008 2:07 pm    Post subject: DLL Console/GUI making? Reply with quote

Hey guys,
I cant believe i dont know how to do that,
I'm trying to make a dll but i dont know how to make a console dll or dll with gui X_X
Anyone knows how to make a console in my dll or a gui?
like JAAC and such.
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Mar 09, 2008 2:10 pm    Post subject: Reply with quote

Console - AllocConsole();
GUI: WNDCLASSEX struct, RegisterClassEx(), and CreateWindowEx().

Create a new thread on DLL_PROCESS_ATTACH that calls these functions.

_________________
Back to top
View user's profile Send private message
Aviram
Grandmaster Cheater
Reputation: 0

Joined: 30 Jun 2006
Posts: 633

PostPosted: Sun Mar 09, 2008 2:11 pm    Post subject: Reply with quote

Yay,thank u Smile
If i'll use the gui function i'll need to design it by codes right?
cuz i hate coding guis Sad
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Sun Mar 09, 2008 2:11 pm    Post subject: Reply with quote

AllocConsole();
http://msdn2.microsoft.com/en-us/library/ms681944.aspx

CreateWindowEx();
http://msdn2.microsoft.com/en-us/library/ms632680.aspx

Edit: Seems this forum lags too much when I post.


Last edited by Flyte on Sun Mar 09, 2008 2:12 pm; edited 3 times in total
Back to top
View user's profile Send private message
Aviram
Grandmaster Cheater
Reputation: 0

Joined: 30 Jun 2006
Posts: 633

PostPosted: Sun Mar 09, 2008 2:11 pm    Post subject: Reply with quote

OK,You can lock to avoid spam.
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Mar 09, 2008 2:14 pm    Post subject: Reply with quote

Aviram wrote:
Yay,thank u Smile
If i'll use the gui function i'll need to design it by codes right?
cuz i hate coding guis Sad


You can use a Dialog if you want from resources

Create a new thread at DLL_PROCESS_ATTACH that calls a function that calls DialogBox() - http://msdn2.microsoft.com/en-us/library/ms645452(VS.85).aspx

and create your own DialogProcedure Handler.

_________________
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Sun Mar 09, 2008 2:21 pm    Post subject: Reply with quote

GUI: myWXWindow->Show();

:P
Back to top
View user's profile Send private message
Aviram
Grandmaster Cheater
Reputation: 0

Joined: 30 Jun 2006
Posts: 633

PostPosted: Sun Mar 09, 2008 2:27 pm    Post subject: Reply with quote

Hmm,for some reason the console wont get open,
My dllmain.cpp:
Code:

// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                )
{
   switch (ul_reason_for_call)
   {
   case DLL_PROCESS_ATTACH: void console();
   case DLL_THREAD_ATTACH: void console();
   case DLL_THREAD_DETACH:
   case DLL_PROCESS_DETACH:
      break;
   }
   return TRUE;
}

my memty.cpp:
Code:

#include "stdafx.h"
#include <iostream>
using namespace std;

void console()
{
   BOOL WINAPI AllocConsole(void);
}

Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Mar 09, 2008 2:32 pm    Post subject: Reply with quote

Code:
#include <windows.h>
#pragma comment (linker, "/ENTRY:DllMain")

void Console()
{
   AllocConsole();
   // rest of ur shit here.
}

BOOL WINAPI DllMain( HMODULE hModule, DWORD dwReason, LPVOID lpReserved )
{
   UNREFERENCED_PARAMETER( hModule );
   UNREFERENCED_PARAMETER( lpReserved );

   switch( dwReason )
   {
   case DLL_PROCESS_ATTACH:
      CreateThread( 0, 0, (LPTHREAD_START_ROUTINE)Console, 0, 0, 0 );
      break;
   case DLL_THREAD_ATTACH:
   case DLL_THREAD_DETACH:
   case DLL_PROCESS_DETACH:
      break;
   }
}

_________________
Back to top
View user's profile Send private message
Aviram
Grandmaster Cheater
Reputation: 0

Joined: 30 Jun 2006
Posts: 633

PostPosted: Sun Mar 09, 2008 2:59 pm    Post subject: Reply with quote

Game crashes ? O_o
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Mar 09, 2008 9:45 pm    Post subject: Reply with quote

Try changing the thread routine to a DWORD instead of void:

Code:
DWORD Console()
{
   AllocConsole();
   // .. Other Code Here ..
   return 0;
}


I ran into this issue with using void as my thread type. Alternatively, you could also try changing the CreateThread line to:

Code:
CreateThread( NULL, NULL, (LPTHREAD_START_ROUTINE)&Console, NULL, NULL, NULL );

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Aviram
Grandmaster Cheater
Reputation: 0

Joined: 30 Jun 2006
Posts: 633

PostPosted: Sun Mar 09, 2008 11:28 pm    Post subject: Reply with quote

Code:
   case DLL_PROCESS_ATTACH:
      CreateThread( NULL, NULL, (LPTHREAD_START_ROUTINE)&Console, NULL, NULL, NULL );
     Console(); // <<< added this line
      break;

now it starts console and closes maple second after the console gets open? o_o
Back to top
View user's profile Send private message
Zand
Master Cheater
Reputation: 0

Joined: 21 Jul 2006
Posts: 424

PostPosted: Mon Mar 10, 2008 2:28 am    Post subject: Reply with quote

Why in the world are you running Console() twice?
Back to top
View user's profile Send private message
Aviram
Grandmaster Cheater
Reputation: 0

Joined: 30 Jun 2006
Posts: 633

PostPosted: Mon Mar 10, 2008 7:45 am    Post subject: Reply with quote

OH FINNALY!
Thank you x0r.
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
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