MDI Background Image

Discussion forum about all things Team Developer 7.x
Gueni
Austria
Posts: 5
Joined: 22 Aug 2017, 14:22
Location: Klagenfurt am Wörthersee, Austria

MDI Background Image

Post by Gueni » 22 Aug 2017, 15:00

Hi all,

I used a background.dll up to version 5. In Version 7 I get now from the compiler: Error: Cannot load external library with different bitness. You may try to load 32 bit DLL from 64 bit TD.

Is there a more convenient way to display a simple jpg in an MDI Window? - or can anybody provide a 64 bit background.dll with the Setimage, Loadpicture,.. functions?

Thanks for your help.

User avatar
Charlie
Canada
Posts: 270
Joined: 07 Mar 2017, 18:52
Location: Fredericton, New Brunswick, Canada

MDI Background Image

Post by Charlie » 22 Aug 2017, 16:10

Here's how I've set things up in our TD5.2SP3 app: a modeless dialog with a picture object, the picture object being set to tile to parent.

We create the dialog box as a child to the MDI window with the following:

Code: Select all

Set whMDIClient = GetWindow( hWndMDI, GW_CHILD )
Loop
	If fnGetClassName( whMDIClient ) = 'MDIClient'
		Set hWndMdiBackground = SalCreateWindowEx( dlgWithBackgroundPic, whMDIClient, 0, 0, 0, 0, CREATE_AsChild )
		Break
	Set whMDIClient = GetWindow( whMDIClient, GW_HWNDNEXT )
	If NOT whMDIClient
		Break
The function fnGetClassName:

Code: Select all


Function: fnGetClassName
	Description: refers to GetClassNameA
	Returns
		String: wh
	Parameters
		Window Handle: wh
	Static Variables
	Local variables
		String: s
	Actions
		Call SalSetBufferLength( s, 40 )
		Call GetClassNameA( wh, s, 40 )
		Return s

Cheers !
A little trick to help direct folk from old Gupta forum to this one: Link to post

Gueni
Austria
Posts: 5
Joined: 22 Aug 2017, 14:22
Location: Klagenfurt am Wörthersee, Austria

MDI Background Image

Post by Gueni » 24 Aug 2017, 12:09

Thanks a lot Charlie,

can you help me with the code of: GetClassNameA
Where do I get this function?

Gueni

memic
Germany
Posts: 21
Joined: 07 Mar 2017, 08:51
Location: Germany

MDI Background Image

Post by memic » 24 Aug 2017, 12:19

This ist not working on TD 7.

Code: Select all

fnGetClassName( whMDIClient ) = 'MDIClient'
wont find the class because it doesn't exist in TD7?

Gueni: in TD7 you I think have to use

Code: Select all

Call SalSetBufferLength( s, 82 )
Call GetClassNameW( wh, s, 82 )
from user32.dll

Code: Select all

!!CB!! 81
Library name: user32.dll
	ThreadSafe: No
	Function: GetClassNameW
		Description:
		Export Ordinal: 0
		Returns
			Number: INT
		Parameters
			Window Handle: HWND
			Receive String: LPWSTR
			Number: INT

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 1083
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

MDI Background Image

Post by Dave Rabelink » 24 Aug 2017, 20:31

The classname is:

Gupta:MDIClient
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

User avatar
Charlie
Canada
Posts: 270
Joined: 07 Mar 2017, 18:52
Location: Fredericton, New Brunswick, Canada

MDI Background Image

Post by Charlie » 25 Aug 2017, 10:41

G'day,

Here's the function GetClassNameA, as defined in External Functions (Global Declarations) :

Code: Select all

Library name: USER32.DLL
	ThreadSafe: No
	Function: GetClassNameA
		Description:
		Export Ordinal: 0
		Returns
			Number: INT
		Parameters
			Window Handle: HWND
			Receive String: LPSTR
			Number: INT
NOTE: We are using the "ANSI" version of the function, and really should change that to the "UNICODE" version (GetClassNameW)

Info about "GetClassName": https://msdn.microsoft.com/en-us/librar ... s.85).aspx

And, you'll find a ton of good stuff in the SalExtension libraries: http://samples.tdcommunity.net/index ... Extension/
A little trick to help direct folk from old Gupta forum to this one: Link to post

Gueni
Austria
Posts: 5
Joined: 22 Aug 2017, 14:22
Location: Klagenfurt am Wörthersee, Austria

MDI Background Image

Post by Gueni » 30 Aug 2017, 09:41

Thank you all for your Inputs. FYI I put a development request in at opentext. It just has to be easier to Display a simple pix in a window. Let you know how
quick opentext can respond to customer requests. cheers Gueni

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot], Holger, memic and 1 guest