[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Make window not on a top

Posted on 1999-01-20
5
Medium Priority
?
169 Views
Last Modified: 2010-05-03
How I can from VB send window from another program(which is
always on a top but not modal) to back???
0
Comment
Question by:igorshul
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 4

Expert Comment

by:chabaud
ID: 1469641
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_TOPMOST = &H8&

'You must pass the window handle
Public Sub SetNoTopmost(ByVal hWnd As Long)
   
    Dim wexstyle As Long
   
    wexstyle = GetWindowLong(hWnd, GWL_EXSTYLE)
    wexstyle = (wexstyle And (Not WS_EX_TOPMOST))
    SetWindowLong hWnd, GWL_EXSTYLE, wexstyle

End Sub

0
 

Author Comment

by:igorshul
ID: 1469642
This one doesn't work.
How you find window handle if this window from another program?
But even when I get window handle those functions not working...
0
 
LVL 1

Expert Comment

by:BabyFace
ID: 1469643
How did you find the window handles?
FindWindow?
If not, try FindWindow function.

0
 
LVL 3

Accepted Solution

by:
luisr earned 200 total points
ID: 1469644
Call FindWindow("window classname", "caption"). If you know the class name you can pass it as the class name, and pass NULL as the caption argument. Otherwise, pass NULL as classname and pass the window caption as the second arg.

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal szClass As String, ByVal szCaption As String) As Long

FindWindow will return the window handle, which you can pass to the SetNoTopmost() subroutine written by chebada.

0
 
LVL 1

Expert Comment

by:BabyFace
ID: 1469645
Ok,
Thanks for stealing my answer Luisr.
You're such an asshole.
What a cheap way to get your kicks.

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question