-
Jan 20th, 2023, 11:46 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Form always on Down
Hello friends
I want the software to always run under other windows
Form always on Down
There is a way !?
-
Jan 20th, 2023, 12:09 PM
#2
Thread Starter
Addicted Member
Re: [RESOLVED] Form always on Down
This question has been asked before
Answer Link
-
Jan 21st, 2023, 03:54 PM
#3
Re: [RESOLVED] Form always on Down
A way maybe using subclassing, in the WM_WINDOWPOSCHANGING message, modifying the hwndInsertAfter parameter of the WINDOWPOS structure.
-
Jan 21st, 2023, 05:43 PM
#4
Re: [RESOLVED] Form always on Down
Not sure what you're trying to do, but this does a pretty good job of it:
Code:
Option Explicit
Private 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
Private Sub Form_Activate()
PutOnBottom
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
PutOnBottom
End Sub
Private Sub PutOnBottom()
Const SWP_NOSIZE As Long = 1&
Const SWP_NOMOVE As Long = 2&
Const HWND_BOTTOM As Long = 1&
SetWindowPos Me.hWnd, HWND_BOTTOM, 0&, 0&, 0&, 0&, SWP_NOSIZE Or SWP_NOMOVE
End Sub
It'd take a bit of subclassing (to know when it's truly activated) to do it in a broader context.
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
-
Jan 22nd, 2023, 05:02 PM
#5
Thread Starter
Addicted Member
Re: [RESOLVED] Form always on Down
Originally Posted by Elroy
Not sure what you're trying to do, but this does a pretty good job of it:
Code:
Option Explicit
Private 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
Private Sub Form_Activate()
PutOnBottom
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
PutOnBottom
End Sub
Private Sub PutOnBottom()
Const SWP_NOSIZE As Long = 1&
Const SWP_NOMOVE As Long = 2&
Const HWND_BOTTOM As Long = 1&
SetWindowPos Me.hWnd, HWND_BOTTOM, 0&, 0&, 0&, 0&, SWP_NOSIZE Or SWP_NOMOVE
End Sub
It'd take a bit of subclassing (to know when it's truly activated) to do it in a broader context.
Thank you Elroy
I used this code, but the only problem is that the mouse on the form must be moving
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|