Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: How to identify game Windows title for AHK coding? [SOLVED!!]  (Read 3076 times)

0 Members and 1 Guest are viewing this topic.

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • Last login:April 06, 2017, 01:33:35 pm
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
I'm coding an AHK file to close itself once "Big Buck Hunter" game closes on the PC.

Problem is, the game automatically goes full screen at launch and I can't find out the name/title of the window in which it runs so that the following code might work:

WinWait, Big Buck Hunter ; This isn't the right Window title. Don't know how to find out!!!
WinWaitClose, Big Buck Hunter
exit App

There isn't an options area in any menu launch screen whereby I can make it run windowed or lower resolution, so I can see what Windows calls the running game, so I can then in turn correctly fix the code above. The rest of my script seems to work fine. I just can't code for the situation in which Big Buck Hunter get's closed via the menu system and AHK must then close itself.

Anyone know how to find out Windows title info with a game that only runs full screen?

Thanks in advance.
« Last Edit: July 13, 2012, 03:00:03 am by Wade007 »
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9269
  • Last login:Yesterday at 10:17:06 am
  • ...
Re: How to identify game Windows title for AHK coding?
« Reply #1 on: July 11, 2012, 11:31:24 pm »
CTRL+ALT+DELETE and bring up windows task manager.  ;)

RamjetR

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 144
  • Last login:July 04, 2021, 03:27:58 am
    • My Youtube Channel
Re: How to identify game Windows title for AHK coding?
« Reply #2 on: July 11, 2012, 11:41:49 pm »
I'll 2nd on A+C+D Task Manager.

Also some/most games will respond to an Alt-Enter as a windows shortcut to FullScreen/Window mode.

Ramjet
Gentlemen.... Start your engines!
My Youtube Channel http://www.youtube.com/user/ramjetr?feature=mhee
Try my RamjetM2Borderless V0.7 utility for your M2Emulator shooting games here https://docs.google.com/open?id=0B-P3wlCiYEm3RzhCZk1NcFR3blE
Try my Sega Model 2 Output Utility RamjetVR V1.4 https://docs.google.com/file/d/0B-P3wlCiYEm3VHhBMXNxZGVIQk0/edit

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: How to identify game Windows title for AHK coding?
« Reply #3 on: July 12, 2012, 12:05:16 am »
The version of AHK that i installed came with AU3_spy.exe

Just run it and click on a window, it'll show window titles, classes, and all sorts of extra stuff that's handy for AHK scripts.

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • Last login:April 06, 2017, 01:33:35 pm
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
Re: How to identify game Windows title for AHK coding?
« Reply #4 on: July 12, 2012, 09:50:29 am »
Thanks for your response guys. The AU3_spy.exe idea sounds promising. I'll try that.

I had tried Ctrl-Alt-Delete and then Task Manager before posting but that just shows the executable running, not necessarily the name of the window.

I'll try a few more things and repost. Thanks again for your help.
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN

Wade007

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 309
  • Last login:April 06, 2017, 01:33:35 pm
  • A MAME cabinet at home is heaven
    • bit.ly/1cWnoIC
    • Cheapskategamer.com
Re: How to identify game Windows title for AHK coding?
« Reply #5 on: July 13, 2012, 02:59:21 am »
OK, I'm back...problem solved. Return posting here so that others might benefit.

Tried using AU3_spy.exe to get the report on the Window title AND tried Alt+Enter in game mode to try and force a windowed experience. Neither worked. The game didn't respond to Alt+Enter and I couldn't figure out how to point AU3.spy to an already active window and still see AU3.spy for the report at the same time. Maybe I was doing something wrong but it didn't seem possible to run the game AND see AU3.spy at the same time.

HOWEVER... I got some more help from an AHK expert on the AHK forum. http://www.autohotkey.com/community/viewtopic.php?f=15&t=88694&p=550621#p550621

See script below. After launching the game via the script I simply pressed Ctrl+Alt+MButton to find the game window information desired via a generated Testfile (Testfile.txt).


SetWorkingDir, C:\Arcade\PC Arcade Ports\Big Buck Hunter\BBH1
Run, C:\Arcade\PC Arcade Ports\Big Buck Hunter\BBH1\BBH1.exe

#SingleInstance, Force
SetTitleMatchMode, 2
Return

^!mbutton::
winget, winid, ID, A
WinGetTitle, wint, ahk_id %winid%
winGetClass, winc, ahk_id %winid%
IfExist, %A_WorkingDir%\TestFile.txt
   FileDelete, %A_WorkingDir%\TestFile.txt
fileappend wintitle: %wint%`n, %A_WorkingDir%\TestFile.txt
FileAppend,winclass: %winc%`n, %A_WorkingDir%\TestFile.txt
winminimize, ahk_id %winid%
run, notepad %A_WorkingDir%\testfile.txt
Return


The generated TestFile.txt reported:
wintitle: BBH
winclass: PMVsClass

I'm not sure how knowing the winclass would help me but after I plugged 'BBH' into my previous simple script everything worked perfectly!!! Case solved!!!
My Super Arcade cabinet project:
Software blog article: http://bit.ly/1cWnoIC

Hardware blog article: http://bit.ly/1dWxjvP

YouTube video: http://bit.ly/1N818Xm

Super Arcade Cabinet Progress thread (Now Complete):
http://forum.arcadecontrols.com/index.php/topic,123292.0.html

Frontend Video Intro: http://bit.ly/1P9HPDN