Welcome to %s forums

BrainModular Users Forum

Login Register

scrollbars

Create your own modules in C++
Post Reply
Gizzeta
Member
Posts: 42
Location: Paris
Contact:

Unread post by Gizzeta » 12 Sep 2009, 18:33

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

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 14 Sep 2009, 16:06

actually no way to get the form handle.
We'll correct it in the next SDK release.

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

Unread post by martignasse » 14 Sep 2009, 18:48

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
Martin FLEURENT - Usine Developer - SDK maintainer

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 14 Sep 2009, 18:53

good tip Martin!

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

Unread post by martignasse » 14 Sep 2009, 19:48

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.
Martin FLEURENT - Usine Developer - SDK maintainer

Gizzeta
Member
Posts: 42
Location: Paris
Contact:

Unread post by Gizzeta » 14 Sep 2009, 23:50

I'll try, thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests