Gui, please help me

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
asad41163
Posts: 268
Joined: 29 Jul 2014, 14:31

Gui, please help me

22 Dec 2016, 06:54

Hi All
Does any one help me to convert script No.1 to be like script No.2
1. Where it appear on the screen
2. Buttons
3. Features and Specifications for GUI
Thanks in advance for all
============================================================================= script No.1
#SingleInstance, Force
Gui, +AlwaysOnTop
Gui, color, 0174DF
Gui, Show, w144 h400

Gui, Add, Button, x2 y2 w140 h30 gFirst_Button, MyComputer
Gui, Add, Button, x2 y34 w140 h30 gScound_Button, RecycleBin
Gui, Add, Button, x2 y66 w140 h30 gThired_Button, Notepad
return
; -------------------------------------------Lables
First_Button:
Run ::{20d04fe0-3aea-1069-a2d8-08002b30309d} ; Opens the "My Computer" folder.
return
Scound_Button:
Run ::{645ff040-5081-101b-9f08-00aa002f954e} ; Opens the Recycle Bin.
return
Thired_Button:
Run, C:\Windows\Notepad.exe
return
^X::ExitApp
=========================================================================== script No.2

#Persistent
SetBatchLines -1
SysGet, Size, MonitorWorkArea
GuiRight := SizeRight - 147
Button_Right := SizeRight - 147
Button_Bottom := SizeBottom - 31
Gui, 1: Color, 0174DF
; Gui, 1: Color, 2E9AFE
; Gui, 1: Color, cFFFFFF
Loop, *.ahk
{
If (A_LoopFileName <> "Main Window.exe")
{
A_IndexCount := A_Index
If A_IndexCountMinus
A_IndexCount -= A_IndexCountMinus
YPos := A_IndexCount * 25 - 20
StringTrimRight, FileName%A_IndexCount%, A_LoopFileName, 4
RunPath%A_IndexCount% := A_LoopFileFullPath
Gui, 1: Add, Button, w110 h20 x5 y%YPos% gRun, % FileName%A_IndexCount%
Gui, 1: Add, Button, w20 h20 x120 Disabled y%YPos% vFileName2%A_IndexCount%, K
YPos%A_IndexCount% := YPos . "," . FileName%A_IndexCount%
}
else
{
A_IndexCountMinus++
continue
}
}
YPos += 50
GuiBottom := SizeBottom - YPos - 1
TitlePos := YPos - 21
ButtonPos := YPos - 25
Gui, 1: Font, w700 c000000
Gui, 1: Add, Text, w90 h20 x30 y%TitlePos% Center gDrag, Utilities
Gui, 1: Font, c000000
Gui, 1: Add, Button, w20 h20 x5 y%ButtonPos%, &-
Gui, 1: Add, Button, w20 h20 x120 y%ButtonPos%, &X
Gui, 1: +AlwaysOnTop -Caption +ToolWindow +Border
Gui, 1: Show, NoActivate w145 h%YPos% x%GuiRight% y%GuiBottom%, Main Window
return

Drag:
PostMessage, 0xA1, 2,,, A
return

Run:
Loop
{
If (A_GuiControl = FileName%A_Index%)
{
RunPath := RunPath%A_Index%
Run, Autohotkey.exe "%RunPath%",,, ProgRun%A_Index%
ProcessRun := A_Index
break
}
}
GuiControl, Enable, FileName2%ProcessRun%
Gui, 1: Show, NoActivate w145 h%YPos% x%GuiRight% y%GuiBottom%, Main Window
return

ButtonK:
StringTrimLeft, RunningName, A_GuiControl,9
FileNameKill := ProgRun%RunningName%
Process, Close, % FileNameKill
GuiControl, Disable, FileName2%RunningName%
return

Button-:
Gui, 1: Cancel
Gui, 2: Color, 0174DF
Gui, 2: Font, w700 c000000
Gui, 2: Add, Text, w90 h20 x30 y9 Center gDrag, Utilities
Gui, 2: Font, c000000
Gui, 2: Add, Button, w20 h20 x5 y5, &+
Gui, 2: Add, Button, w20 h20 x120 y5, &X
Gui, 2: -Caption +AlwaysOnTop +Border
Gui, 2: Show, NoActivate w145 h30 x%Button_Right% y%Button_Bottom%, Minimized
return

2Button+:
Gui, 2: Destroy
Gui, 1: Show, NoActivate w145 h%YPos% x%GuiRight% y%GuiBottom%, Main Window
return

ButtonX:
2ButtonX:
ExitApp
hugin
Posts: 15
Joined: 17 Aug 2016, 01:33

Re: Gui, please help me

27 Dec 2016, 03:10

Are you asking the forum to copy Gui 2 into Gui 1 for you, when you have what you need from both scripts at hand?

If that is the case, why not try that yourself? Because you do have everything you need, right?

Or am I missing something, like something you don't understand?

But I am also sure you can fix that yourself, it is just a matter of Gui's Width and Height, and position ;)

Good luck!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], CoffeeChaton and 161 guests