HMG 3.1.5

HMG Unicode versions 3.1.x related

Moderator: Rathinagiri

User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: HMG 3.1.5 (Test)

Post by andyglezl »

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
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: HMG 3.1.5 (Test)

Post by esgici »

andyglezl 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.
It's impossible to know why it gives a different number, without seeing source code of HDGETSERIAL :(

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
User avatar
danielmaximiliano
Posts: 2625
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: HMG 3.1.5 (Test)

Post by danielmaximiliano »

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
Andy :
probaste con el ejemplo que indique anteriormente ?
getserial.png
getserial.png (97.75 KiB) Viewed 4194 times
Getserial.rar
(7.63 KiB) Downloaded 273 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: HMG 3.1.5 (Test)

Post by andyglezl »

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.

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:         
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
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
danielmaximiliano
Posts: 2625
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: HMG 3.1.5 (Test)

Post by danielmaximiliano »

andyglezl wrote: Ahora me falta resolver la funcion MAKELAYER()
Now I need to solve MAKELAYER() function
Que hace esa funcion Andy ?.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: HMG 3.1.5 (Test)

Post by esgici »

Hola Andres
andyglezl wrote:Previous tests indicate that: A0BE7B3F = 2696837951 = -1598129345
I'm not a mathematician, but I know :

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 :D
User avatar
srvet_claudio
Posts: 2220
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: HMG 3.1.5 (Test)

Post by srvet_claudio »

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
Hi Andres,
display lines numbers 8007, 7998 and 8239 (+/- 10 lines) of file conad.prg
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: HMG 3.1.5 (Test)

Post by andyglezl »

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.
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
-------------------------------------------------------------------
La funcion MAKELAYER() hace transparente la ventana, aqui están la rutinas en "C":
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
Cades-layer.jpg (43.33 KiB) Viewed 4142 times
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: HMG 3.1.5 (Test)

Post by esgici »

esgici wrote: It's impossible to know why it gives a different number, without seeing source code of HDGETSERIAL :(
While digging my moldy archives, found two HDGETSERIAL functions :o

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.
Screen shoot of comparison HD Serial number functions
Screen shoot of comparison HD Serial number functions
HDSerComp.JPG (124.21 KiB) Viewed 4131 times
HDSerComp.zip
Source files of comparison HD Serial number functions
(1.27 KiB) Downloaded 234 times
Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
User avatar
srvet_claudio
Posts: 2220
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: HMG 3.1.5 (Test)

Post by srvet_claudio »

Para:
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 *'
cambia:
andyglezl wrote: 
HB_FUNC( HDGETSERIAL)
    {
    hb_retnl( Get_SerialNumber(hb_parc(1)) );
    }
por:

Code: Select all

HB_FUNC( HDGETSERIAL)
    {
    hb_retnl( Get_SerialNumber((char *) hb_parc(1)) );
    }
Para el error:
andyglezl wrote:conad.prg: In function 'HB_FUN_MAKELAYER':
conad.prg:8239:9: warning: implicit declaration of function 'SetLayeredWindowAttributes' [-Wimplicit-function-declaration]
Agrega al inicio enseguida del #pragma BEGINDUMP

Code: Select all

#define _WIN32_WINNT 0x0500
Con HMG.3.1.5 para hacer una ventana transparente tenes:

Code: Select all

SET WINDOW <cFormName> TRANSPARENT TO COLOR <aColor>
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Post Reply