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 


please help with resources!.....

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
kot1990
Expert Cheater
Reputation: 1

Joined: 06 Sep 2009
Posts: 131
Location: Greece

PostPosted: Wed Mar 31, 2010 12:43 pm    Post subject: please help with resources!..... Reply with quote

my app is a dll that is injected into another application. I created a menu resource and attached it to the window class like this:

Code:
wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MENU1);


but when the dll is injected the window has no menus in, what's happening?

EDIT: If I go the api way it works,

Code:
HMENU lolmenu = CreateMenu();
   AppendMenu(lolmenu,MF_STRING,0,"asdfasdf");
   SetMenu(hwndMain,lolmenu);


but resources don't load. Maybe I should work with handles?

I want to create an edit control and retrieve an integer from it. I found I can use WindowGetText() but I don't know how to convert string to int after that. If I use resources there's an available function for that GetDlgItemInt().

and... I couldn't find In visual studio stuff like buttons/group boxes/edit boxes/comboboxes etc.. the only I found are menu, cursor, dialog box, icon, html and some more.. but there are many basic controls missing.. what am I doing wrong? sorry for the dumb questions but I have never created visual stuff before.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Wed Mar 31, 2010 2:57 pm    Post subject: Reply with quote

in your dialog in your resource editor, you can set what/which menu it uses
Back to top
View user's profile Send private message
kot1990
Expert Cheater
Reputation: 1

Joined: 06 Sep 2009
Posts: 131
Location: Greece

PostPosted: Sat Apr 03, 2010 6:24 am    Post subject: Reply with quote

Thanks Slugsnack, that was really simple Smile,, sorry for late response, I was on holidays..

EDIT: well it works just great when I create my own exe application, the dialog appears with all controls I put in the dialog, but when I inject the dll in another application the CreateDialog() just fails and returns null Sad .

EDIT2:
HWND CreateDialog(
__in HINSTANCE hInstance,
__in LPCTSTR lpTemplate,
__in HWND hWndParent,
__in DLGPROC lpDialogFunc
);

HINSTANCE

Handle to the module whose executable file contains the dialog box template.

in my case the module is the dll and I call it like this:

Code:

dialog=CreateDialogA(GetModuleHandle(0),MAKEINTRESOURCE(IDD_DIALOG1),hwndMain,ToolDlgProc);
         if(dialog != NULL)
         {
            ShowWindow(dialog, SW_SHOW);
         }
         else
         {
            MessageBox(hwndMain, "CreateDialog returned NULL", "Warning!",
            MB_OK | MB_ICONINFORMATION);
         }


EDIT3: LOL Solved Smile , I should use the HMODULE from the dll and not the HINSTANCE from the GetModuleHandle(0) because it finds the application I inject my dll into and there are no resources there,,, hehe
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