Try this one:

width = ( ( USHORT ) ( pWVT->PTEXTSIZE.x * pWVT->COLS ) ) + borderwidth;

SetWindowPos( pWVT->hWnd, NULL, left-(pWVT->bMaximized?3:0), top, width,
height, SWP_NOZORDER );

Then the windows shows up in right proportions at left and right edge.

Not for me. For me it shifts the window 3 pixels to
the left (when maximized), which makes part of the left
border go off screen.

Maybe we're talking about different things. What I want
to achieve is:

- "Maximize" means the largest possible font size, which
  still fits in a window, which in turn fits on the screen,
  with borders fully visible. (otherwise users cannot resize
  it easily). [ In this sense "maximize" is not what maximize
  means for regular Windows apps. ]
- On "maximize", window can be automatically positioned to
  the top left (0, 0) position, no problem with that.
- The screen content (the emulated console) should exactly
  fit inside the borders, without gaps and snaps. At all
  sizes.
  Too small screen should be somehow avoided, since I'm
  still getting those trashy windows, where the content
  is too small compated to the border.
- Toggling HB_GTI_RESIZABLE shouldn't resize the window.
- Minimizing to tray, than clicking on it to, shouldn't
  resize the window.
- Of course all the above should possible work with any
  customized Windows appearance. This comes down to
  measuring borders on all sides accurately.

Maybe there are other factors, but that should be enough
for first goals :)

Brgds,
Viktor

_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to