Page 1 of 1

The window

Posted: 02 Jan 2018, 06:12
by Marcosa1020
Hi all,

When code B is activated, window_B will be opened on screen at x35 y150.
If I active code A, and then active code B, How can I make window_B open on window_C's x35 y150 position?
A bit like this :
6.jpg
6.jpg (36.81 KiB) Viewed 964 times
Please let me know if my question is unclear. Thank you.

Code A:

Code: Select all

Gui, Font, S10 C000000 , Tahoma
Gui, Show, x400 y400 h400 w400,Window_C
Return
GuiClose:
ExitApp
Code B:

Code: Select all

Gui +AlwaysOnTop
Gui, Font, S10 C000000 , Tahoma
Gui, Show, x131 y91 h155 w188,Window_A
Gui, MyGui: +AlwaysOnTop
Gui, MyGui:Show, x35 y150 h350 w280,Window_B
Gui, MyGui:Font, S7 C000000 , Tahoma
WinSet, ExStyle, +0x20, Window_B
WinSet, Transparent, 150, Window_B
WinSet, AlwaysOnTop, On, Window_B

Gui, MyGui:Add, Text, x20 y100 C000000, 1
Gui, MyGui:Add, Text, x40 y100 C000000, 2
Gui, MyGui:Add, Text, x60 y100 C000000, 3
Gui, MyGui:Add, Text, x80 y100 C000000, 4
Gui, MyGui:Add, Text, x100 y100 C000000, 5
Gui, MyGui:Add, Text, x120 y100 C000000, 6
Gui, MyGui:Add, Text, x140 y100 C000000, 7
Gui, MyGui:Add, Text, x160 y100 C000000, 8
Return
GuiClose:
ExitApp

Re: The window

Posted: 02 Jan 2018, 06:42
by BoBo
Your 100' posting :thumbup: Congrats.
Spoiler

Re: The window

Posted: 02 Jan 2018, 07:07
by Marcosa1020
Yes, BoBo.
Thank you so much.
By the way, do you know how can I make window_B open on window_C's x35 y150 position?

Re: The window

Posted: 02 Jan 2018, 14:27
by Odlanir
Since is not clear what you want to achieve ( what about window_A ? ), this is a simple way for showing a window relatively to another window.
Hope this helps.
Cheers

Code: Select all

Gui +AlwaysOnTop
Gui, Show, x400 y300 h400 w400,Window_C

WinGetPos, x,y,w,h, Window_C
Gui, MyGui: +AlwaysOnTop
Gui, MyGui:Show,% "x" X+35 " y" Y+150 "  h200 w200",Window_B
Return

esc::
GuiClose:
GuiEscape:
   ExitApp

Re: The window

Posted: 03 Jan 2018, 08:08
by Marcosa1020
Odlanir wrote:Since is not clear what you want to achieve ( what about window_A ? ), this is a simple way for showing a window relatively to another window.
Hope this helps.
Cheers

Code: Select all

Gui +AlwaysOnTop
Gui, Show, x400 y300 h400 w400,Window_C

WinGetPos, x,y,w,h, Window_C
Gui, MyGui: +AlwaysOnTop
Gui, MyGui:Show,% "x" X+35 " y" Y+150 "  h200 w200",Window_B
Return

esc::
GuiClose:
GuiEscape:
   ExitApp
Hi Odlanir,
Done. The Window_A is another program. Thank you so much.