19/02/2011, 12:30
bir soronum daha var, yeni kayıt ekleme kısayol tuşuna bastıktan sonra imleçin ilk sekmeye gelmesini istiyorum,kod yazmam gerek sanırım,nasıl yapabilriim?
(19/02/2011, 12:30)mehmetb84 yazdı: [ -> ]bir soronum daha var, yeni kayıt ekleme kısayol tuşuna bastıktan sonra imleçin ilk sekmeye gelmesini istiyorum,kod yazmam gerek sanırım,nasıl yapabilriim?
(11/09/2011, 05:13)serkandiker yazdı: [ -> ]Peki auto keys özelliğini istediğimiz form açıldığında aktif etme şansımız varmı ???
Private Declare Function SetWindowLong _
Lib "user32" Alias "SetWindowLongA" ( _
ByVal hWnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function CallWindowProc _
Lib "user32" Alias "CallWindowProcA" ( _
ByVal lpPrevWndFunc As Long, _
ByVal hWnd As Long, _
ByVal Msg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Private Declare Function RegisterHotKey _
Lib "user32.dll" ( _
ByVal hWnd As Long, _
ByVal id As Long, _
ByVal fsModifiers As Long, _
ByVal vk As Long) As Long
Private Const WM_HOTKEY As Long = &H312
Private Const VK_SNAPSHOT As Long = &H2C
Private Const GWL_WNDPROC = (-4)
Private Const WM_DESTROY = &H2&
Private Const MOD_ALT As Long = &H1
Private hHandle As Long
Private hPrevWndProc As Long
Public Sub HookPrtSc(frmHandle As Long)
hHandle = frmHandle
'Register both Alt+PrtSc and only PrtSc as hotkeys
RegisterHotKey hHandle, 1, MOD_ALT, VK_SNAPSHOT
RegisterHotKey hHandle, 2, 0, VK_SNAPSHOT
hPrevWndProc = SetWindowLong(hHandle, GWL_WNDPROC, AddressOf WinProc)
End Sub
Public Sub Unhook()
SetWindowLong hHandle, GWL_WNDPROC, hPrevWndProc
End Sub
Private Function WinProc(ByVal hWnd As Long, ByVal uMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Dim sFile As String
Dim nSize As Long
Select Case uMsg
Case WM_HOTKEY
WinProc = 1
Exit Function
Case WM_DESTROY
Call Unhook
End Select
WinProc = CallWindowProc(hPrevWndProc, hWnd, uMsg, wParam, lParam)
End Function
Private Sub Form_Load()
HookPrtSc Me.hWnd
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unhook
End Sub