AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Overlapping a Window?

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
lance0
Guest





PostPosted: Wed Aug 06, 2008 6:45 pm    Post subject: Overlapping a Window? Reply with quote

i do not know what it is called,

but i was wondering if i could sort of overlap a command prompt window, and add buttons, that will type commands for me.

or, open up command propmt inside the ahk program with the buttons.

(if no1 understands i can create a picture xD)
Back to top
Red Hat Boy



Joined: 10 Apr 2008
Posts: 111

PostPosted: Wed Aug 06, 2008 7:02 pm    Post subject: Reply with quote

Here's something I made a while ago. It was a work in progress, but I haven't worked on it in forever.

Code:

Gui, Show, W662 H20 X300 Y300, cmd helper
Gui, Color, 000000, 000000
Gui +ToolWindow -Theme +AlwaysOnTop

Gui, Add, Button,x0 y0 w20 h20 gKillIt, X
Gui, Add, Button,x20 y0 w30 h20 gTriggerOpenCmd, cmd
Gui, Add, Button,x50 y0 w50 h20 gTrigger1, Button 1
Gui, Add, Button,x100 y0 w50 h20 gTrigger2, Button 2
Gui, Add, Button,x150 y0 w50 h20 gTrigger3, Button 3
Gui, Add, Button,x200 y0 w50 h20 gTrigger4, Button 4
Gui, Add, Button,x250 y0 w50 h20 gTrigger5, Button 5
Gui, Add, Button,x300 y0 w50 h20 gTrigger6, Button 6
Gui, Add, Button,x350 y0 w50 h20 gTrigger7, Button 7
Gui, Add, Button,x400 y0 w50 h20 gTrigger8, Button 8
Gui, Add, Button,x450 y0 w50 h20 gTrigger9, Button 9
Gui, Add, Button,x500 y0 w50 h20 gTrigger10, B 10
Gui, Add, Button,x550 y0 w50 h20 gTrigger11, B 11
Gui, Add, Button,x600 y0 w62 h20 gTrigger12, B 12
Gui, Show

Run cmd.exe, c:\
WinGetPos, cmdX, cmdY, wideness, highness, cmd helper
cmdY += 20
WinWait, ahk_class ConsoleWindowClass
WinMove, ahk_class ConsoleWindowClass,, %cmdX%, %cmdY%

; ==============================================================
; ==============================================================
; This must go after the "auto-execute" section, but
; before hotkeys and labels, otherwise it won't work right

;WM_MOVE = 0x03
;WM_EXITSIZEMOVE = 0x232
;WM_MOVING = 0x216

OnMessage(0x232, "WM_EXITSIZEMOVE")

WM_EXITSIZEMOVE()
{
IfWinExist, ahk_class ConsoleWindowClass
{
WinGetPos, cmdX, cmdY, wideness, highness, cmd helper
cmdY += 20
WinWait, ahk_class ConsoleWindowClass
WinMove, ahk_class ConsoleWindowClass,, %cmdX%, %cmdY%
return
}
}

; ==============================================================
; ==============================================================

!x::ExitApp

TriggerOpenCmd:
IfWinExist, ahk_class ConsoleWindowClass
{
WinClose, ahk_class ConsoleWindowClass
return
}
else
{
Run cmd.exe, c:\
WinGetPos, cmdX, cmdY, wideness, highness, cmd helper
cmdY += 20
WinWait, ahk_class ConsoleWindowClass
WinMove, ahk_class ConsoleWindowClass,, %cmdX%, %cmdY%
return
}

Trigger1:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger2:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger3:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger4:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger5:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger6:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger7:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger8:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger9:
ControlSend,, ipconfig{Enter}, ahk_class ConsoleWindowClass
return

Trigger10:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger11:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger12:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

GuiContextMenu:
IfWinNotExist, ahk_class ConsoleWindowClass
{
Run cmd.exe, c:\
}
WinGetPos, cmdX, cmdY, wideness, highness, cmd helper
cmdY += 42
WinWait, ahk_class ConsoleWindowClass
WinMove, ahk_class ConsoleWindowClass,, %cmdX%, %cmdY%
return

GuiClose:
WinClose, ahk_class ConsoleWindowClass
ExitApp
return

KillIt:
WinClose, ahk_class ConsoleWindowClass
ExitApp
return

_________________
I slit the sheet, the sheet I slit,
and on the slitted sheet I sit. ;~}
Back to top
View user's profile Send private message Send e-mail
tidbit



Joined: 09 Mar 2008
Posts: 1807
Location: Minnesota, USA

PostPosted: Wed Aug 06, 2008 7:25 pm    Post subject: Reply with quote

I believe it is called a "Console"
http://images.clanbase.com/docs/guids/sourcesteamid2.jpg
_________________
rawr. be very afraid
*poke*
Note: My name is all lowercase for a reason.
Even monkeys fall from trees. - Japanese proverb
Back to top
View user's profile Send private message
lance0
Guest





PostPosted: Wed Aug 06, 2008 7:39 pm    Post subject: Reply with quote

hmm.. thats sort of what im looking for, thanks Very Happy

Red Hat Boy wrote:
Here's something I made a while ago. It was a work in progress, but I haven't worked on it in forever.

Code:

Gui, Show, W662 H20 X300 Y300, cmd helper
Gui, Color, 000000, 000000
Gui +ToolWindow -Theme +AlwaysOnTop

Gui, Add, Button,x0 y0 w20 h20 gKillIt, X
Gui, Add, Button,x20 y0 w30 h20 gTriggerOpenCmd, cmd
Gui, Add, Button,x50 y0 w50 h20 gTrigger1, Button 1
Gui, Add, Button,x100 y0 w50 h20 gTrigger2, Button 2
Gui, Add, Button,x150 y0 w50 h20 gTrigger3, Button 3
Gui, Add, Button,x200 y0 w50 h20 gTrigger4, Button 4
Gui, Add, Button,x250 y0 w50 h20 gTrigger5, Button 5
Gui, Add, Button,x300 y0 w50 h20 gTrigger6, Button 6
Gui, Add, Button,x350 y0 w50 h20 gTrigger7, Button 7
Gui, Add, Button,x400 y0 w50 h20 gTrigger8, Button 8
Gui, Add, Button,x450 y0 w50 h20 gTrigger9, Button 9
Gui, Add, Button,x500 y0 w50 h20 gTrigger10, B 10
Gui, Add, Button,x550 y0 w50 h20 gTrigger11, B 11
Gui, Add, Button,x600 y0 w62 h20 gTrigger12, B 12
Gui, Show

Run cmd.exe, c:\
WinGetPos, cmdX, cmdY, wideness, highness, cmd helper
cmdY += 20
WinWait, ahk_class ConsoleWindowClass
WinMove, ahk_class ConsoleWindowClass,, %cmdX%, %cmdY%

; ==============================================================
; ==============================================================
; This must go after the "auto-execute" section, but
; before hotkeys and labels, otherwise it won't work right

;WM_MOVE = 0x03
;WM_EXITSIZEMOVE = 0x232
;WM_MOVING = 0x216

OnMessage(0x232, "WM_EXITSIZEMOVE")

WM_EXITSIZEMOVE()
{
IfWinExist, ahk_class ConsoleWindowClass
{
WinGetPos, cmdX, cmdY, wideness, highness, cmd helper
cmdY += 20
WinWait, ahk_class ConsoleWindowClass
WinMove, ahk_class ConsoleWindowClass,, %cmdX%, %cmdY%
return
}
}

; ==============================================================
; ==============================================================

!x::ExitApp

TriggerOpenCmd:
IfWinExist, ahk_class ConsoleWindowClass
{
WinClose, ahk_class ConsoleWindowClass
return
}
else
{
Run cmd.exe, c:\
WinGetPos, cmdX, cmdY, wideness, highness, cmd helper
cmdY += 20
WinWait, ahk_class ConsoleWindowClass
WinMove, ahk_class ConsoleWindowClass,, %cmdX%, %cmdY%
return
}

Trigger1:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger2:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger3:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger4:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger5:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger6:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger7:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger8:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger9:
ControlSend,, ipconfig{Enter}, ahk_class ConsoleWindowClass
return

Trigger10:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger11:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

Trigger12:
IfWinExist, ahk_class ConsoleWindowClass
WinActivate
Send, ipconfig{Enter}
return

GuiContextMenu:
IfWinNotExist, ahk_class ConsoleWindowClass
{
Run cmd.exe, c:\
}
WinGetPos, cmdX, cmdY, wideness, highness, cmd helper
cmdY += 42
WinWait, ahk_class ConsoleWindowClass
WinMove, ahk_class ConsoleWindowClass,, %cmdX%, %cmdY%
return

GuiClose:
WinClose, ahk_class ConsoleWindowClass
ExitApp
return

KillIt:
WinClose, ahk_class ConsoleWindowClass
ExitApp
return
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group