News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

How to create a window with panes

Started by NoCforMe, February 05, 2022, 01:43:15 PM

Previous topic - Next topic

NoCforMe

So let's say a guy wants to create an application with a window containing several panes, something like OllyDbg, where the panes are linked together and mutually resize and all.

How would he do that? Is this something that requires Visual Studio? MFC? Can ResEd create something like this? Is it possible to "roll your own" (even though I'm sure that would be more work)? Perplexed here.
Assembly language programming should be fun. That's why I do it.

hutch--

The magic secret is the API MoveWindow().

NoCforMe

Quote from: hutch-- on February 05, 2022, 04:58:28 PM
The magic secret is the API MoveWindow().
You mean the function MoveWindow() in the Win32 API.  :dazzled:

But what about those nice seamless shared borders: how do you get those? Plus those dividers that you can grab and drag; those aren't normal window borders.
Assembly language programming should be fun. That's why I do it.

hutch--

> You mean the function MoveWindow() in the Win32 API

No, I meant what I said, the API MoveWindow().

NoCforMe

OK, but how do you get those shared borders and dividers? Those don't just happen when you put windows next to each other.
Assembly language programming should be fun. That's why I do it.

hutch--

GetClientRect() and/or GetWindowRect() for coordinates, then use MoveWindow() to position each child window to where you want it.

If you need to use GetWindowRect() which produces screen rather than client coordinates, you use either ScreenToClient() or the reverse ClientToScreen() to get the coordinates you need.

There is no easy way to do what you want.

TimoVJL

Olly seems to be a MDI application.
Inside window don't have to be real dividers, an illusion is enough, as frame window can act as divider for child windows.
Only GetClientRect() and MoveWindow() are needed with some global X and Y variables.
Client windows can have their own borders / shadows.
May the source be with you

jj2007

Hutch is right, there is no magic API that does the job for you - it's all MoveWindow. Probably, that is: Olly does not use standard controls. You should absolutely try WinID, it gives you a wealth of information about the controls used.

NoCforMe

I use WinSpy, which I think does about the same thing, give you info about whatever window (control) you click over.
Assembly language programming should be fun. That's why I do it.

TimoVJL

This silly program written in C have two panes.
http://masm32.com/board/index.php?topic=7483.msg81793#msg81793
With it, someone see a one way to do panes.
May the source be with you

HSE

There are several "mechanisms" that can be used to make those interfaces.

  • MultiWin Interface: Timo example and Olly use this mechanism, with one or more Splitters. You can resize or hide child windows, but relative position is fixed.
  • Multiple Document Interface (MDI): Is used more for repetition of similar windows, but you can make that with different windows.
  • Docking Windows: Windows can be moved to different niches or even out of application window dragging them with mouse. Very common in IDE like Visual Studio, RadAsm, EasyCode, etc
Most IDE programs use docking windows, but inside that windows they sometimes use the others mechanisms  :rolleyes:

Later I remembered that Zale don't like docking windows, then PB IDE is multiwin, with a MDI inside.
Equations in Assembly: SmplMath

Greenhorn

Quote from: NoCforMe on February 05, 2022, 01:43:15 PM
So let's say a guy wants to create an application with a window containing several panes, something like OllyDbg, where the panes are linked together and mutually resize and all.

How would he do that? Is this something that requires Visual Studio? MFC? Can ResEd create something like this? Is it possible to "roll your own" (even though I'm sure that would be more work)? Perplexed here.

In WM_SIZE use MoveWindow or better DeferWindowPos to arrange the child windows.
https://riptutorial.com/winapi/example/8080/wm-size

QuoteOK, but how do you get those shared borders and dividers? Those don't just happen when you put windows next to each other.
There is no common control for that. In a plain Win32 application, typically the main window is responsible to do this. Or you create your own "divider control".
http://www.catch22.net/tuts/win32/splitter-windows
Kole Feut un Nordenwind gift en krusen Büdel un en lütten Pint.

hutch--

In a single plane, think of 3 CreateWindowEx() windows side by side. The left one is a normal interface windows, the middle one is the splitter window and the right side one is another normal interface windows. The splitter window is where the control of resizing the left and right windows is performed. By using the mouse location, you can drag the splitter left or right. Within the control of the mouse moving the splitter window, you use MoveWindow() to control all 3 windows.

The left side window has its right side border changed. The splitter window maintains its width and the right side window is moved left to right with its right side border restricted to the right side of the parent window.

wjr

My Skeleton - Alive and Kicking example http://wjradburn.com/software/Skeleton.zip has two child windows using the main window to process messages for the "splitter bar" which is just the space between the two panes. A similar approach could be used for more panes, but would be a bit extra work for horizontal and vertical splits as in OllyDbg.

NoCforMe

Splitter bar--that's the key thing I was looking for. Looking at "Alive and Kicking" now. Thanks!
Assembly language programming should be fun. That's why I do it.