Results 1 to 5 of 5
  1. #1
    silvaBR's Avatar
    Join Date
    Dec 2017
    Gender
    male
    Posts
    29
    Reputation
    10
    Thanks
    139

    Talking close program, according to the open window

    I would like to check if X window of a program is running, if it is not running, I want to end the current application.

    Thanks for who can help.

  2. #2
    Sazor98's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Location
    X:13 Y:3 Z:7
    Posts
    154
    Reputation
    23
    Thanks
    64
    did you check the 'MainWindowTitle' property?
    loop through all processes and check their window title with that, you can also do it manually using win API calls

  3. #3
    Ticherhaz's Avatar
    Join Date
    Aug 2013
    Gender
    male
    Location
    Malaysia
    Posts
    6,564
    Reputation
    1376
    Thanks
    1,297
    My Mood
    Inspired
    Quote Originally Posted by silvaBR View Post
    I would like to check if X window of a program is running, if it is not running, I want to end the current application.

    Thanks for who can help.
    I don't really understand what you were trying to say but if you want to know whether the program is still running or not, you can check at the top. you can see 'STOP' icon. Thats mean, the program still running.

    If you want the code to close the running program, you can use this .
    Application.Exit()
    Anything can PM me. I'm from Malaysia.

  4. #4
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Code:
    Private Declare Auto Function FindWindow Lib "user32.dll" ( _
    ByVal lpClassName As String, _
    ByVal lpWindowName As String _
    ) As IntPtr
    If the return value is IntPtr.Zero then the window was not found, and you can use Application.Exit() as mentioned above to exit out of the window.
    Ah we-a blaze the fyah, make it bun dem!

  5. #5
    JackRidle's Avatar
    Join Date
    Aug 2018
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by Zuhrain View Post

    I don't really understand what you were trying to say but if you want to know whether the program is still running or not, you can check at the top. you can see 'STOP' icon. Thats mean, the program still running.

    If you want the code to close the running program, you can use this .
    Application.Exit()
    Hi,
    There's a coding website for my college. But it doesn't allow copy pasting. I do the programming in online compiler because the compiler in that website is way too slow. So after writing the code, I'm having to retype the entire code.
    I tried writing a script to do this. Can someone help me with it?
    I paste the code to be typed into "contents.txt" and I have another background ahk file that runs this file when I press Ctrl+Alt+v.
    Code:*[Select all]*[Download]GeSHi*©*Codebox Plus
    #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
    ; #Warn ; Enable warnings to assist with detecting common errors.
    SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
    SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
    FileRead, code, contents.txt
    SendInput {Raw}%code%(SendInput)

    If you just want to throw the contents of the file onto the screen you can try using PHP.

    <?php
    $myfilename = "mytextfile.txt";
    if(file_exists($myfilename)){
    echo file_get_contents($myfilename);
    }
    ?>

Similar Threads

  1. [WTB] Open a closed Amazon account & get the refund? Anyone?
    By CrazedM in forum User Services
    Replies: 7
    Last Post: 09-23-2014, 01:36 PM
  2. Replies: 2
    Last Post: 04-16-2008, 06:06 PM
  3. close program
    By mopo in forum Visual Basic Programming
    Replies: 11
    Last Post: 11-01-2007, 10:10 AM
  4. Having 2 things of WOW on the same windows
    By RickE in forum General Game Hacking
    Replies: 1
    Last Post: 04-30-2007, 07:17 PM