Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Capturing proxy Username and password


Message #1 by "Satyajeet Hattangadi" <satyajh@m...> on Tue, 23 Jul 2002 15:15:58 +0530
This is a multi-part message in MIME format.

------=_NextPart_000_001B_01C23305.348E76C0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Thank you Marco & Jack for your inputs...

3 questions

1) This logon screen is browser specific.It is not generated by my 
application but by windows itself ( if i have IE installed the window 
caption will be "Enter Netwrok Password" for netscape it is 
"Auntentication required").I can enumerate the windows but how will i 
get the hwnd of this specific window? as the text will never be same.. 
so findowindow will fail

2) In win2k  getwindowtext fails( security feature micorsoft has added 
:(
.

3) what event can i use to findout that the user has finished entering 
data??

I know this can be done as when i install yahoo messenger for first time 
when i try to connect this logon box pops up. after i enter the proxy 
authentication details, yahoo messenger stores the data i have entered 
in the registry. SO technically speaking if they can do so can i...

Thanks,
Satyajeet
  ----- Original Message -----
  From: Jack Dunstan
  To: professional vb
  Sent: Wednesday, July 24, 2002 12:42 AM
  Subject: [pro_vb] RE: Capturing proxy Username and password


  Yes I agree its hard to know the best implementation without seeing 
the poster's code where this would be implemented.  The typical 
implementation for this is inside some event where you can do a 
ctrl.SetFocus, like:

  Sub SomeEvent(ctrl as Control, ..... )
      ctrl.SetFocus
      GetWindowText(GetFocus(), lpString, nMaxCount)

  Which makes it easy of course.  I believe the GetFocus() will return 
the correct hWnd, but that's assuming the cursor is in the password text 
box, so if the user hits the enter key then the hWnd is now on the enter 
button and the GetWindowText would return the text/caption for the enter 
button (or whatever he's using) - so definitely no guarentees - just 
depends on when/what event he can use to know the user has finished with 
the password entry.

  Jack

    ----- Original Message -----
    From: Straforini, Marco
    To: professional vb
    Sent: Tuesday, July 23, 2002 2:41 PM
    Subject: [pro_vb] RE: Capturing proxy Username and password


    good idea Jack.

    Yes, but only if the window that has the focus is in the same thread 
(from the original posting
    I cannot be sure). And I do not know if GetFocus returns the main 
dialog (in that case
    GetWindowText returns the dialog caption) or the window of the 
control.

    Marco
      -----Original Message-----
      From: Jack Dunstan [mailto:jdunstan7@h...]
      Sent: Tuesday, July 23, 2002 11:35 AM
      To: professional vb
      Subject: [pro_vb] RE: Capturing proxy Username and password


      Hi Marco,

      Would he be able to use the GetFocus API to get the window handle, 
i.e. declare:

      Declare Function GetFocus Lib "user" () As Integer

      Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" 
(ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long

      in code:
      sStringLen =3D GetWindowText(GetFocus(), lpString, nMaxCount);

      Just a thought.

      Jack

    --- Visual C# - A Guide for VB6 Developers This book will make it 
easy to transfer your skills from Visual Basic 6 to C#, the language of 
choice of the .NET Framework. 
http://www.wrox.com/ACON11.asp?ISBN=3D1861007175&p2p0059 --- Change your 
mail options at http://p2p.wrox.com/manager.asp or to unsubscribe send a 
blank email to 
  --- Visual C# - A Guide for VB6 Developers This book will make it easy 
to transfer your skills from Visual Basic 6 to C#, the language of 
choice of the .NET Framework. 
http://www.wrox.com/ACON11.asp?ISBN=3D1861007175&p2p0059 --- Change your 
mail options at http://p2p.wrox.com/manager.asp or to unsubscribe send a 
blank email to 


  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.361 / Virus Database: 199 - Release Date: 07/05/2002

*********************************************************
Disclaimer

This message (including any attachments) contains
confidential information intended for a specific
individual and purpose, and is protected by law.
If you are not the intended recipient, you should
delete this message and are hereby notified that
any disclosure, copying, or distribution of this
message, or the taking of any action based on it,
is strictly prohibited.

*********************************************************
Visit us at http://www.mahindrabt.com



  Return to Index