Jump to content

check if script ran from scite?


Go to solution Solved by Musashi,

Recommended Posts

  • Solution

Check the macro :

@Compiled  Returns 1 if script is a compiled executable or an .a3x file; returns 0 if an .au3 file.

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to post
Share on other sites
  • Developers
Posted (edited)

This is a UDF to check for running a source file from SciTE with AutoIt3 or directly and determine which one it is:

#include <WinAPIProc.au3>

If _RunBySciTE() Then
    MsgBox(0, "Run by SciTE", "This script is ran by SciTE")
Else
    MsgBox(0, "Not Run by SciTE", "This script is not ran by SciTE")
EndIf

Func _RunBySciTE($iPID = @AutoItPID)
    Local $n, $iParentPID = $iPID
    For $n = 1 To 5
        If _WinAPI_GetProcessName($iParentPID) = "SciTE.exe" Then Return True
        $iParentPID = _WinAPI_GetParentProcess($iParentPID)
    Next
    Return False
EndFunc   ;==>_RunBySciTE

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...