AutoHotkey Community

It is currently May 27th, 2012, 1:53 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Close Halo in XP
PostPosted: January 23rd, 2010, 11:13 pm 
Offline

Joined: June 14th, 2009, 7:48 pm
Posts: 331
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 24th, 2010, 1:51 am 
Offline

Joined: November 8th, 2009, 2:46 am
Posts: 234
Location: Canberra Oz
Code:
!k:: ;Alt-k kill the active window...with vengence
WinGet, ActivePID, PID, A
Process, Close, ActivePID


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 24th, 2010, 2:43 am 
Offline

Joined: June 14th, 2009, 7:48 pm
Posts: 331
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 24th, 2010, 3:34 am 
Offline

Joined: November 8th, 2009, 2:46 am
Posts: 234
Location: Canberra Oz
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]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 24th, 2010, 4:01 am 
Offline

Joined: November 8th, 2009, 2:46 am
Posts: 234
Location: Canberra Oz
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 24th, 2010, 4:12 am 
Offline

Joined: October 26th, 2009, 6:29 am
Posts: 362
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!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 24th, 2010, 7:25 am 
Offline

Joined: June 14th, 2009, 7:48 pm
Posts: 331
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 . . .


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 24th, 2010, 7:38 am 
Offline

Joined: November 8th, 2009, 2:46 am
Posts: 234
Location: Canberra Oz
Checkit: is correct. Oops again :oops:

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 24th, 2010, 8:45 pm 
Offline

Joined: June 14th, 2009, 7:48 pm
Posts: 331
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.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, engunneer, JSLover, sjc1000, Yahoo [Bot] and 19 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group