Hello!

I am trying to get this access 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. (Have 
2013 access, not 2010 fortunatley;)

I know its 1000 times easier to just make a 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? :) 

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to