DLL: recognising windows or console app. calls 
Author Message
 DLL: recognising windows or console app. calls

I need a DLL being able to recognise if it is called either by a windows
application or a console application, and behave differently in case.
Is there a way?
Luciano


Sun, 04 Aug 2002 03:00:00 GMT  
 DLL: recognising windows or console app. calls


Fri, 19 Jun 1992 00:00:00 GMT  
 DLL: recognising windows or console app. calls
Luciano,

Quote:
> I need a DLL being able to recognise if it is called either by a windows
> application or a console application, and behave differently in case.
> Is there a way?

Why? is there a good reason for it?

One of the few ways to do it I know is to have the dll get the base address
of the .exe, and then read the PE headers to find if it's maked as console
or gui. This is not fool proof, because a console app can create windows,
too, and a gui app can create consoles!.

The specific field you are looking for is IMAGE_OPTIONAL_HEADER::Subsystem

--
Tomas Restrepo
http://members.xoom.com/trestrep/



Sun, 04 Aug 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Need help converting a console app to windows app with a DLL

2. Writing to an _iobuf in a DLL called from a multithreaded console app

3. Console apps vs Windows Apps

4. Running a console app from a windows app

5. Building a console app that doesn't require mscoree.dll in Visual C++ .NET

6. About converting Console App to DLL

7. dll and console app problem?

8. console app + Dialog DLL problems

9. DLL initialization problem in console app

10. Hybrid console/windows app

11. Windows console app direct access

12. help about the socket console app in windows

 

 
Powered by phpBB® Forum Software