Dialog to config the plugin

Plugin development, plugin requests, support for third party plugins, ...
iam
Posts: 3
Joined: 31.05.2011 23:55:06

Dialog to config the plugin

Postby iam » 01.06.2011 15:29:52

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.

User avatar
Patrick
Developer
Posts: 7380
Joined: 04.03.2003 14:51:26

Re: Dialog to config the plugin

Postby Patrick » 02.06.2011 20:48:52

: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.

iam
Posts: 3
Joined: 31.05.2011 23:55:06

Re: Dialog to config the plugin

Postby iam » 03.06.2011 16:27:33

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.

User avatar
Patrick
Developer
Posts: 7380
Joined: 04.03.2003 14:51:26

Re: Dialog to config the plugin

Postby Patrick » 05.06.2011 13:47:06

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);

Guest

Re: Dialog to config the plugin

Postby Guest » 07.06.2011 16:19:16

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.

iam
Posts: 3
Joined: 31.05.2011 23:55:06

Re: Dialog to config the plugin

Postby iam » 13.06.2011 17:11:48

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.


Return to “Plugins”

Who is online

Users browsing this forum: No registered users and 4 guests