It is currently Thu Feb 25, 2021 9:24 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: PasswordBox
PostPosted: Wed Jan 16, 2002 6:58 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Code updated for 5.20+ (same as InputRequester() with Flag: #PB_InputRequester_Password)

Restored from previous forum. Originally posted by Rings.

A simple Inputbox with hidden Textgadget and KeyEvent.
based on an earlier InputRequester from Franco:

Code:
Procedure.s InputBox(Titel$)
  SizeX=220
  SizeY=100
  If OpenWindow(500,(GetSystemMetrics_(#SM_CXSCREEN)/2)-(SizeX/2),(GetSystemMetrics_(#SM_CYSCREEN)/2)-(SizeY/2),SizeX,SizeY,Titel$,0)
   
   
    hwnd=StringGadget(1,10,10,191,21,"")
    SendMessage_(hwnd,204,42,0)
    ButtonGadget(2,10,40,89,25,"Okay")
    ButtonGadget(3,110,40,89,25,"Abort")
    ;TextGadget(4,10,70,100,20,"TEST")
   
    SetForegroundWindow_(WindowID(500));SetForeGroundWindow_()
    ; ActivateGadget(1)
    Repeat
      EventID.l = WaitWindowEvent()
      Key.w= GetKeyState_( #VK_RETURN)
      If Key & %100000000000000
        ; MessageRequester("info","Return",0)
        dummy$=GetGadgetText(1)
        Quit=1
      EndIf
      ;SetGadgetText(4,Str(EventID)+":"+Str(Key.w))
     
      If EventID = #PB_Event_CloseWindow
        Quit=1
      EndIf
     
      If EventID = #PB_Event_Gadget
       
        Select EventGadget()
          Case 2
            dummy$=GetGadgetText(1)
            Quit=1
          Case 3
            Quit=1
        EndSelect
      EndIf
    Until Quit=1
  EndIf
  CloseWindow(500)
  ProcedureReturn dummy$
EndProcedure

Nop$=InputBox("Password")




Siggi


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Johanson and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye