Cant move gui after removing her 'caption' - autohotkey

Maybe someone knows if it is possible to move GUI while -caption is enabled?
Since the toolbar is removed with GUI -caption, now I can not move GUI with the mouse.

All that is necessary to add to your scripts is the OnMessage line and the WM_LBUTTON function in the script below to allow you to move the GUI:
OnMessage(0x0201, "WM_LBUTTONDOWN")
Gui, -Caption
Gui, Show, w500 h200
return
WM_LBUTTONDOWN() {
PostMessage, 0xA1, 2,,, A
}
Esc::ExitApp

Related

How to enable the maximize button in the gui?

When i create a GUI her maximize button is grayed out/disabled, how can i enable it?
Example:
Gui, Add, Button, w100 h30, Button
Gui, Show, w400 h300
I was reading the docs and found this parameter Maximize: Maximizes and activates the window.
It does maximize the GUI as soon its launched:
Gui, Show, Maximize w400 h300
However, i would like to enable maximizing/restoring upon clicking the maximize button.
You need to add the flag +Resize
From docs:
Resize: Makes the window resizable and enables its maximize button in the title bar. To avoid enabling the maximize button, specify +Resize -MaximizeBox.

Access the MDI toolbar menu with AutoHotKey ControlSend

Automating a process that is being run on a RDP session, I have to use ControlSend, and not Send command in AutoHotKey.
The WindowSpy doesn't find any control on the MDI toolbar, and there are no shortkey to the menu item I want to access (Filter..). How may I open the toolbar and select the item?
I've tried
ControlSend, ahk_parent, {alt}, ahk_class FNWND3170 ;Open project folder in treeview
But with no success.
I've considered using AutoIT, but I don't think that would help as the AutoIt spy doesn't pick up the control either.
Sorry, but think of the RDP window (or even full screen) as an ever-evolving bitmap image. Your PC and autohotkey have no idea what is behind the picture. Can you run the ahk script in the remote pc itself? Keep in mind, the RDP client handles your mouseclicks and keyboard (and even voice) entirely by re-directing inputs, etc. So best bet is to do a mouse click in the appropriate spot by running a script from outside the window:
CoordMode, TargetType [, RelativeTo]
Click, 44, 55 ; Clicks the left mouse button once at coordinates 44, 55 (based on CoordMode).
Use the CoordMode "RelativeTo" flag to set to "Relative" so coordinates are relative to the active window. You may have to click twice, once to activate the RDP window and then to click at the mouse position.
See https://www.autohotkey.com/docs/commands/Click.htm and https://www.autohotkey.com/docs/commands/CoordMode.htm for info.
Hth,

I don't know how to go about a button to open a website

I have a couple of questions, I'm making a personal/public tool for finding and opening external tool websites really quick, in the code (Which I will provide below) I want to have buttons with the text on them with the website, the links and names of each website are in the code at the bottom of the GUI Stuffs.
I just don't know how to go about the button and text thing, nor do I know how to open a website in chrome externally I know how to do it in a batch file, but not in AHK
; This is an ED tools Program built to allow you to open tools with a click of a button
Gui, Show, w310 h300, Elite Dangerous Tools
; GUI Stuffs
Gui, Add, Button, w50 19 x150 y10 Beddb
;Tools
;eddb.io
eddb:
return
;-----------
;www.edsm.net
edsm:
return
;-----------
;inara.cz
inara:
return
;-----------
;coriolis.io
coriolis:
return
;-----------
;edtools.ddns.net
edtools:
return
;-----------
;edshipyard.net/
edship:
return
;-----------
GuiClose:
ExitApp
I want to have a GUI with buttons on it, 6 buttons in total. 3 on each side, text saying the name of the website, whatever. but when I run it now, I get
Error: Invalid Option
Specifically Beddb
Line#
006 Gui,Add,Button,w50 h19 x150 y10 Bebbd
As Yane mentioned in the comment, you need a g before your sub-routine (label) name. (More info here.) Below is a working example of your code for one of the buttons and sites. It opens the site in Firefox. You can apply this to the rest of your buttons and sites.
f1::
Gui , Add , Button , w50 19 x150 y10 geddb , eddb.io
Gui , Show , w310 h300 , Elite Dangerous Tools
Return
eddb:
Run , firefox.exe "eddb.io"
Return
The help documentation does a great job explaining all the things you can do with GUIs.
https://www.autohotkey.com/docs/commands/Gui.htm

Make borderless window behaves alwaysontop [Autohotkey]

I want to create a borderless window, but alwaysontop didn't work if the window is borderless, how to make borderless window behave alwaysontop ?
gui, Tool: add, button, x0 y0 h20 w140 gxub, TOOLS
gui, Tool: show, w150, TOOLS
WinGet, id1, ID, A ; GET ahk_id of active window
WinSet, Style, -0xC00000, A ; hide title bar
Winset, Alwaysontop, ON, ahk_id %id1%
Adding one line on the top will satisfy your need
gui, +alwaysontop

autohotkey activate window twice deactivate it?

i have this code AutoHotkey Code:
#NoTrayIcon
If WinExist("Mozilla Thunderbird")
{
WinActivate, Mozilla Thunderbird
}
Else
{
Run "c:/Users/xah/Desktop/Mozilla Thunderbird.lnk"
WinActivate
}
Return
ExitApp
activated by a key.
but when run twice (sometimes pressed the key twice), it seems to deactivate the window and change mouse position.
how to fix that?
(this is a pain for me because i have auto window focus on. When mouse position changes to another location, that window pops up to front)
thanks.
someone at ahk forum answered it.
http://www.autohotkey.com/forum/post-413075.html#413075
basically, my script is actually running the Else clause everytime.
What i need is to add
SetTitleMatchMode, 2
in the beginning, so the title matches if it contains the string.