FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour GET password
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
GET password
Posted: Mon Oct 10, 2016 01: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: GET password
Posted: Mon Oct 10, 2016 02:19 PM
This is a working sample:

Code (fw): Select all Collapse
#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
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: GET password
Posted: Mon Oct 10, 2016 09: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: GET password
Posted: Mon Oct 10, 2016 09:21 PM

Did you try my sample?

EMG

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: GET password
Posted: Mon Oct 10, 2016 10:04 PM
Try this:

Code (fw): Select all Collapse
#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 (fw): Select all Collapse
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
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: GET password (solved)
Posted: Tue Oct 11, 2016 07:37 AM

Thanks!! This is functioning!

Regards,
Günther
---------------------------------
office@byte-one.com

Continue the discussion