The window

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Marcosa1020
Posts: 168
Joined: 23 Sep 2015, 19:15

The window

Post by Marcosa1020 » 02 Jan 2018, 06:12

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 1110 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
Last edited by Marcosa1020 on 02 Jan 2018, 07:09, edited 2 times in total.

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: The window

Post by BoBo » 02 Jan 2018, 06:42

Your 100' posting :thumbup: Congrats.
Spoiler

Marcosa1020
Posts: 168
Joined: 23 Sep 2015, 19:15

Re: The window

Post by Marcosa1020 » 02 Jan 2018, 07:07

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?

Odlanir
Posts: 659
Joined: 20 Oct 2016, 08:20

Re: The window

Post by Odlanir » 02 Jan 2018, 14:27

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
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode

Marcosa1020
Posts: 168
Joined: 23 Sep 2015, 19:15

Re: The window

Post by Marcosa1020 » 03 Jan 2018, 08:08

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.

Post Reply

Return to “Ask for Help (v1)”