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 

Close Halo in XP

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



Joined: 14 Jun 2009
Posts: 324

PostPosted: Sat Jan 23, 2010 10:13 pm    Post subject: Close Halo in XP Reply with quote

Hi Everyone,
I try for a whole day to interact in a Halo window with no success.
It's more of a screen than a window, as it spread all over the screen and have no microsoft kind of window border, buttons, etc...,
It's, well . . ., a game . . .
I want to close the game but no Winclose, win Anything, clicks nor keyboard works.
Any idea.
Thanks.
Back to top
View user's profile Send private message
Michael@Oz



Joined: 08 Nov 2009
Posts: 233
Location: Canberra Oz

PostPosted: Sun Jan 24, 2010 12:51 am    Post subject: Reply with quote

Code:
!k:: ;Alt-k kill the active window...with vengence
WinGet, ActivePID, PID, A
Process, Close, ActivePID
Back to top
View user's profile Send private message
awannaknow



Joined: 14 Jun 2009
Posts: 324

PostPosted: Sun Jan 24, 2010 1:43 am    Post subject: Reply with quote

Hi, Michael@oz,
I try and it didn't worked at first.
Then I found something in AutoHotkey help and modified your code like this :
Code:
!k:: ;Alt-k kill the active window...with vengence
WinGet, ActivePID, PID, A
Process, Close, %ActivePID%

It works on any window in xp, but not in the game . . .
It's like the game ignore inputs if they are not from real fingers hitting the real keyboard or moving the real mouse.
The hotkey Alt k has no effect at all and there is no reaction.
But if I switch to windows (XP) with Alt tab and then with a hotkey and a bit of script send someting like this:
Code:
!k:: ; the hotkey ALT K
Process, Close, haloce.exe ;close the halo process

Then it works, but not very good way of doing it ! ! !
But it helps me to deduce that within the halo screen the hotkey has not been detected.
Maybe it needs a timing adjustement for the key press to be detected. . .

I really don't know what to do.

The WinGet syntax is :
Code:
WinGet, OutputVar [, Cmd, WinTitle, WinText, ExcludeTitle, ExcludeText]

So, in :
Code:
WinGet, ActivePID, PID, A

The A is not mentioned in the above syntax,what is it for ?
If I want to add Wintitle, to limit closing action to Halo screen only, where should I add it, after/before the A ?
Like this WinGet, ActivePID, PID, A, Wintitle or like that WinGet, ActivePID, PID, Wintitle, A ?

I tried both, none works, it seeems that A stand for Active window and is not needed if Wintitle is added.
Like this :
Code:
WinGet, ActivePID, PID, Halo



Thanks a looot.
Back to top
View user's profile Send private message
Michael@Oz



Joined: 08 Nov 2009
Posts: 233
Location: Canberra Oz

PostPosted: Sun Jan 24, 2010 2:34 am    Post subject: Reply with quote

Sorry, forgot the %'s again...

First try Window Spy (right click trayicon of any ahk script) see if it shows you the Halo Window title or the ahk_class, see example below.

The A is
Quote:
WinGet, OutputVar [, Cmd, WinTitle, WinText, ExcludeTitle, ExcludeText]

Parameters

WinTitle The title or partial title of the target window (the matching behavior is determined by SetTitleMatchMode). If this and the other 3 parameters are omitted, the Last Found Window will be used. If this is the letter A and the other 3 window parameters are blank or omitted, the active window will be used. To use a window class, specify ahk_class ExactClassName (shown by Window Spy). To use a process identifier (PID), specify ahk_pid %VarContainingPID%. To use a window's unique ID number, specify ahk_id %VarContainingID%. The search can be narrowed by specifying multiple criteria. For example: My File.txt ahk_pid %VarContainingPID%
WinText If present, this parameter must be a substring from a single text element of the target window (as revealed by the included Window Spy utility). Hidden text elements are detected if DetectHiddenText is ON.
ExcludeTitle Windows whose titles include this value will not be considered.
ExcludeText Windows whose text include this value will not be considered.


So you don't need A if you have the title
Code:
WinGet, ActivePID, PID, Wintitle
or if Window Spy gives you the class
Code:
WinGet, ActivePID, PID, ahk_class ExactClassName



I have a sugestion to get HotKey detected while Halo is running, will post seperately.

Window Spy example
    >>>>>>>>>>( Window Title & Class )<<<<<<<<<<<
    Post a reply - Mozilla Firefox <<this is the text to use as Wintitle in WinGet
    ahk_class MozillaUIWindowClass

    >>>>>>>>>>>>( Mouse Position )<<<<<<<<<<<<<
    On Screen: 1027, 20 (less often used)
    In Active Window: 946, -14

    >>>>>>>>>( Now Under Mouse Cursor )<<<<<<<<

    Color: 0xFF8484 (Blue=FF Green=84 Red=84)

    >>>>>>>>>>( Active Window Position )<<<<<<<<<<
    left: 81 top: 34 width: 958 height: 990

    >>>>>>>>>>>( Status Bar Text )<<<<<<<<<<

    >>>>>>>>>>>( Visible Window Text )<<<<<<<<<<<

    >>>>>>>>>>>( Hidden Window Text )<<<<<<<<<<<

    >>>>( TitleMatchMode=slow Visible Text )<<<<

    >>>>( TitleMatchMode=slow Hidden Text )<<<<

    [list=]
[/list]
Back to top
View user's profile Send private message
Michael@Oz



Joined: 08 Nov 2009
Posts: 233
Location: Canberra Oz

PostPosted: Sun Jan 24, 2010 3:01 am    Post subject: Reply with quote

This may work, if not then Halo is blocking it bad

Code:
; Alternate way to hotkey - maybe
SetTimer, CheckIt, 333   ;1/3 Second
Return

CheckIt;
if ( GetKeyState("Alt","P") and GetKeyState("k","P")) ; if Alt key and k key are down
   Process, Close, haloce.exe ;close the halo process
Return
I'm not a gamer though so I can't test
Back to top
View user's profile Send private message
Ace Coder



Joined: 26 Oct 2009
Posts: 361

PostPosted: Sun Jan 24, 2010 3:12 am    Post subject: Reply with quote

Another way, could be to send "#d" or Windoes Key+D this would bring up the desktop, and according to your previous post, the process kill command works from your desktop. I don't believe Halo will be able to block it because that is a hotkey usually handled at OS level like Ctrl+Alt+Del.
_________________
Check out the new AHK forum competition!
Back to top
View user's profile Send private message
awannaknow



Joined: 14 Jun 2009
Posts: 324

PostPosted: Sun Jan 24, 2010 6:25 am    Post subject: Reply with quote

Hi Michael@oz,
I cannot make it work I tried to found the flaw, but only found this up to now:
CheckIt;
CheckIt:
If you find what's broken I'll be happy to try it.

Hi Ace Coder,
I didn't know Win d that's very interesting.
Yes it's working.
I simply used Win key alone which works too, as it switch from Halo screen to xp.

It seems that there is no way to use the halo in game menu to close halo and that it must be done the hard way by killing the process.
A drawback is, doing it that way when opening Halo again, let say that 2or 3 hours later I feel like playing for a while, error box pop up and may be files could be corrupted, and/or worse system may crash . . .
Back to top
View user's profile Send private message
Michael@Oz



Joined: 08 Nov 2009
Posts: 233
Location: Canberra Oz

PostPosted: Sun Jan 24, 2010 6:38 am    Post subject: Reply with quote

Checkit: is correct. Oops again Embarassed

Code:
; Alternate way to hotkey - maybe
#Persistent
SetTimer, CheckIt, 333   ;1/3 Second
Return

CheckIt:
if ( GetKeyState("Alt","P") and GetKeyState("k","P")) ; if Alt key and k key are down
   Process, Close, haloce.exe ;close the halo process
Return

Forgot that without a hotkey or hotstring it just runs once.

This now works in windows, give it a try

EDIT changed program back to haloc.exe...another Oops
Back to top
View user's profile Send private message
awannaknow



Joined: 14 Jun 2009
Posts: 324

PostPosted: Sun Jan 24, 2010 7:45 pm    Post subject: Reply with quote

Hi Michael@oz,
This is definitely working very well, infact it's the only way to send keystroke directly from the halo screen.

Many thanks, Genius.
Back to top
View user's profile Send private message
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