CascadeWindows and TileWindows
-
Hi, friends, I create more than one windows (different instance but belongs to the same window class) on desktop, and want to manage them by "Cascade", "Tile Horizontally" and "Tile Vertically" commands. Of course the first idea is using window SDK functions: CascadeWindows(...), TileWindows(...). The problem arise however, The two functions will restore all other windows on desktop, which is not a good design of course. The solution is to write my own CascadeWindows and TileWindows subroutines. But I don't know how to do it. any idea? Thanks! wuwu
-
Hi, friends, I create more than one windows (different instance but belongs to the same window class) on desktop, and want to manage them by "Cascade", "Tile Horizontally" and "Tile Vertically" commands. Of course the first idea is using window SDK functions: CascadeWindows(...), TileWindows(...). The problem arise however, The two functions will restore all other windows on desktop, which is not a good design of course. The solution is to write my own CascadeWindows and TileWindows subroutines. But I don't know how to do it. any idea? Thanks! wuwu
If you look at the definition for CascadeWindows:
WORD CascadeWindows(
HWND hwndParent, // handle to parent window
UINT wHow, // types of windows not to arrange
CONST RECT *lpRect, // rectangle to arrange windows in
UINT cKids, // number of windows to arrange
const HWND *lpKids // array of window handles
);lpKids is an array that allows you to specify only the windows that you want to cascade. Therefore if you use
GetWindow
to enumerate and find only the window handles that you are interested in, you will be able to cascade the set of windows that you want.
Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life! -
Hi, friends, I create more than one windows (different instance but belongs to the same window class) on desktop, and want to manage them by "Cascade", "Tile Horizontally" and "Tile Vertically" commands. Of course the first idea is using window SDK functions: CascadeWindows(...), TileWindows(...). The problem arise however, The two functions will restore all other windows on desktop, which is not a good design of course. The solution is to write my own CascadeWindows and TileWindows subroutines. But I don't know how to do it. any idea? Thanks! wuwu
Hi, Finally were you able to find the solution. If yes please do post the same.
Priya Sundar