Results 1 to 4 of 4

Thread: How can I determine whether a program uses the console?

  1. #1
    Tygur
    Guest

    Question

    I've spent a lot of time trying to figure this out. I need a way of telling whether a program is a console program without running it.

    It has to be possible because windows determines that when you look at the properties for a file. If it uses the console, there's some extra tabs.

    I can't just test to see if the program runs in DOS, because Win32 Console programs also do it.

    I hope I explained that right. Let me know if you don't understand.

  2. #2
    Megatron
    Guest
    Do you want to find out given the EXE name? Or the window title? Or the handle?

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Nope, only real DOS (16-bit, or 32-bit with overlay handler) programs get the extra tabs. Console programs don't have them because they're still fully 32-bit Windows programs.

    I don't have specifics, but look at the EXE file header, if there's a PE section (portable executable) it won't have the tabs.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  4. #4
    Tygur
    Guest
    cmd.exe also has extra tabs. They aren't the same ones, but they are there.

    I assumed that when you check other win32 console programs, it was the same way, but I just checked and it's not. So it looks like you're right, parksie.

    I did find out how to tell if a program is a DOS program using GetFileVersionInfo, so that isn't a problem.

    Now I just need a way of determining if something is a win32 console program. Any ideas? Is it even possible?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width