Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One: Private Sub Timer1_Timer()

Status
Not open for further replies.

jonybd

Programmer
Nov 3, 2002
166
BE
One:
Private Sub Timer1_Timer()
KeyBoardCancle 0
End Sub

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer

Public Function KeyBoardCancle(TwoEnable As Integer)
If GetAsyncKeyState(vbKeyMenu) Then
If GetAsyncKeyState(vbKeyTab) Then
If TwoEnable = 1 Then '< imageform and userpass form detect
SetTopMostWindow ImageForm.hwnd, True
SetTopMostWindow LoginForm.hwnd, True
LoginForm.UserName.SetFocus
End If

If TwoEnable = 0 Then '<---- mainform keyboard
SetTopMostWindow MainForm.hwnd, True
MainForm.SetFocus
End If
End If
End If
End Function

Part &quot;One:Working but is there any other way without useing Timer1 and let automaticaly block alt+Tab , alt+F4 , (my defined )
until my form unload those key wont work!.

Two:
I had a Form->BorderStyle = 0 (none)
But when i am Adding MenuItems
BorderStyle becomes Not 0 (none) (automaticaly)
is there any way not to let it automaticaly become not 0 !

 
Part One: Check out SetWindowsHookEx, specifically the WH_KEYBOARD section.

Part Two: I have no idea of how to prevent that. Maybe you can do something with SetWindowLong(Ptr) to change the style back again.
Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top