GET password

GET password

Postby byte-one » Mon Oct 10, 2016 1:49 pm

I will with a Checkbox change the status of a get from password to clear text and return. Which way i should go? Thanks.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: GET password

Postby Enrico Maria Giordano » Mon Oct 10, 2016 2:19 pm

This is a working sample:

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN( )

    LOCAL oDlg, oGet

    LOCAL cVar := SPACE( 20 )

    DEFINE DIALOG oDlg

    @ 1, 1 GET oGet VAR cVar PASSWORD

    @ 3, 1 BUTTON "Show/Hide";
           ACTION ( oGet:lPassword := !oGet:lPassword,;
                    oGet:Refresh() )

    ACTIVATE DIALOG oDlg;
           CENTER

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: GET password

Postby byte-one » Mon Oct 10, 2016 9:16 pm

Thanks, but not functioning. The effect is only, that the variable from the get is showing with the "Points" in lenght from the variable. The get is build from resource.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: GET password

Postby Enrico Maria Giordano » Mon Oct 10, 2016 9:21 pm

Did you try my sample?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: GET password

Postby Enrico Maria Giordano » Mon Oct 10, 2016 10:04 pm

Try this:

Code: Select all  Expand view
#include "Fivewin.ch"


#define EM_SETPASSWORDCHAR 0x00CC


FUNCTION MAIN( )

    LOCAL oDlg, oGet

    LOCAL cVar := SPACE( 20 )

    DEFINE DIALOG oDlg;
           RESOURCE "TEST"

    REDEFINE GET oGet VAR cVar;
             ID 101 OF oDlg

    REDEFINE BUTTON;
             ID 102 OF oDlg;
             ACTION ( oGet:lPassword := !oGet:lPassword,;
                      oGet:SendMsg( EM_SETPASSWORDCHAR, 0, 0 ),;
                      oGet:Refresh() )

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


Code: Select all  Expand view
TEST DIALOG 0, 0, 300, 300
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif"
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
{
 CONTROL "", 101, "EDIT", ES_LEFT | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 10, 10, 114, 13
 CONTROL "Hide/Show", 102, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 35, 41, 16
}


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: GET password (solved)

Postby byte-one » Tue Oct 11, 2016 7:37 am

Thanks!! This is functioning!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 67 guests