Hello!
I am trying to get this code to work.
It's for making **** in the field of an inputbox, so the password cant be seen.
I's originally a code for a 32 bit system, so the real challenge here is converting it to 64 bit.
The code are: - Public sPwd As String
-
Public gMsgTitle As String
-
Public gMsgType As String
-
Public gMsgText As String
-
Public gStatusText As String
-
-
"FindWindowA" (ByVal lpClassName As String, _
-
ByVal lpWindowName As String) As Long
-
-
Private Declare PtrSafe Function FindWindowEx Lib "user32" Alias _
-
"FindWindowExA" (ByVal hWnd1 As LongPtr, ByVal hWnd2 As LongPtr, _
-
ByVal lpsz1 As String, ByVal lpsz2 As String) As LongPtr
-
-
Public Declare PtrSafe Function SetTimer& Lib "user32" _
-
(ByVal hwnd&, ByVal nIDEvent&, ByVal uElapse&, ByVal _
-
lpTimerFunc&)
-
-
Public Declare PtrSafe Function KillTimer& Lib "user32" _
-
(ByVal hwnd&, ByVal nIDEvent&)
-
-
Private Declare PtrSafe Function SendMessage Lib "user32" Alias _
-
"SendMessageA" (ByVal hwnd As LongPtr, ByVal wMsg As LongPtr, _
-
ByVal wParam As LongPtr, lParam As Any) As LongPtr
-
-
Const EM_SETPASSWORDCHAR = &HCC
-
Public Const NV_INPUTBOX As Long = &H5000&
And Function: - Public Function TimerProc(ByVal lHwnd&, ByVal uMsg&, _
-
ByVal lIDEvent&, ByVal lDWTime&) As LongPtr
-
-
Dim lTemp As Long
-
Dim lEditHwnd As Long
-
lTemp = FindWindowEx(FindWindow("#32770", "gMsgText"), 0, "Edit", "")
-
lEditHwnd = FindWindowEx(FindWindow("#32770", "gMsgTitle"), 0, "Edit", "")
-
-
Call SendMessage(lEditHwnd, EM_SETPASSWORDCHAR, Asc("*"), 0)
-
-
KillTimer lHwnd, lIDEvent
-
End Function
Input box: - Private Sub OpnAdm_Click()
-
-
gMsgTitle = "Begrenset Omrde"
-
gMsgType = vbOKOnly + vbInformation
-
gMsgText = "Tast inn passord"
-
-
-
lTemp = SetTimer(Me.hwnd, NV_INPUTBOX, 1, AddressOf TimerProc)
-
sPwd = InputBox(gMsgText, gMsgTitle)
-
-
-
If strPasswd = "" Or strPasswd = Empty Then
-
Exit Sub
-
End If
-
-
If strPasswd = "yslg53481" Then
-
DoCmd.OpenForm "frmBatchReg"
-
Else
-
MsgBox "Beklager, du har ikke tilgang til denne delen av programmet", vbOKOnly, "Sikkerhetssjekk"
-
Exit Sub
-
End If
-
-
-
End Sub
Missing anything? The error I get is type missmatch on AddressOf TimerProc. But I know its also needs converting to 64 bit. Don't know how tough.
I know its 1000 times easyer to just make an new form and pwd mask the inputmask, but this is not the case here. I rather have more code and less forms, and it get's on my nerves that I cant find it out, so just need see this through, especially when so many other 32 bit users got it to work;)
Anyone know what to do here? :)
4 4461
I really don't know what all that code that you have created does, but I think that I have a solution that would be much simpler. Instead of using a prebuilt inputbox, create your own form and set its Modal property to Yes. This would allow you to put in your own textbox and set its Input Mask property to all stars. Just pass a true or false back to the calling form via a public variable to tell the calling form whether or not to allow the person to perform the next action.
Ty for answer, but the challenge here I am trying to overcome is to do it without a textbox ;)
An InputBox has a textbox. You don't have to have the textbox bound to a field, so there would be no tracking what was entered after the form is closed.
Ty for answers, but this took to much time. So I converted to 32 bit. Solved the whole problem :)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Yang |
last post by:
Hi
Is it possible to mask console input in a c# console application?
What I mean is: if I entered string "test" in the console, it'll echo
"****"(or nothing) instead of the string "test".
I've...
|
by: Nitin |
last post by:
I have created a console based application using C# which asks for the user identification to work using that system. Now, the problem is that i'm not able to hide or encrypt the password on the...
|
by: Joe Spin |
last post by:
Hi,
I'm using the TextBox.PasswordChar property with a '*' to mask passwords
written in the textbox.
In some workstations it works fine , but there are some workstations
(win2K and XP) that...
|
by: Les |
last post by:
Hi all, i have an input box that i need the user to put in a password
and just wondered if it is possible to just show a * as he types in the
letters as per the normal password inputbox ?
any...
|
by: xiang |
last post by:
I wanted to mask password using inputbox but how come when i enter the code to mask the password in vbscript, its show me error on 'Object required'.
|
by: jrtox |
last post by:
Hello, Can i ask help from you guys.
Ok, I want my records on the datagrid to be shown like " ******** " , not on readable format like "Password", .
But not changing the Original data on my...
|
by: Mai Le |
last post by:
Hello Expert,
I have a code below with inputbox. I would like to have format *** when I type in the box instead of word. So Please help. I did not know.
Thanks alot
Mai Le
Private Sub...
|
by: siyuangao |
last post by:
I made a program that require user input here is code:
while(Buffer != 13)
{
TempPass2.push_back(Buffer);
cout << '*';
Buffer = _getch();...
|
by: Ryno Bower |
last post by:
Hello all,
I have a table for users. One of the fields in this tblUsers has a password field with input mask password.
All is fine through the whole database!
My concern is when I go to excel...
|
by: SeadooRider |
last post by:
I have a form that has a toggle button to make visable a subform. In order to open the subform the user must proved a password. However, the part that isn't working correctly is that the password box...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |