Page 1 of 1

Posted: 12 Sep 2009, 18:33
by Gizzeta
Hi,

I would like to use windows scrollbar in my display module.
I need the handle to the module's window to set it...
How can i get it?
Or there's maybe another way?


thanks

Posted: 14 Sep 2009, 16:06
by senso
actually no way to get the form handle.
We'll correct it in the next SDK release.

Posted: 14 Sep 2009, 18:48
by martignasse
Gizzeta wrote:Hi,

I would like to use windows scrollbar in my display module.
I need the handle to the module's window to set it...
How can i get it?
Or there's maybe another way?


thanks
Hi Gizzeta,

It's funny that recently, i was testing some things around that.

It's possible to store the HINSTANCE of the module in a global variable by adding a DllMain function in the cpp file, like that :

Code: Select all

HINSTANCE hInstModule = NULL;

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					 )
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
        hInstModule = hModule;
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}
	return TRUE;
}
with the HINSTANCE, you should be able to add child widgets.

The big limitation of this hack is it's using global variable, so limiting you to one instance of you'r module in usine

Hope it help

Posted: 14 Sep 2009, 18:53
by senso
good tip Martin!

Posted: 14 Sep 2009, 19:48
by martignasse
senso wrote:good tip Martin!
I think it's should be a temporary hack
(I found this to be able to open a modless child window for a module, like the array set module)
senso wrote:actually no way to get the form handle.
We'll correct it in the next SDK release.
Yes, handle and/or instance of the module should be provided by usine. ;)
It's more secure and powerfull.

Posted: 14 Sep 2009, 23:50
by Gizzeta
I'll try, thanks.