Page 1 of 1

Dialog to config the plugin

Posted: 01.06.2011 15:29:52
by iam
Hi everybody,
I am developing one plugin to screenshot every desk when you change it, it's work fine, dexpot is a very good software and was so much easy develop the plugin. Now I like to configure the plugin from dexpot interface but i dont know how to create and manage the dialog in the OnConfigure() method, can you help me?

Thanks.

Re: Dialog to config the plugin

Posted: 02.06.2011 20:48:52
by Patrick
:dex:

Do whatever it is you usually do to create graphical dialogs. Dexpot doesn't care. Some examples from our plugins: Dexgrid uses CreateDialog, Dexcube launches an external configuration utility written in Visual Basic, and Raindexer opens its configuration file in the default text editor.

Re: Dialog to config the plugin

Posted: 03.06.2011 16:27:33
by iam
Thanks Patrick, i have doing something wrong because de dialog don't open:

IDD_CONFIG DIALOG 0, 0, 185, 92
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
BEGIN
LTEXT "Path de ScreenSots",IDC_STATIC,23,38,68,8
PUSHBUTTON "Button1",IDC_BUTTON1,89,58,50,14
EDITTEXT IDC_EDIT1,89,34,60,14,ES_AUTOHSCROLL
END

BOOL CALLBACK DexShot::DialogConfig(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_INITDIALOG:
{
/// initialize dialog
}
break;
}

return TRUE;
}

void DexShot::OnConfigure()
{
CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_CONFIG), dex->GetDexpotWindow(), DialogConfig);
}

Thnaks again.

Re: Dialog to config the plugin

Posted: 05.06.2011 13:47:06
by Patrick
You have to add the WS_VISIBLE style to the dialog template or show it manually:

Code: Select all

HWND hWndConfig = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_CONFIG), NULL, DialogConfig);

if(hWndConfig) ShowWindow(hWndConfig, SW_SHOW);

Re: Dialog to config the plugin

Posted: 07.06.2011 16:19:16
by Guest
Thanks Patrick for your time... but it does't work... I still trying... Is correct this way to get the Instance? I don't know how the system work with Instance for the plugins.

Re: Dialog to config the plugin

Posted: 13.06.2011 17:11:48
by iam
It worked finally, the problem was that I was giving the wrong address for the processing method of the dialog events. The creation of the dialog ended up doing this:

CreateDialog (GetModuleHandle (NULL), MAKEINTRESOURCE (IDD_CONFIG), dex-> GetDexpotWindow (), DexShot: DialogConfig)

Long time no programing in c++ :-)

Regards.