Page 1 of 1

DWM ( Desktop Windows Manager ) Sample Code

Posted: Wed Mar 16, 2022 10:42 pm
by AUGE_OHR
hi,

i saw that Code Sample from this Thread is not available any more
https://groups.google.com/g/harbour-users/c/sjeytL6zUPs
Image

so i upload Code from Kenny here
HB_DWM.ZIP
(3.22 KiB) Downloaded 89 times
! Note : Sample MUST run with

Code: Select all

..\..\build dwmkreis.hbp 
..\..\build dwmBlur.hbp 
while when load into IDE it will not work with

Code: Select all

-ldwmapi
which is in *.HBP

btw. i have try to include it into *.HBC

Code: Select all

Libs=dwmapi
but it seems not to work this Way

---

to made it "Full-Transparent" like in this Thread
https://www.hmgforum.com/viewtopic.php?f=5&t=7194
Image
you have to use

Code: Select all

BACKCOLOR { 1, 1, 1 }
in every Control (not possible with BUTTON, COMBOBOX while have no BACKCOLOR )

Re: DWM ( Desktop Windows Manager ) Sample Code

Posted: Thu Mar 17, 2022 4:33 am
by Claudio Ricardo
Hello... Instead of button control you can use image control with a transparent .png icon, I do like this.

Re: DWM ( Desktop Windows Manager ) Sample Code

Posted: Thu Jul 30, 2026 7:00 pm
by danielmaximiliano
AUGE_OHR wrote: Wed Mar 16, 2022 10:42 pm hi,

while when load into IDE it will not work with

Code: Select all

-ldwmapi
which is in *.HBP

btw. i have try to include it into *.HBC

Code: Select all

Libs=dwmapi
but it seems not to work this Way
Hola Jimmy, xomo no tengo el codigo fuente completo para probar IPTV con El Administrador de ventanas de escritorio (DWM)
puede usar esa misma libreria de Mingw64 desde esta ruta :

copiarla a c:\hmg.3.6\include desde "C:\hmg.3.6\mingw64\x86_64-w64-mingw32\include\dwmapi.h"
a c:\hmg3.6\lib64 desde "C:\hmg.3.6\mingw64\x86_64-w64-mingw32\lib\libdwmapi.a"

o en el archivo .hbc

Code: Select all

libpaths=C:\hmg.3.6\mingw64\x86_64-w64-mingw32\lib
incpaths=C:\hmg.3.6\mingw64\x86_64-w64-mingw32\include
libs=dwmapi
#include "hmg.ch"

FUNCTION Main()
DEFINE WINDOW Win_1 ;
AT 0, 0 WIDTH 600 HEIGHT 400 ;
TITLE "Prueba DWM en HMG" ;
MAIN

END WINDOW

// Obtenemos el Handle (HWND) de la ventana HMG
LOCAL hWnd := GetFormHandle("Win_1")

// Ejemplo: Activar modo oscuro en la barra de título (Windows 10/11)
// DWMWA_USE_IMMERSIVE_DARK_MODE = 20
DwmSetWindowAttributeInt( hWnd, 20, 1 )

CENTER WINDOW Win_1
ACTIVATE WINDOW Win_1
RETURN NIL


// ============================================================================
// C-WRAPPERS PARA DWM
// ============================================================================
#pragma BEGINDUMP

#ifndef WINVER
#define WINVER 0x0600
#endif

#include <windows.h>
#include <dwmapi.h>
#include "hbapi.h"

/*
* Permite cambiar atributos del DWM pasando un entero (ej: Modo Oscuro, Esquinas redondas)
* Sintaxis Harbour: DwmSetWindowAttributeInt( hWnd, nAttribute, nValue )
*/
HB_FUNC( DWMSETWINDOWATTRIBUTEINT )
{
HWND hwnd = (HWND) hb_parptr( 1 );
DWORD dwAttribute = (DWORD) hb_parni( 2 );
int nValue = hb_parni( 3 );

HRESULT hr = DwmSetWindowAttribute( hwnd, dwAttribute, &nValue, sizeof(nValue) );

hb_retnl( (LONG) hr );
}

/*
* Extender el marco de la ventana hacia el área de cliente (Efecto Glass/Blur)
* Sintaxis Harbour: DwmExtendFrameIntoClientArea( hWnd, nLeft, nTop, nRight, nBottom )
*/
HB_FUNC( DWMEXTENDFRAMEINTOCLIENTAREA )
{
HWND hwnd = (HWND) hb_parptr( 1 );
MARGINS margins;

margins.cxLeftWidth = hb_parni( 2 );
margins.cxRightWidth = hb_parni( 3 );
margins.cyTopHeight = hb_parni( 4 );
margins.cyBottomHeight = hb_parni( 5 );

HRESULT hr = DwmExtendFrameIntoClientArea( hwnd, &margins );

hb_retnl( (LONG) hr );
}

#pragma ENDDUMP

Re: DWM ( Desktop Windows Manager ) Sample Code

Posted: Fri Jul 31, 2026 8:31 am
by AUGE_OHR
hi
danielmaximiliano wrote: Thu Jul 30, 2026 7:00 pm
AUGE_OHR wrote: Wed Mar 16, 2022 10:42 pm hi,

while when load into IDE it will not work with

Code: Select all

-ldwmapi
which is in *.HBP

btw. i have try to include it into *.HBC

Code: Select all

Libs=dwmapi
but it seems not to work this Way
check i you have C:\BCC7\LIB\psdk\DWMAPI.a
Hola Jimmy, xomo no tengo el codigo fuente completo para probar IPTV con El Administrador de ventanas de escritorio (DWM)
puede usar esa misma libreria de Mingw64 desde esta ruta :
i use VLC ActiveX to Show IPTV (using *.M3U Files, include in ZIP File)

Code: Select all

         DEFINE ACTIVEX oxVLC
            PARENT Form_1
            ROW 0
            COL 0
            WIDTH aSize[ 1 ]
            HEIGHT aSize[ 2 ]
            PROGID "VideoLAN.VLCPlugin.2"
            TOOLTIP "right-click Mouse Menu"
         END ACTIVEX

Re: DWM ( Desktop Windows Manager ) Sample Code

Posted: Fri Jul 31, 2026 10:07 am
by AUGE_OHR
hi
Note : Not every Version of VLC seemes to work using IPTV !

This Version work : 3.0.18 Vetinari

Re: DWM ( Desktop Windows Manager ) Sample Code

Posted: Fri Jul 31, 2026 6:43 pm
by danielmaximiliano
AUGE_OHR wrote: Fri Jul 31, 2026 10:07 am hi
Note : Not every Version of VLC seemes to work using IPTV !

This Version work : 3.0.18 Vetinari

Look : https://hmgforum.com/viewtopic.php?t=7766

Re: DWM ( Desktop Windows Manager ) Sample Code

Posted: Sat Aug 01, 2026 3:28 am
by AUGE_OHR
hi,
danielmaximiliano wrote: Fri Jul 31, 2026 6:43 pm Look : https://hmgforum.com/viewtopic.php?t=7766
i mean just IPTV will not work Correct with some VLC Version. Video will work using all VLC Version.