LB Booster
General >> General Board >> Main Win, How to ..?
http://lbb.conforums.com/index.cgi?board=general&action=display&num=1431114755

Main Win, How to ..?
Post by SarmedNafi on May 8th, 2015, 7:52pm

Dear Richard,

I saw in your previous replay, how can we make the main win run in full screen, I make search in BBC tutorial I found nothing look like what you post.
However now I am asking if there is a way to let the main win appears in the upper left corner after we run the program with LBB?

Thank you for your efforts in LBB.
Sarmed
Re: Main Win, How to ..?
Post by Richard Russell on May 8th, 2015, 10:13pm

on May 8th, 2015, 7:52pm, SarmedNafi wrote:
I am asking if there is a way to let the main win appears in the upper left corner

If you know the window handle of the mainwin (for example by calling FindWindow, or using the !BBC-code escape) you can move it anywhere you like with the SetWindowPos API:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms633545.aspx

For example using the FindWindow method (for compatibility with LB4):

Code:
    title$ = "My Unique Window Title"
    TITLEBAR title$
    CALLDLL #user32, "FindWindowA", 0 AS LONG, _
      title$ AS PTR, hwmain AS ULONG
    flags = _SWP_NOSIZE OR _SWP_NOZORDER
    CALLDLL #user32, "SetWindowPos", hwmain AS ULONG, _
      0 AS LONG, 0 AS LONG, 0 AS LONG, 0 AS LONG, _
      0 AS LONG, flags AS LONG, ret AS LONG