Page 1 of 1
Posted: 28 Sep 2014, 08:55
by LevraiBernardo
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.
Posted: 28 Sep 2014, 13:22
by martignasse
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
Posted: 01 Oct 2014, 08:18
by LevraiBernardo
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 ?
Posted: 03 Oct 2014, 10:47
by martignasse
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
Posted: 04 Oct 2014, 12:57
by LevraiBernardo
Sure it will help !
Now you told it, it's so clear. Thank you. I'll try and I'll give you news.