Desktop Manager Z Order

Post any technical problems or questions you have while using or configuring Dexpot.
Bug-Tracker
SteveD

Desktop Manager Z Order

Postby SteveD » 11.12.2010 17:18:50

Trying Dexpot for first time. I like it very much, but one problem is giving me a big headache. About a million years ago, I wrote a Win32 app that resizes the top-of-z-order window with specific x,y,h,w values. It does this by calling SetWindowPos. When I use Dexpot Desktop Manager (DDM), it seems to intercept this action and the DDM window itself gets resized. It is as though DDM is the top-of-z-order window, even though my intented resize target app window clearly has focus.
I can get around this by using Dexpot desktop icons in systray, but I would rather use Desktop Manager. Any idea how I can get DDM to pass-thru the messages to my intended app window?

Using: Win XPsp2, Dexpot 1.5.7r1394
Thanks, SteveD

SteveD

Re: Desktop Manager Z Order

Postby SteveD » 11.12.2010 17:30:08

Forgot to mention - I will gladly send to you my little Win32 app (with source code) that does this resize call.

User avatar
Patrick
Developer
Posts: 7380
Joined: 04.03.2003 14:51:26

Re: Desktop Manager Z Order

Postby Patrick » 11.12.2010 17:46:25

:dex:

How do you determine which window to resize? If you want the window that has the focus, you should probably use GetForegroundWindow.

SteveD

Re: Desktop Manager Z Order

Postby SteveD » 11.12.2010 18:17:47

It's really quite the hack. My utility runs in systray, and when activated, it (systray) steals focus. So, to find the app window that needs resizing, I re-acquire the desktop stack, and walk through the window z-order until I find the most recent one that has a name, is visible, etc. The handle that is returned is the one that I resize (see code below). It works quite nicely.

It is no doubt important for Dexpot Desktop Manager to do whatever it's doing. Obviously, controlling multiple desktops requires some amount of control over the z-order. That's cool. I was just hoping that I wouldn't have to revisit my 12 year old utility. Oh well - if it's that important to me, maybe I will...

Thank you very much for your reply Patrick! And just so you know, Dexpot is pretty nice - I really think it will replace my use of PerfectScreens.

HWND GetPriorTopWindow()
{
HWND hwnd;
char buff[2];

hwnd = GetDesktopWindow();
hwnd = GetTopWindow(hwnd);
while ((GetWindowText(hwnd, buff, 2) == 0) || (GetParent(hwnd) != NULL) || !IsWindowVisible(hwnd))
hwnd = GetNextWindow(hwnd, GW_HWNDNEXT);
OutputDebugString(GetWindowInfo(g_hprevwnd, g_buff, sizeof(g_buff)));
return hwnd;
}


Return to “Support”

Who is online

Users browsing this forum: No registered users and 1 guest