How to tell if your 32-bit program is being run under a 32-bit debugger
You may want your application to behave differently when being run under the debugger than when it is being run normally by a user. There is a Win32 API function called IsDebuggerPresent() that you can call to determine this. It returns 0 when your application is being run normally, or nonzero when being run under a debugger. The Clarion WIN32 .LIB that gets linked in to your application when you use Win32 API functions does not contain this procedure, so you will need either make your own import library using LIBMAKER, or download the one already provided
To use the function you need to do three things
1. Prototype as follows in your programs MAP section
Module('Windows API')
IsDebuggerPresent(),Bool,Raw,Pascal
End
2. Add the import library (in this case IDP.LIB) to the project
3. Call it
CodeIf IsDebuggerPresent() <> 0 Message('being debugged') End
Back to my home page, my Clarion page, or send me mail at paula@attglobal.net
Last update 9Sep99