Access Penceresini Gizledikten Sonra Donuyor

Katılım
25 Temmuz 2007
Mesajlar
18
Excel Vers. ve Dili
office 2007 proffessional
Option Compare Database

Global Const SW_HIDE = 0

Private Declare Function apiShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

Function fSetAccessWindow(nCmdShow As Long)
Dim loX As Long
loX = apiShowWindow(hWndAccessApp, nCmdShow)
fSetAccessWindow = (loX <> 0)
End Function


Merhaba Arkadaşlar yukarıdaki kodu bir module içine yazıyorum ve ilk açılan formun da yüklendiğinde olay yordamına aşağıdaki kodu yazıyorum.

fSetAccessWindow (SW_HIDE)

Access penceresi yok oluyor ve formlar arasında dolaşırken hiçbir sorun olmuyor, ancak daha sonra bu formdan bağımsız bir raporu açmak için ya da yazdırmak için butona bastığımda program donuyor ve hiçbir şekilde müdahale edemiyorum, bilgisayarı kapatmak zorunda kalıyorum. Kodu kendim yazmadım, başka bir dosyadan aldım, acaba sorunun ne olduğunu anlayan ve ne yapmam gerektiğini söyleyebilecek olan var mı? :yardim: Yardımınız için şimdiden çok teşekkürler.
 
Katılım
2 Mart 2006
Mesajlar
501
Excel Vers. ve Dili
2003 türkçe
alt formu olan formlarda bazen aynı sorunu bende yaşıyorum
1:bilgisayarı kapatma onun yerine Ctrl + del yap işlemlerden Access uygulamasının görevine son ver
2: Tüm forum ve raporları tasarım modunda aç özelliklerinden/Diger bölümünde açılan ve kalıcıyı Evet yap
3: ilk açılan formun özelliklerindeki açıldıgında olay yordamına Call ShowWindow(Application.hWndAccessApp, SW_HIDE)
bu kodu yaz
4: modüle1 icinede aşagıdaki kodu yaz birde böyle dene
Option Compare Database
Option Explicit

' This module contains the API-Declarations and application-specific implementations for
' all functions related to windowstates and -positions and -properties

Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Public Const WM_GETICON = &H7F
Public Const WM_SETICON = &H80

Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long

Public Type POINTAPI
x As Long
y As Long
End Type


Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long

Public Const GWL_STYLE = (-16)
Public Const WS_VISIBLE = &H10000000


Public Declare Function GetWindowPlacement Lib "user32" (ByVal hWnd As Long, lpwndpl As WINDOWPLACEMENT) As Long

Public Const SW_SHOW = 5
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_SHOWMINIMIZED = 2
Public Const SW_SHOWMINNOACTIVE = 7
Public Const SW_SHOWNA = 8
Public Const SW_SHOWNOACTIVATE = 4
Public Const SW_SHOWNORMAL = 1
Public Const SW_RESTORE = 9
Public Const SW_MINIMIZE = 6
Public Const SW_MAXIMIZE = 3
Public Const SW_HIDE = 0

Public Const SWP_SHOWWINDOW = &H40
Public Const HWND_TOPMOST = -1
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOMOVE = &H2

Public Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long


Public Type RECT
Left As Long
top As Long
Right As Long
Bottom As Long
End Type

Public Type WINDOWPLACEMENT
Length As Long
flags As Long
showCmd As Long
ptMinPosition As POINTAPI
ptMaxPosition As POINTAPI
rcNormalPosition As RECT
End Type

Const ABS_AUTOHIDE = &H1
Const ABS_ONTOP = &H2
Const ABM_GETSTATE = &H4
Const ABM_GETTASKBARPOS = &H5

Private Type APPBARDATA
cbSize As Long
hWnd As Long
uCallbackMessage As Long
uEdge As Long
rc As RECT
lParam As Long ' message specific
End Type

Private Declare Function SHAppBarMessage Lib "shell32.dll" (ByVal dwMessage As Long, pData As APPBARDATA) As Long

Public Function CursorOnTaskbar() As Boolean

' This function checks, wether the mousepointer is actually above
' the Taskbar

Dim curPoint As POINTAPI
Dim lngRetCur As Long
Dim lngRetTbarPos As Long
Dim barData As APPBARDATA

' Get the actual Cursor-Position (stored in curPoint)
lngRetCur = GetCursorPos(curPoint)

' This function is retrieving the coordinates of the windows Taskbar,
' which are stored in the rc-member of the APPBARDATA-Struct.
lngRetTbarPos = SHAppBarMessage(ABM_GETTASKBARPOS, barData)

If (lngRetCur <> 0) And (lngRetTbarPos <> 0) Then
If (curPoint.x > barData.rc.Left) And _
(curPoint.x < barData.rc.Right) And _
(curPoint.y < barData.rc.Bottom) And _
(curPoint.y > barData.rc.top) _
Then
CursorOnTaskbar = True
End If
End If

End Function


Public Function IsMinimized(hWnd As Long) As Boolean

' This function checks wether a window is minimized or not

Dim wndPl As WINDOWPLACEMENT
Dim lngRetVal As Long

lngRetVal = GetWindowPlacement(hWnd, wndPl)

If (wndPl.showCmd = SW_SHOWMINIMIZED) Then
IsMinimized = True
End If

End Function

Public Function IsVisible(hWnd As Long) As Boolean

' This function checks wether a window is visible or not

Dim lngRetVal As Long

lngRetVal = GetWindowLong(hWnd, GWL_STYLE)

If ((lngRetVal And WS_VISIBLE) = WS_VISIBLE) Then
IsVisible = True
End If

End Function


Public Sub bringWindowToFront(hWnd As Long)

' This function not only makes the window, identified by hWnd, visble
' but also brings that window to front of the Screen.

Call SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_SHOWWINDOW)

End Sub
Private Sub Form_Close()
Call ShowWindow(Application.hWndAccessApp, SW_SHOW)
Application.Quit
End Sub

Private Sub Form_Open(Cancel As Integer)
Call ShowWindow(Application.hWndAccessApp, SW_HIDE)
DoCmd.Restore
End Sub
 
Katılım
25 Temmuz 2007
Mesajlar
18
Excel Vers. ve Dili
office 2007 proffessional
ctrl + alt + delete ile de m&#252;dahale edemiyorum, burada g&#246;z&#252;km&#252;yor program dondu&#287;u zaman. yard&#305;m&#305;n i&#231;in te&#351;ekk&#252;r ederim, s&#246;ylediklerini yar&#305;n deniycem, art&#305;k sonucu yar&#305;n s&#246;ylerim, &#351;imdi uyumam gerek :) kolay gelsin, ba&#351;ar&#305;lar..
 
Katılım
26 Temmuz 2007
Mesajlar
155
Excel Vers. ve Dili
2003 türkçe
say&#305;n faramoza
raporu a&#231;&#305;l&#305;&#351;ta tam ekran olarak a&#231;&#305;lacak &#351;ekilde ayarlarsan bu sorun ortadan kalkacak.
 
Katılım
25 Temmuz 2007
Mesajlar
18
Excel Vers. ve Dili
office 2007 proffessional
sayın faramoza
raporu açılışta tam ekran olarak açılacak şekilde ayarlarsan bu sorun ortadan kalkacak.
Evet sayın hozzeybek, aynen söylediğiniz gibi raporu açılışta tam ekran olarak ayarlayınca sorun ortadan kalktı. ilk başta küçük ekran açılınca göze daha hoş geliyodu ama sağlık olsun :) yardımınız için çok teşekkür ederim. sayın simendifer size de ilginiz için tekrar teşekkür ederim. başka başlıklarda görüşmek dileğiyle, sağlıcakla kalın :hey:
 
Üst