|
-
Oct 20th, 2002, 09:20 PM
#1
Thread Starter
Addicted Member
Windows At Back
I found a lot of code teaching how to put the window on top of others.
Do anybody know how to put one's window at the back of all other windows (they are of different exe programs)
Thanks
-
Oct 20th, 2002, 09:30 PM
#2
VB 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 Const SWP_FRAMECHANGED = &H20
Private Const SWP_NOACTIVATE = &H10
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOREDRAW = &H8
Private Const SWP_NOSIZE = &H1
Private Const SWP_SHOWWINDOW = &H40
Private Const SWP_ALL = SWP_FRAMECHANGED Or SWP_NOACTIVATE Or SWP_NOMOVE Or _
SWP_NOSIZE Or SWP_SHOWWINDOW
Private Const HWND_BOTTOM = 1
Private Sub Command1_Click()
Call SetWindowPos(hwnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_ALL)
End Sub
That won't lock the window at the bottom of the order, but it will get moved there until it gets activated again.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Oct 20th, 2002, 09:49 PM
#3
The picture isn't missing
i found that using setparent and place it in the desktop listview it will always stay bottom.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Oct 20th, 2002, 09:57 PM
#4
Thread Starter
Addicted Member
Thanks crptcblade, I will try
BuggyProgrammer, would you mind to elaborate the code used?
-
Oct 20th, 2002, 11:57 PM
#5
Fanatic Member
VB Code:
Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal _
hWndChild As Long, ByVal hWndNewParent As Long) As Long
'Then go find the Desktop sysListView's handle and ur app's
'handle, then
SetParent Me.hWnd, LstViewhWnd
ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
Programming is fun, but only if you're not on a tight deadline 
So I consider all those working engineers sad people
VB FTP class
3 page PHP crash course
Crash Course on DX9 Managed with VB.NET covering basics till terrain creation
-
Jun 1st, 2017, 06:56 PM
#6
Fanatic Member
Re: Windows At Back
 Originally Posted by jian2587
VB Code:
Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal _ hWndChild As Long, ByVal hWndNewParent As Long) As Long 'Then go find the Desktop sysListView's handle and ur app's 'handle, then SetParent Me.hWnd, LstViewhWnd
Desktop sysListView's? how to do that?. a enum windows name search?
-
Jun 2nd, 2017, 07:02 AM
#7
Re: Windows At Back
jian25887's last post was in June 2008. PROBABLY not checking this forum any more. Might be best if you start your own thread.
-
Jun 2nd, 2017, 11:14 AM
#8
-
Jun 2nd, 2017, 11:35 AM
#9
Fanatic Member
Re: Windows At Back
 Originally Posted by Dragokas
What it is in multi-monitors systems?
-
Jun 2nd, 2017, 12:33 PM
#10
Fanatic Member
Re: Windows At Back
 Originally Posted by Dragokas
I tryed to replace those FindWindow, with the GetDesktopWindow, but didn't work, so what is the difference in the pointer fetched?
this works
Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" ( _
ByVal hWnd1 As Long, _
ByVal hWnd2 As Long, _
ByVal lpsz1 As String, _
ByVal lpsz2 As String) As Long
Private Declare Function SetParent Lib "user32" ( _
ByVal hWndChild As Long, _
ByVal hWndNewParent As Long) As Long
Private Sub Form_Load()
Dim ProgMan&, shellDllDefView&, sysListView&
ProgMan = FindWindow("progman", vbNullString)
shellDllDefView = FindWindowEx(ProgMan&, 0&, "shelldll_defview", vbNullString)
sysListView = FindWindowEx(shellDllDefView&, 0&, "syslistview32", vbNullString)
SetParent Me.hwnd, sysListView
End Sub
and this don't work
Code:
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function SetParent Lib "user32" ( _
ByVal hWndChild As Long, _
ByVal hWndNewParent As Long) As Long
Private Sub Form_Load()
Dim sysListView&
sysListView = GetDesktopWindow()
SetParent Me.hWnd, sysListView
End Sub
-
Jun 3rd, 2017, 01:26 PM
#11
Re: Windows At Back
 Originally Posted by flyguille
Desktop sysListView's? how to do that?. a enum windows name search?
Please do not post up or bump old threads. Just create your own new thread and add a link to this thread, for example, for reference as needed otherwise this thread, and all old threads, will need to be closed from commenting.
Thanks
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
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
|