• Welcome to Valhalla Legends Archive.
 

Always On Top.

Started by LordNevar, April 15, 2005, 12:10 PM

Previous topic - Next topic

LordNevar

I am currently running multiple monitors, and specifically running Diablo II in a window seeming how it cuts down on the chopiness, and game lag while playing it in full mode. I am trying to find out if there's a way to keep Diablo II open at all times on my other screen without it minimizing to the tray. If there's a cmd line shortcut, or if there's a Windows tweak or something that allows you to keep a window on top of all other windows at all times. I have tried to google for my answer but the only thing I get are programs to do it, and none of them seem to work with the Diablo II window, any help would be appreciated.

A good fortune may forbode a bad luck, which may in turn disguise a good fortune.
The greatest trick the Devil ever pulled, was convincing the world he didn't exsist.

UserLoser.

Game.exe has a "-w" command line option to play it in a window.  I don't think it makes it always on top, though, but you could easily write a program (or someone else could), or find a program to set the windows position to always on top

Zakath

Just write a hack to get a handle to the window and send it a message.
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

Joe[x86]

StealthBot 1.39's Winamp Module seems to have some nice HWnd-getting code. Always works on winamp, anyhow, and a slight modification should get you your Diablo II HWnd.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

Tazo

Powermenu, google it.

R.a.B.B.i.T

Option Explicit

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
    (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
   
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_Load()
    Dim winHandle As Long

    Dim strProcess As String
    strProcess = "Game.exe"  '  replace with w/e you want to on-top-erize

    winHandle = FindWindow(vbNullString, strProcess)
   
    If winHandle = 0 Then
        MsgBox "Could not find window."
        Exit Sub
    End If
   
    Const HWND_TOPMOST = -1
    Const SWP_NOSIZE = 1
    Const SWP_NOMOVE = 2
    Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
   
    SetWindowPos winHandle, HWND_TOPMOST, 0, 0, 0, 0, FLAGS
End Sub


Works with some things (like Winamp and API-Guide), but not with others (like Diablo II).