HMG 3.1.5
Moderator: Rathinagiri
Re: HMG 3.1.5 (Test)
con MsgInfo( STR( VolSerial( "C:" ) ) obtengo "2696837951".
Entonces no me queda claro porque HDGETSERIAL me da otro
numero diferente ???. Creo que tendre que cambiar de todos modos.
Gracias
-------------------------------------------------------------------
with MsgInfo( STR (VolSerial("C:") ) I get "2696837951".
So I'm not clear because HDGETSERIAL gives me another
different number???. I think I'll have to change anyway.
thanks
Entonces no me queda claro porque HDGETSERIAL me da otro
numero diferente ???. Creo que tendre que cambiar de todos modos.
Gracias
-------------------------------------------------------------------
with MsgInfo( STR (VolSerial("C:") ) I get "2696837951".
So I'm not clear because HDGETSERIAL gives me another
different number???. I think I'll have to change anyway.
thanks
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: HMG 3.1.5 (Test)
It's impossible to know why it gives a different number, without seeing source code of HDGETSERIALandyglezl wrote: with MsgInfo( STR (VolSerial("C:") ) I get "2696837951".
So I'm not clear because HDGETSERIAL gives me another
different number???. I think I'll have to change anyway.

Happy HMG'ing

Viva INTERNATIONAL HMG 

- danielmaximiliano
- Posts: 2625
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: HMG 3.1.5 (Test)
Andy :andyglezl wrote:con MsgInfo( STR( VolSerial( "C:" ) ) obtengo "2696837951".
Entonces no me queda claro porque HDGETSERIAL me da otro
numero diferente ???. Creo que tendre que cambiar de todos modos.
Gracias
-------------------------------------------------------------------
with MsgInfo( STR (VolSerial("C:") ) I get "2696837951".
So I'm not clear because HDGETSERIAL gives me another
different number???. I think I'll have to change anyway.
thanks
probaste con el ejemplo que indique anteriormente ?
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Re: HMG 3.1.5 (Test)
OK, Ya me funciona el ejecutable. ( quite la funcion MAKELAYER )
La funcion HDGETSERIAL("c:\") la he estado utilizando desde hace años pero no recuerdo
de donde la obtuve, ademas esta en C y siempre despliega el "warning" al compilar.
---------------------------------------------------------------------------------------
OK, I already runs the executable. (Remove the function MAKELAYER)
The function HDGETSERIAL ("c: \") I've been using for years but can not remember
where I got it, also is in C and always displays the "warning" to compile.
---------------------------------------------------------------------------------------
Harbour 3.2.0dev (r1307180024)
Copyright (c) 1999-2013, http ://harbour-project.org/
conad.prg: In function 'HB_FUN_HDGETSERIAL':
conad.prg:8007:5: warning: passing argument 1 of 'Get_SerialNumber' discards 'const' qualifier from pointer target type [enabled by default]
conad.prg:7998:19: note: expected 'char *' but argument is of type 'const char *'
conad.prg: In function 'HB_FUN_MAKELAYER':
conad.prg:8239:9: warning: implicit declaration of function 'SetLayeredWindowAttributes' [-Wimplicit-function-declaration]
Warning: resolving _SetLayeredWindowAttributes by linking to _SetLayeredWindowAttributes@16
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
-----------------------------------------------------------------------
resumiendo.
summarizing.
A fin de cuentas, llegue al mismo resultado. Gracias.
After all, reach the same result.Thanks.
Ahora me falta resolver la funcion MAKELAYER()
Now I need to solve MAKELAYER() function
La funcion HDGETSERIAL("c:\") la he estado utilizando desde hace años pero no recuerdo
de donde la obtuve, ademas esta en C y siempre despliega el "warning" al compilar.
---------------------------------------------------------------------------------------
OK, I already runs the executable. (Remove the function MAKELAYER)
The function HDGETSERIAL ("c: \") I've been using for years but can not remember
where I got it, also is in C and always displays the "warning" to compile.
---------------------------------------------------------------------------------------
Harbour 3.2.0dev (r1307180024)
Copyright (c) 1999-2013, http ://harbour-project.org/
conad.prg: In function 'HB_FUN_HDGETSERIAL':
conad.prg:8007:5: warning: passing argument 1 of 'Get_SerialNumber' discards 'const' qualifier from pointer target type [enabled by default]
conad.prg:7998:19: note: expected 'char *' but argument is of type 'const char *'
conad.prg: In function 'HB_FUN_MAKELAYER':
conad.prg:8239:9: warning: implicit declaration of function 'SetLayeredWindowAttributes' [-Wimplicit-function-declaration]
Warning: resolving _SetLayeredWindowAttributes by linking to _SetLayeredWindowAttributes@16
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
-----------------------------------------------------------------------
resumiendo.
summarizing.
Code: Select all
----------------------------------------------------------
HDGETSERIAL() // -1598129345
----------------------------------------------------------
VOL en D.O.S. // A0BE7B3F
NTOC (VolSerial ("C:"), 16) // A0BE7B3F
STR( VolSerial( "C:" ) ) // 2696837951
NTOC( 2696837951, 16 ) ) // A0BE7B3F
NumToHex( VolSerial( "C:" ) ) // A0BE7B3F
NumToHex( HDGETSERIAL("c:\") ) // FFFFFFFFA0BE7B3F
----------------------------------------------------------
Las pruebas anteriores indican que: A0BE7B3F = 2696837951 = -1598129345
Previous tests indicated that:
After all, reach the same result.Thanks.
Ahora me falta resolver la funcion MAKELAYER()
Now I need to solve MAKELAYER() function
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- danielmaximiliano
- Posts: 2625
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: HMG 3.1.5 (Test)
Que hace esa funcion Andy ?.andyglezl wrote: Ahora me falta resolver la funcion MAKELAYER()
Now I need to solve MAKELAYER() function
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: HMG 3.1.5 (Test)
Hola Andres
A0BE7B3F = 2696837951
is correct, but
2696837951 = -1598129345
not !
If your function(s) are in binary format ( .lib or anything else ) it's difficult to help you, I think
Saludos
I'm not a mathematician, but I know :andyglezl wrote:Previous tests indicate that: A0BE7B3F = 2696837951 = -1598129345
A0BE7B3F = 2696837951
is correct, but
2696837951 = -1598129345
not !
If your function(s) are in binary format ( .lib or anything else ) it's difficult to help you, I think

Saludos
Viva INTERNATIONAL HMG 

- srvet_claudio
- Posts: 2220
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: HMG 3.1.5 (Test)
Hi Andres,andyglezl wrote:OK, Ya me funciona el ejecutable. ( quite la funcion MAKELAYER )
La funcion HDGETSERIAL("c:\") la he estado utilizando desde hace años pero no recuerdo
de donde la obtuve, ademas esta en C y siempre despliega el "warning" al compilar.
---------------------------------------------------------------------------------------
OK, I already runs the executable. (Remove the function MAKELAYER)
The function HDGETSERIAL ("c: \") I've been using for years but can not remember
where I got it, also is in C and always displays the "warning" to compile.
---------------------------------------------------------------------------------------
Harbour 3.2.0dev (r1307180024)
Copyright (c) 1999-2013, http ://harbour-project.org/
conad.prg: In function 'HB_FUN_HDGETSERIAL':
conad.prg:8007:5: warning: passing argument 1 of 'Get_SerialNumber' discards 'const' qualifier from pointer target type [enabled by default]
conad.prg:7998:19: note: expected 'char *' but argument is of type 'const char *'
conad.prg: In function 'HB_FUN_MAKELAYER':
conad.prg:8239:9: warning: implicit declaration of function 'SetLayeredWindowAttributes' [-Wimplicit-function-declaration]
Warning: resolving _SetLayeredWindowAttributes by linking to _SetLayeredWindowAttributes@16
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
-----------------------------------------------------------------------
Ahora me falta resolver la funcion MAKELAYER()
Now I need to solve MAKELAYER() function
display lines numbers 8007, 7998 and 8239 (+/- 10 lines) of file conad.prg
Re: HMG 3.1.5 (Test)
Yo reprobé matematicas, asumo que es igual en base al resutado obtenido.
I failed in mathematics, I assume it's just based on the result set obtained.
The MAKELAYER() function makes the window transparent,Here are the routines in "C":
-------------------------------------------------------------------
Gracias. Thanks.
I failed in mathematics, I assume it's just based on the result set obtained.
La funcion MAKELAYER() hace transparente la ventana, aqui están la rutinas en "C":HDGETSERIAL() // -1598129345
----------------------------------------------------------
VOL en D.O.S. // A0BE7B3F
NTOC (VolSerial ("C:"), 16) // A0BE7B3F
STR( VolSerial( "C:" ) ) // 2696837951
NTOC( 2696837951, 16 ) ) // A0BE7B3F
NumToHex( VolSerial( "C:" ) ) // A0BE7B3F
NumToHex( HDGETSERIAL("c:\") ) // FFFFFFFFA0BE7B3F
-------------------------------------------------------------------
The MAKELAYER() function makes the window transparent,Here are the routines in "C":
Code: Select all
unsigned long Get_SerialNumber(char* RootPathName)
{
unsigned long SerialNumber;
GetVolumeInformation(RootPathName, NULL, 0, &SerialNumber, NULL, NULL, NULL, 0);
return SerialNumber;
}
HB_FUNC( HDGETSERIAL)
{
hb_retnl( Get_SerialNumber(hb_parc(1)) );
}
---------------------------------------------
#define WS_EX_LAYERED 0x80000
#define LWA_COLORKEY 1
#define LWA_ALPHA 2
WINUSERAPI
BOOL
WINAPI
SetLayeredWindowAttributes(
HWND hwnd,
COLORREF crKey,
BYTE bAlpha,
DWORD dwFlags);
HB_FUNC ( GETWINDOWLONG )
{
hb_retnl( ( LONG ) GetWindowLong( ( HWND ) hb_parnl( 1 ), hb_parni( 2 ) ) );
}
HB_FUNC ( SETWINDOWPOS )
{
HWND hwnd = (HWND) hb_parnl(1); // handle to window or control
HWND hWndInsertAfter= (HWND) hb_parnl(2); // placement-order handle
int X = hb_parni(3); // horizontal position
int Y = hb_parni(4); // vertical position
int cx = hb_parni(5); // width
int cy = hb_parni(6); // height
UINT uFlags = (UINT) hb_parni(7); // window-positioning options
hb_retl( (BOOL) SetWindowPos( hwnd, hWndInsertAfter, X, Y, cx, cy, uFlags ) );
}
HB_FUNC ( SETLAYEREDWINDOWATTRIBUTES )
{
HWND hwnd = (HWND) hb_parnl(1); // handle to window or control
COLORREF crKey = (COLORREF) hb_parnl(2);
BYTE bAlpha = (BYTE) hb_parni(3);
DWORD dwFlags = (DWORD) hb_parni(4);
hb_retl( (BOOL) SetLayeredWindowAttributes(hwnd, crKey, bAlpha, dwFlags) );
}
HB_FUNC (MAKELAYER)
{
HWND hwnd = (HWND) hb_parnl(1);
COLORREF crKey = (COLORREF) hb_parnl(2);
SetWindowLong (hwnd , GWL_EXSTYLE ,
GetWindowLong (hwnd , GWL_EXSTYLE ) | WS_EX_LAYERED ) ;
SetLayeredWindowAttributes(hwnd, 0, crKey, LWA_ALPHA);
}
Gracias. Thanks.
- Attachments
-
- Cades-layer.jpg (43.33 KiB) Viewed 4141 times
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: HMG 3.1.5 (Test)
While digging my moldy archives, found two HDGETSERIAL functionsesgici wrote: It's impossible to know why it gives a different number, without seeing source code of HDGETSERIAL![]()

No any neat and useful hint but as far as I see ;
if function used by Andres is the same and
function invoked from other than current drive and
no parameter ( drive code ) specified
than it returns a negative value.
Happy HMG'ing

Viva INTERNATIONAL HMG 

- srvet_claudio
- Posts: 2220
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: HMG 3.1.5 (Test)
Para:
Para el error:
Con HMG.3.1.5 para hacer una ventana transparente tenes:
cambia:andyglezl wrote: conad.prg: In function 'HB_FUN_HDGETSERIAL':
conad.prg:8007:5: warning: passing argument 1 of 'Get_SerialNumber' discards 'const' qualifier from pointer target type [enabled by default]
conad.prg:7998:19: note: expected 'char *' but argument is of type 'const char *'
por:andyglezl wrote:
HB_FUNC( HDGETSERIAL)
{
hb_retnl( Get_SerialNumber(hb_parc(1)) );
}
Code: Select all
HB_FUNC( HDGETSERIAL)
{
hb_retnl( Get_SerialNumber((char *) hb_parc(1)) );
}
Agrega al inicio enseguida del #pragma BEGINDUMPandyglezl wrote:conad.prg: In function 'HB_FUN_MAKELAYER':
conad.prg:8239:9: warning: implicit declaration of function 'SetLayeredWindowAttributes' [-Wimplicit-function-declaration]
Code: Select all
#define _WIN32_WINNT 0x0500
Code: Select all
SET WINDOW <cFormName> TRANSPARENT TO COLOR <aColor>