Results 1 to 5 of 5
  1. #1
    cevatyildiz is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    9

    Hide Access 2010 runtime window


    Hello,

    My all forms are popup and runs in windowless with help of following codes in normal Access 2007 but whenever I try to run my project in Access 2010 runtime, it shows the background window. Can you give me a solution to hide background Access window?

    Code:
     
    Option Compare Database
    Option Explicit
    'Arka ekranı gizleme
    Public Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, _
    ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
    Public Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, _
    ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, _
    ByVal Y3 As Long) As Long
    Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, _
    ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, _
    ByVal nCombineMode As Long) As Long
    Public Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, _
    ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
    Public Const RGN_AND = 1
    Public Const RGN_COPY = 5
    Public Const RGN_DIFF = 4
    Public Const RGN_OR = 2
    Public Const RGN_XOR = 3
     
    Public Function degistir1()
    Dim rgn1 As Long, rgn2 As Long
     
    rgn1 = CreateRectRgn(0, 0, 1, 1)
    CombineRgn rgn1, rgn1, rgn2, RGN_OR
    SetWindowRgn Application.hWndAccessApp, rgn1, True
    End Function
     
    Form_Load()
    Call degistir1
    End sub

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Did you intend to mark this thread as Solved? If so, care to share your solution with others that read this Forum?

  3. #3
    cevatyildiz is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    9
    Yes, I found and used another code block rather than this one. It works very well...

    Code:
    Option Compare Database
    Option Explicit
    Global Const SW_HIDE = 0
    Global Const SW_SHOWNORMAL = 1
    Global Const SW_SHOWMINIMIZED = 2
    Global Const SW_SHOWMAXIMIZED = 3
    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
       Dim loform As Form
       On Error Resume Next
       Set loform = Screen.ActiveForm
       If Err <> 0 Then
          loX = apiShowWindow(hWndAccessApp, nCmdShow)
          Err.Clear
       End If
       If nCmdShow = SW_SHOWMINIMIZED And loform.Modal = True Then
          MsgBox "Cannot minimize Access with " _
                 & (loform.Caption + " ") _
                 & "form on screen"
       ElseIf nCmdShow = SW_HIDE And loform.PopUp <> True Then
          MsgBox "Cannot hide Access with " _
                 & (loform.Caption + " ") _
                 & "form on screen"
       Else
          loX = apiShowWindow(hWndAccessApp, nCmdShow)
       End If
       fSetAccessWindow = (loX <> 0)
    End Function
    Hope it works for anyone he will need
    Last edited by RuralGuy; 03-28-2011 at 07:01 AM. Reason: Added Code Tags

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Thanks for sharing.

  5. #5
    cevatyildiz is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2009
    Posts
    9
    it's a pleasure

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 02-19-2012, 04:40 PM
  2. access runtime for 2010
    By wthoffman in forum Access
    Replies: 1
    Last Post: 01-28-2011, 07:28 PM
  3. Access 2010 & Window 7
    By SlowPoke in forum Access
    Replies: 1
    Last Post: 12-05-2010, 02:56 AM
  4. Hide database window in Access 2010
    By Kevin Johnston in forum Access
    Replies: 5
    Last Post: 09-23-2010, 09:44 AM
  5. Hide the Database window
    By wasim_sono in forum Access
    Replies: 5
    Last Post: 02-02-2006, 06:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums