Code:
Gui, New, +hwndHwndGui
; Compose Gui controls
Gui, Add, Button, section , spiritual
Gui, Add, Button, , Oliver
Gui, Add, Button, , Internet
Gui, Add, Button, , Papal
Gui, Add, Button, ys , organizer
Gui, Add, Button, , Chris
Gui, Add, Button, , GMail
Gui, Add, Button, , Cheryl
Gui, Add, Button, ys , translit
Gui, Add, Button, , Resump
Gui, Add, Button, , AHK
Gui, Add, Button, , Calc
; Show the Gui, but make it invisible to retrieve the dimensions
Gui, Show, Hide
DetectHiddenWIndows, On ;necessary
WinGetPos,,, GuiWidth, GuiHeight, ahk_id %hWndGui%
WinGet, ControlListHwnd , ControlListHwnd, ahk_id %hWndGui%
; Add the picture with the retrieved dimensions.
Gui, Add, Picture, x0 y0 w%GuiWidth% h%GuiHeight% hwndhWndPicControl, C:\Users\Public\Pictures\Sample Pictures\Tulips.jpg
; Show Gui
Gui, Show,,my main
; Redraw only works when the window is visible
Loop, Parse, ControlListHwnd, `n
WinSet, Redraw,, ahk_id %A_LoopField%