This is my code:
Code: Select all
Gui, -Caption +LastFound +AlwaysOnTop
Gui, +Border
Gui, Margin, 0, 0
Gui, Color, white
Gui, Add, Picture, x0 y0 w1 h52, 1x52.png
Gui, Show, x100 y600 w200 h398
How can I do this in the correct way?
Code: Select all
Gui, -Caption +LastFound +AlwaysOnTop
Gui, +Border
Gui, Margin, 0, 0
Gui, Color, white
Gui, Add, Picture, x0 y0 w1 h52, 1x52.png
Gui, Show, x100 y600 w200 h398
Code: Select all
Menu, Tray, Icon, moricons.dll, 36
#NoEnv ; Recommended for performance and future compatibility.
#Persistent ; Keeps a script permanently running until user closes it or ExitApp is encountered.
#SingleInstance, Force ; Determines whether a script is allowed to run again when it is already running.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶
;
^T::
; ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ These will download original image samples from maestrith's post...
; ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ Or use the included testing samples included. Must remain in same location as script.
; IfNotExist,tile.bmp,UrlDownloadToFile,http://www.maestrith.com/files/tile.bmp,tile.bmp
; IfNotExist,lens.png,UrlDownloadToFile,http://i.imgur.com/pGL6k.png,lens.png
; ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶
Gui,
+Resize ; Makes the window resizable and enables its maximize button in the title bar.
+AlwaysOnTop ; Makes a window stay on top of all other windows.
OnMessage(0x136,"WM_CTLCOLORDLG")
; ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ WM_CTLCOLORDLG message: Sent to a dialog box before the system draws the dialog box. By responding to this message, the dialog box can set its text and background colors using the specified display device context handle.
Gui, Margin, 15, 15
Gui, Font, S12 Bold, Arial Black
Gui, Add, Picture, xm ym+11 BackgroundTrans, BAT.png ; Image inside Gui.
Gui, Add, Text, y+5 cBlue , Tiled Background ; Text inside Gui.
Gui, Show,, GUI with 'Tiled background' ; Titlebar Text.
Sleep 10
Return
; ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ Must use bmp image. Change with personal choice below. "TILED2.bmp" is example.
WM_CTLCOLORDLG(){
Static wBrush
If !wBrush
hBM:=DllCall("LoadImage",Int,0,Str,"TILED2.bmp",Int,0,Int,0,Int,0,UInt,0x2010),wBrush:=DllCall("CreatePatternBrush",UInt,hBM)
Return wBrush
}
GuiClose:
GuiEscape:
ExitApp
;
; ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶
RETURN
; ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶
^!R::Reload ; (Ctrl+Alt+R)
^Esc::ExitApp ; (Ctrl+Esc)
; ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶