Aero effect
Moderator: Rathinagiri
Aero effect
Hello, searching in the web i found methods to make window border bigger and possible to put object inside this area.
But ever i try do it on my application it 'crash' using this command line:
calldll32("DwmExtendFrameIntoClientArea","Dwmapi.dll",getformhandle("Main"),{0,0,0,10})
But ever i try do it on my application it 'crash' using this command line:
calldll32("DwmExtendFrameIntoClientArea","Dwmapi.dll",getformhandle("Main"),{0,0,0,10})
- Attachments
-
- Like this
- frameintoclientarea.PNG (127.9 KiB) Viewed 6137 times
AMD Phenom II X6 1090T 3.2GHz (OverClock 3.9GHz) | Windows 8.1 Pro 64-bit
4GB DDR3 | GTX 550 Ti 1GB | MSI 880GMA-E35
4GB DDR3 | GTX 550 Ti 1GB | MSI 880GMA-E35
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Aero effect
Hi Meneale.
This is the code for call this function:
This is the code for call this function:
Code: Select all
#include "hmg.ch"
Function Main
DEFINE WINDOW Form_1;
AT 0,0;
WIDTH 400;
HEIGHT 400 ;
TITLE 'Minimum: Windows Vista';
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
-
- Posts: 1275
- Joined: Tue Sep 03, 2013 4:22 am
- Location: Tecámac, México
Re: Aero effect
Hola Cludio,
No logro apreciar el efecto. Utilizo Win 7.
Antes de pulsar el botón:
Después de pulsar el botón:
O qué es lo que se espera?
Saludos
No logro apreciar el efecto. Utilizo Win 7.
Antes de pulsar el botón:
Después de pulsar el botón:
O qué es lo que se espera?
Saludos
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Aero effect
+1Javier Tovar wrote:No logro apreciar el efecto. Utilizo Win 7.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: Aero effect
Thanks Claudio,
And about the problem is because the form has a backcolor, and works if you turn it to full transparency, but the window back is 'untouchable'
And about the problem is because the form has a backcolor, and works if you turn it to full transparency, but the window back is 'untouchable'
Code: Select all
#include "hmg.ch"
Function Main
DEFINE WINDOW Form_1;
AT 0,0;
WIDTH 400;
HEIGHT 400 ;
TITLE 'Minimum: Windows Vista';
BACKCOLOR {255,0,255} ;
ON INIT SetColorTransparency( getformhandle("form_1"), 0xff00ff );
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
#define GWL_EXSTYLE (-20)
#define WS_EX_LAYERED 524288
#define LWA_COLORKEY 1
#define LWA_ALPHA 2
/*
*/
SetWindowLong( hWnd, GWL_EXSTYLE, HB_BITOR( 0, WS_EX_LAYERED ) )
nRet := SetLayeredWindowAttributes( hWnd, 0, nAlpha, LWA_ALPHA )
IF VALTYPE(nRet) == 'N'
lRet := ( nRet > 0 )
ENDIF
RETURN( lRet )
/*
*/
FUNCTION SetColorTransparency( hWnd, nColor )
LOCAL nRet, lRet := .F.
SetWindowLong( hWnd, GWL_EXSTYLE, HB_BITOR( 0, WS_EX_LAYERED ) )
nRet := SetLayeredWindowAttributes( hWnd, nColor, 0, LWA_COLORKEY )
IF VALTYPE(nRet) == 'N'
lRet := ( nRet > 0 )
ENDIF
RETURN( lRet )
#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
- Attachments
-
- Final effect
- dwm.jpg (24.37 KiB) Viewed 6013 times
AMD Phenom II X6 1090T 3.2GHz (OverClock 3.9GHz) | Windows 8.1 Pro 64-bit
4GB DDR3 | GTX 550 Ti 1GB | MSI 880GMA-E35
4GB DDR3 | GTX 550 Ti 1GB | MSI 880GMA-E35
-
- Posts: 1275
- Joined: Tue Sep 03, 2013 4:22 am
- Location: Tecámac, México
Re: Aero effect
OK, ya salio como lo puso el amigo meneale...
Saludos
Saludos
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Aero effect
This demo is equivalent to the previous code of Meneale.Pablo César wrote:+1Javier Tovar wrote:No logro apreciar el efecto. Utilizo Win 7.
Code: Select all
#include "hmg.ch"
Function Main
DEFINE WINDOW Form_1;
AT 0,0;
WIDTH 400;
HEIGHT 400 ;
TITLE 'Minimum: Windows Vista';
ON INIT (SET WINDOW Form_1 TRANSPARENT TO COLOR BLUE );
BACKCOLOR BLUE;
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
-
- Posts: 1275
- Joined: Tue Sep 03, 2013 4:22 am
- Location: Tecámac, México
Re: Aero effect
Ok Claudio, excelente!
Gracias por compartir
Saludos
Gracias por compartir
Saludos
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Aero effect
Now ok, both examples.
Thank very much for sharing Meneale and Claudio !
Looks very nice windows !
Thank very much for sharing Meneale and Claudio !
Looks very nice windows !
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: Aero effect
+1Pablo César wrote:Now ok, both examples.
Thank very much for sharing Meneale and Claudio !
Looks very nice windows !
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG