|
-
Feb 28th, 2001, 09:01 AM
#1
Thread Starter
New Member
Hello Everyone!
I have a PDF file being opened in a OCX control in one of my forms, and it requires a password before it can be opened. However, I do not want the user to enter the password. Right now, I have my program set up to watch for the "Password" window, and then it sets the focus on it, and generates the password entry with simulated keystrokes. However, I would like to know if this is the best method. Part of the problem is that someone can run a key logger and get the password, and another problem is if a key is being held down while my program enters the password. Any ideas around any of these "problems" would be greatly appreciated. Thanks in advance!
Jeremy Lounds
-
Feb 28th, 2001, 12:32 PM
#2
Try sending the WM_SETTEXT message rather than sending the actual keystrokes.
Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_SETTEXT = &HC
Private Sub Command1_Click()
SendMessage hwnd_of_window, WM_SETTEXT, 0, ByVal "MyPassword"
End Sub
-
Feb 28th, 2001, 05:29 PM
#3
Thread Starter
New Member
Hmmm... I must be doing something wrong, because when I tried that, it changed the actual caption of the window, and not the text entry field.
Not something I want, that's for sure! :-)
Jeremy
-
Feb 28th, 2001, 06:13 PM
#4
Change hwnd_of_window to the handle of the password entry box.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|