DWM ( Desktop Windows Manager ) Sample Code

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

DWM ( Desktop Windows Manager ) Sample Code

Post 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 91 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 )
have fun
Jimmy
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: DWM ( Desktop Windows Manager ) Sample Code

Post by Claudio Ricardo »

Hello... Instead of button control you can use image control with a transparent .png icon, I do like this.
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
User avatar
danielmaximiliano
Posts: 2716
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: DWM ( Desktop Windows Manager ) Sample Code

Post 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
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: DWM ( Desktop Windows Manager ) Sample Code

Post 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
Attachments
IPTV.ZIP
(238.29 KiB) Downloaded 27 times
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: DWM ( Desktop Windows Manager ) Sample Code

Post by AUGE_OHR »

hi
Note : Not every Version of VLC seemes to work using IPTV !

This Version work : 3.0.18 Vetinari
have fun
Jimmy
User avatar
danielmaximiliano
Posts: 2716
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: DWM ( Desktop Windows Manager ) Sample Code

Post 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
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: DWM ( Desktop Windows Manager ) Sample Code

Post 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.
have fun
Jimmy
Post Reply