Console or GUI application??
Console or GUI application??
Can I see from a DLL of mine if the calling program is a CONSOLE or WINGUI application ? Thanks for any hints.
i asked the same once. Only about window qestion and i got a try. i havent
tryed it yet. But try programming the function openwindow() or something into the dll, and execute the function from another program of yours.
If you try, i would like to hear the result!
The reason i havent tryed was time and i havent touch a dll before. Maybe used one, but newer made one..
^^
O
----
tryed it yet. But try programming the function openwindow() or something into the dll, and execute the function from another program of yours.
If you try, i would like to hear the result!

The reason i havent tryed was time and i havent touch a dll before. Maybe used one, but newer made one..
^^
O
----
-
- User
- Posts: 38
- Joined: Tue Dec 30, 2003 1:37 pm
- Location: Australia
Seldon,
The first part of your challenge is finding out your owner ... this is easily achieved in all Windows OS's from 95 up by the toolhelp api.
In particular, look at PROCESSENTRY32 ... it has a value th32ParentProcessID, so you can check that to find your owner process.
Now that you've found your parent process you can just check its Characteristics flag in the PE header from its file to check if its a console, gui etc, OR, you might prefer to enumerate all windows and check each windows process ID against your parent process ID, and then check if it's "Command Prompt" etc.
The first part of your challenge is finding out your owner ... this is easily achieved in all Windows OS's from 95 up by the toolhelp api.
In particular, look at PROCESSENTRY32 ... it has a value th32ParentProcessID, so you can check that to find your owner process.
Now that you've found your parent process you can just check its Characteristics flag in the PE header from its file to check if its a console, gui etc, OR, you might prefer to enumerate all windows and check each windows process ID against your parent process ID, and then check if it's "Command Prompt" etc.