You get a better visual result because all colors near to black will get diferent opacity
Code: Select all
#include "hmg.ch"
Function Main
DEFINE WINDOW Form_1;
AT 0,0;
WIDTH 400;
HEIGHT 400 ;
TITLE 'Minimum: Windows Vista';
BACKCOLOR {0,0,0};
MAIN
@ 150,150 BUTTON Button_1 CAPTION "Set 2" ACTION DwmExtendFrameIntoClientArea (Form_1.HANDLE, -1, 0, 0, 0)
END WINDOW
// DwmExtendFrameIntoClientArea ( hWnd, cxLeftWidth, cxRightWidth, cyTopHeight, cyBottomHeight)
DwmExtendFrameIntoClientArea ( Form_1.HANDLE, 50, 50, 50, 50)
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return Nil
#pragma BEGINDUMP
#include "SET_COMPILE_HMG_UNICODE.ch"
#include "HMG_UNICODE.h"
#define _WIN32_WINNT 0x0501
#include <windows.h>
#include <Uxtheme.h>
#include "hbapi.h"
VOID *hDWMAPI = NULL;
typedef HRESULT (WINAPI * func_DwmExtendFrameIntoClientArea) (HWND, const MARGINS *);
BOOL HMG_DWMAPI ()
{
if (hDWMAPI == NULL)
hDWMAPI = LoadLibrary( _TEXT("Dwmapi.dll") );
if (hDWMAPI)
return TRUE;
else
return FALSE;
}
// DwmExtendFrameIntoClientArea (hWnd, cxLeftWidth, cxRightWidth, cyTopHeight, cyBottomHeight)
HB_FUNC ( DWMEXTENDFRAMEINTOCLIENTAREA )
{
HWND hWnd = (HWND) hb_parnl (1);
HRESULT nRet = ( HRESULT ) NULL;
MARGINS MarInset;
MarInset.cxLeftWidth = (int) hb_parnl (2);
MarInset.cxRightWidth = (int) hb_parnl (3);
MarInset.cyTopHeight = (int) hb_parnl (4);
MarInset.cyBottomHeight = (int) hb_parnl (5);
if( HMG_DWMAPI() )
{
func_DwmExtendFrameIntoClientArea pDwmExtendFrameIntoClientArea = ( func_DwmExtendFrameIntoClientArea ) GetProcAddress( hDWMAPI, "DwmExtendFrameIntoClientArea" );
if( pDwmExtendFrameIntoClientArea )
nRet = ( HRESULT ) pDwmExtendFrameIntoClientArea ( hWnd, &MarInset );
}
hb_retl( ( nRet == S_OK ) );
}
#pragma ENDDUMP