Welcome to %s forums

BrainModular Users Forum

Login Register

Usine main window handle

Create your own modules in C++
Post Reply
LevraiBernardo
Site Admin
Posts: 110
Contact:

Unread post by LevraiBernardo » 28 Sep 2014, 08:55

Hello,
I'm trying to open a new window in Holyhock. So I use a CreateDialog function wich third argument is a handle of the main program window. I've tried with sdkGetUsineMainWindow(), but when I pause debugging on this line :
HWND UsineWnd = (HWND) sdkGetUsineMainWindow();
UsineWnd seems empty. Can anyone (Martin, for exemple...) tell me what's wrong ?
Thanx.

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 28 Sep 2014, 13:22

hi, LevraiBernardo

happy to see you around the sdk again :)

strange that sdkGetUsineMainWindow() don't work for you, i use it in the pluginwrapper with no problem (PluginWrapper.cpp, line 1482)

anyway, you shouldn't rely on CreateDialog as it is WIN only, you know, multi-plateform stuff...
there is a brunch of methods in the sdk to open a child window :

Code: Select all

// there is a typo in the actual sdk, it's actually "sdkCreatDeskeWindow" 
// but it will be corrected in the next release
void* sdkCreateDeskWindow ();
void	sdkDestroyDeskWindow ();
void	sdkSetDeskWindowClientSize  (int clientWidth, int clientHeight);
void* sdkShowDeskWindow    ();
void	sdkHideDeskWindow    ();
you can use sdkCreateDeskWindow () plus sdkSetDeskWindowClientSize (int clientWidth, int clientHeight) to make your child window

it let open the question about populating this window in a multiplateform way...
in the pluginwrapper, i use juce, you can too if your module is under a juce compatible licence
of course, you can use any other UI lib you want

hope it help
Martin FLEURENT - Usine Developer - SDK maintainer

LevraiBernardo
Site Admin
Posts: 110
Contact:

Unread post by LevraiBernardo » 01 Oct 2014, 08:18

Yes Martgnasse. Thank you for your fast answer.
It works. I had seen these very usefull functions, but I really don't know how to populate the window (is there a way to catch a handle for it) ? So I went back to my old school CreateDialog function.
So how can I put my components (I use a datagrid Excel style) in this desk window ?

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 03 Oct 2014, 10:47

LevraiBernardo wrote:Yes Martgnasse. Thank you for your fast answer.
It works. I had seen these very usefull functions, but I really don't know how to populate the window (is there a way to catch a handle for it) ? So I went back to my old school CreateDialog function.
So how can I put my components (I use a datagrid Excel style) in this desk window ?
normally, the two methods :

Code: Select all

void* sdkCreateDeskWindow ();
void* sdkShowDeskWindow    ();
return a void* pointer which is the window handle
you have to cast it like this if you choose the pur windows route

Code: Select all

HWND WndHandle = (HWND)sdkCreateDeskWindow ();
i don't remember exactly, but with this handle, you can add your components ?

hope it help
Martin FLEURENT - Usine Developer - SDK maintainer

LevraiBernardo
Site Admin
Posts: 110
Contact:

Unread post by LevraiBernardo » 04 Oct 2014, 12:57

Sure it will help !
Now you told it, it's so clear. Thank you. I'll try and I'll give you news.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests