How do i get my access 2003 Windows to always appear above all other applications running?
Window priority above other apps.
Collapse
X
-
Hi. I have moved your thread to the access forumOriginally posted by HutchHow do i get my access 2003 Windows to always appear above all other applications running? -
I should have the answer for you shortly. It involves an API call and the Handle to the Main Access Window. Please be patient.Originally posted by HutchHow do i get my access 2003 Windows to always appear above all other applications running?Comment
-
As previously promised, the following code will make the 'Main Access Window' always appear above all other running applications. First the API Declaration:Originally posted by HutchHow do i get my access 2003 Windows to always appear above all other applications running?
NOTE: Use extreme caution whenever using API Calls and always backup your Database prior to experimenting. The slightest Syntax or other Error could cause a General Protection Fault. This code has been tested on Access 2003 and does, in fact, work:Code: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
Now the code:
Code:Private Sub Form_Open(Cancel As Integer) Dim wFlags As Long, lngX As Long wFlags = &H2 Or &H1 Or &H40 Or &H10 lngX = SetWindowPos(Application.hWndAccessApp, -1, 0, 0, 0, 0, wFlags) End Sub
Comment
-
So check it out i am using this code in a command click button now. Sometimes i want it to remain above other apps other times i don't so far i have thisOriginally posted by ADeziiThat is a considerable Trade Off.
Private Sub Pri_Click_Click ()
If Me.Pri_Click = True Then
Dim wFlags As Long, lngX As Long
wFlags = &H2 Or &H1 Or &H40 Or &H10
lngX = SetWindowPos(Ap plication.hWndA ccessApp, -1, 0, 0, 0, 0, wFlags)
If Me.Pri_Click = False Then GoTo Ext_Pri
End If
Ext_Pri:
End Sub
Do you happen to know the code to take the Window Priority away?
Any help would be amazing, thanks in advance.Comment
-
Try the following code segment to turn OFF the TopMost Attribute:Originally posted by HutchSo check it out i am using this code in a command click button now. Sometimes i want it to remain above other apps other times i don't so far i have this
Private Sub Pri_Click_Click ()
If Me.Pri_Click = True Then
Dim wFlags As Long, lngX As Long
wFlags = &H2 Or &H1 Or &H40 Or &H10
lngX = SetWindowPos(Ap plication.hWndA ccessApp, -1, 0, 0, 0, 0, wFlags)
If Me.Pri_Click = False Then GoTo Ext_Pri
End If
Ext_Pri:
End Sub
Do you happen to know the code to take the Window Priority away?
Any help would be amazing, thanks in advance.
[CODE=vb]Dim wFlags As Long, lngX As Long
wFlags = &H10 Or &H40
lngX = SetWindowPos(Ap plication.hWndA ccessApp, -2, 0, 0, 0, 0, wFlags)[/CODE]Comment
-
Dim wFlags As Long, lngX As Long
wFlags = &H10 Or &H40
lngX = SetWindowPos(Ap plication.hWndA ccessApp, -2, 0, 0, 0, 0, wFlags)
I figured out that the H10 and H40 was the cause of the screen movement, I changed them to 2 and 1 like in the previouse code but kept the -2. this works great.Comment
-
Glad you figured it out.Originally posted by HutchDim wFlags As Long, lngX As Long
wFlags = &H10 Or &H40
lngX = SetWindowPos(Ap plication.hWndA ccessApp, -2, 0, 0, 0, 0, wFlags)
I figured out that the H10 and H40 was the cause of the screen movement, I changed them to 2 and 1 like in the previouse code but kept the -2. this works great.Comment
Comment