akrutsinger Posted October 17, 2012 Share Posted October 17, 2012 I'm wanting to create a settings dialog inside of my OllyDbg 2.xx plugin, but I'm stuck at the very first part; creating the dialog...This is the code I'm using right now (and have successfully used in many other win32 projects before)hSettings = CreateDialog(hollyinst, MAKEINTRESOURCE(IDD_SETTINGS), hwollymain, (DLGPROC)SettingsDialogProc);if(hSettings != NULL){ ShowWindow(hSettings, SW_SHOW);}else{ MessageBox(hwollymain, L"CreateDialog returned NULL", L"OllyID", MB_OK | MB_ICONINFORMATION);}With this hSettings always returns NULL. What am I missing? Link to comment
ragdog Posted October 17, 2012 Share Posted October 17, 2012 HiI cannot c++ but have you try remove (DLGPROC)example:hSettings = CreateDialog(hollyinst, MAKEINTRESOURCE(IDD_SETTINGS), hwollymain, SettingsDialogProc);or with &SettingsDialogProcgreets Link to comment
kao Posted October 18, 2012 Share Posted October 18, 2012 From MSDN: HWND WINAPI CreateDialog(_In_opt_ HINSTANCE hInstance, _In_ LPCTSTR lpTemplate, _In_opt_ HWND hWndParent, _In_opt_ DLGPROC lpDialogFunc ); Parameters hInstance [in, optional] A handle to the module whose executable file contains the dialog box template. You have resources in your DLL, not in Ollydbg.exe, right? Replace hollyinst with hinstYourPluginDLL and it will work just fine. 1 Link to comment
akrutsinger Posted October 19, 2012 Author Share Posted October 19, 2012 Got it working. Used a modal dialog (Thanks RaMMicHaeL).HINSTANCE hSettingsInstance = (HINSTANCE)GetModuleHandle(L"OllyID.dll");DialogBox(hSettingsInstance, MAKEINTRESOURCE(IDD_SETTINGS), hwollymain, (DLGPROC)SettingsDialogProc); Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now