 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
kot1990 Expert Cheater
Reputation: 1
Joined: 06 Sep 2009 Posts: 131 Location: Greece
|
Posted: Wed Mar 31, 2010 12:43 pm Post subject: please help with resources!..... |
|
|
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 |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Wed Mar 31, 2010 2:57 pm Post subject: |
|
|
| in your dialog in your resource editor, you can set what/which menu it uses
|
|
| Back to top |
|
 |
kot1990 Expert Cheater
Reputation: 1
Joined: 06 Sep 2009 Posts: 131 Location: Greece
|
Posted: Sat Apr 03, 2010 6:24 am Post subject: |
|
|
Thanks Slugsnack, that was really simple ,, 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 .
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 , 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 |
|
 |
|
|
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
|
|