In Clarion, the AppFrame window can hold an image, like your company logo, but the background can't have a color.
We all have seen windows like this before and they look really ugly!
Quite a while ago Jim Gambon posted a great solution for this on the Clarion Newsgroups.
GCL_HBRBACKGROUND EQUATE(-10)Then, in the Global Map:
! background color MODULE('Win32API') GetClassLong PROCEDURE(LONG thehWnd,LONG theIndex),LONG,PASCAL,NAME('GetClassLongA') SetClassLong PROCEDURE(LONG thehWnd,LONG theIndex,LONG theNewValue),LONG,PROC,PASCAL,NAME('SetClassLongA') CreateSolidBrush PROCEDURE(LONG TheColor),LONG,PASCAL,NAME('CreateSolidBrush') DeleteObject PROCEDURE(LONG theObject),LONG,PROC,PASCAL,NAME('DeleteObject') END !MODULE ! make sure that "Column 1" is ticked on
SaveNewBrush LONG SaveOldBrush LONGThe color is obtained after the windows opens, so we put the following into the embed right after its opening in ThisWindow.Init:
SaveOldBrush = GetClassLong(AppFrame{PROP:ClientHandle},GCL_HBRBACKGROUND) SaveNewBrush = CreateSolidBrush(0FFFFFFh) ! Solid White IF SaveNewBrush <> 0 SetClassLong(AppFrame{PROP:ClientHandle},GCL_HBRBACKGROUND,SaveNewBrush) END !IF
IF SaveOldBrush <> 0 SetClassLong(AppFrame{PROP:ClientHandle},GCL_HBRBACKGROUND,SaveOldBrush) SaveOldBrush = 0 END !IF IF SaveNewBrush <> 0 DeleteObject(SaveNewBrush) SaveNewBrush = 0 END !IF
Thats all! Add salt and pepper as you like....
You can download the sample source (Clarion 6.3 EE). This page was made on 12.06.2013.
Here you find some more samples