• 0

always on top


Question

Recommended Posts

  • 0

You can't make things 'selectively always on top.' Windows internally stores an 'Is this window always on top' flag for each window, it's either true or false, there isn't an in-between or a z-order you can configure. The only case where you may be able to do this is if you want to make an MDI child window always on top but I'm not clear if that's what you want based off your post.

Link to comment
Share on other sites

  • 0

i have a trading application that has windows that i want always on top of my charts, but i dont want them on top of say irc when i bring it up thats running in the background..

Link to comment
Share on other sites

  • 0

here you can see whats going on:

this is the way i like it and use it:

capture.png

i have mirc running there as well and when i want to use it i dont want those windows to be on top of mirc, just on top of the trading app windows

capture.png

Link to comment
Share on other sites

  • 0

Alright, the child windows have an aero border so they're not MDI. I'm not sure if this is something an external application can do effectively as the only instance of the behavior you want that I've seen before is in Paint.Net with it's tool windows. I'll check what it's using to accomplish that.

Link to comment
Share on other sites

  • 0

Alright, the child windows have an aero border so they're not MDI. I'm not sure if this is something an external application can do effectively as the only instance of the behavior you want that I've seen before is in Paint.Net with it's tool windows. I'll check what it's using to accomplish that.

ok thanks for the help

Link to comment
Share on other sites

  • 0

Alright it looks like this may be as simple as calling SetWindowLongPtr with GWL_HWNDPARENT on the floating window and main app. I'll package it in a way you can use tomorrow as my tests have worked so far.

Link to comment
Share on other sites

  • 0

Alright it looks like this may be as simple as calling SetWindowLongPtr with GWL_HWNDPARENT on the floating window and main app. I'll package it in a way you can use tomorrow as my tests have worked so far.

i have no idea how to code if thats what you mean?

Link to comment
Share on other sites

  • 0

Alright it appears your application's Windows use dynamic titles so I'm going to need to know their Window class to identify them in code. Could you extract this archive, run the batch file and send me the out.txt it produces so I can find the window classes of your application and the floating window? (and if you could also tell me what the window title of your app and its floating window are when you post it so I can find them in the file that'd be helpful)

(Be aware, the out.txt will contain the title of all open windows. If there is anything private you don't want in the file either close the window first or remove it from the text file before you post it)

Once I have the window classes I can send you the program to make the windows act how you want them.

Source code for EnumWndClasses (the program in the archive) in case anyone wants it:

#include <iostream>
using namespace std;
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <TlHelp32.h>
#include <Psapi.h>

BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam) {
	char* title = new char[MAX_PATH];
	GetWindowText(hwnd, title, MAX_PATH);
	char* wclass = new char[MAX_PATH];
	GetClassName(hwnd, wclass, MAX_PATH);
	cout << title << "\t" << wclass << "\n";
	delete[] title;
	delete[] wclass;
	return TRUE;
}

int main(int argc, char** argv) {
	EnumWindows(EnumWindowsProc, 0);
}

Link to comment
Share on other sites

  • 0

well the window titles change all the time, thats prolly going to be a problem isnt it?

The fact that they change is why I need you to run that. Just tell me what they were (or take a screenshot) at the time that you run the batch file.

Link to comment
Share on other sites

  • 0

The fact that they change is why I need you to run that. Just tell me what they were (or take a screenshot) at the time that you run the batch file.

tried to run the batch and here is what happened:

capture.png

Link to comment
Share on other sites

  • 0

Alright it's working in my tests now so hopefully it'll work for you.

In order to find the correct windows it's currently making some assumptions about what you want and how your program operates which will hopefully hold correct:

  1. That control center window is open and the title contains "Control Center -" (after the dash it can be anything)
  2. The largest window in the same application as Control Center that isn't Control Center is the one all the smaller windows are attached to

Download

Source if anyone wants to see it

Link to comment
Share on other sites

  • 0

Alright it's working in my tests now so hopefully it'll work for you.

In order to find the correct windows it's currently making some assumptions about what you want and how your program operates which will hopefully hold correct:

  1. That control center window is open and the title contains "Control Center -" (after the dash it can be anything)
  2. The largest window in the same application as Control Center that isn't Control Center is the one all the smaller windows are attached to

Download

Source if anyone wants to see it

the big window that isnt the control center window that you are talking about isnt really attached to the always on top smaller windows, i just have those smaller windows on top of the larger one, but want them on top of it.. so what im saying is they are not bound by that larger window you are talking about.

i ran it and the black console box popped up and went away really fast and it doesnt look likes it working.. updated screenshot:

capture.png

also, how do i know if its running..?

Link to comment
Share on other sites

  • 0

the big window that isnt the control center window that you are talking about isnt really attached to the always on top smaller windows, i just have those smaller windows on top of the larger one, but want them on top of it.. so what im saying is they are not bound by that larger window you are talking about.

i ran it and the black console box popped up and went away really fast and it doesnt look likes it working.. updated screenshot:

also, how do i know if its running..?

It doesn't stay resident, it runs once and works as long as those windows are open. If it didn't work it may be that the windows are seperate exes, can you check in task manager's processes tab?

Link to comment
Share on other sites

  • 0

there seems to be only one process for that app with this windows in the processes tab, but they are separate in the applications tab... aka they are not like google chrome tabs if thats what you mean..

Link to comment
Share on other sites

  • 0

Instead of trying to create a new program why don't you try using this program?

we have the 'always on top' feature working.. what i want is the windows of this particular app that i set to always on top to only be on top of windows in this particular app and none of the other apps im running..

Link to comment
Share on other sites

  • 0

I see what you want...Wouldn't it be easier to just set the windows the way you want and then when you need to access another program have it maximize and minimize as needed without touching the other windows?

Link to comment
Share on other sites

  • 0

I see what you want...Wouldn't it be easier to just set the windows the way you want and then when you need to access another program have it maximize and minimize as needed without touching the other windows?

they are all separate windows, so when i bring one in front of the other or mess them up in anyway i have to go around clicking to get them in the right order again.. im a trader and all that fumbling around in no good..

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.