Hi Enigma
First Read This Please:
Think I have a small media player. It supports drag'n'drop. The window title is the name of mp3 file. Think I have played Enigma.mp3 with it, then the title will be "Enigma", If play majid.exe ,the title will be "majid". I want to lock the title, For example if the title is something expect Enigma, the player close.
I mean this: The player is playing Enigma.mp3 and the title is "Enigma", If I drag'n'drop Majid.mp3, the tile will become "Majid", I want the app become close after changing the title, Possible?
Protecting Application's Title
Re: Protecting Application's Title
Hi Majid, everything is possible through plugins
Through plugin you can create a Thread or Timer object that will use function like FindWindow and search the window inside current process with the necessary title. If windows is not found - just close application!
Through plugin you can create a Thread or Timer object that will use function like FindWindow and search the window inside current process with the necessary title. If windows is not found - just close application!
Re: Protecting Application's Title
But How? Can you guide me step by step please?
Re: Protecting Application's Title
This could be done very simple.
There is undocumented function in Enigma SDK - EP_CheckupFindProcess, it has following definition:
So, in the plugin, you create a thread or timer, that will periodically (maybe 1 time per 2-5 seconds) check if the necessary window is opened. You will call EP_CheckupFindProcess with the following parameters:
FileName - file name of your protected application
WindowText - *enigma* (so the text of the window should contain word Enigma)
WindowClass - you may keep it empty, or, for better detection, you may open in Enigma Protector the panel Checkup - Executed Process, then click Add Processes button, then find your window in the list and get it Class name. And you may use this class name when you call EP_CheckupFindProcess.
If this function will return false, then such window is not found, and you may terminate your application.
Do you forget to make a delay from the application start before checking of the window, because there is needed some time from calling of plugin till showing of the window.
There is undocumented function in Enigma SDK - EP_CheckupFindProcess, it has following definition:
Code: Select all
function EP_CheckupFindProcess(FileName, WindowText, WindowClass : PAnsiChar) : boolean; external enigma_api_dll_name name 'EP_CheckupFindProcess';
function EP_CheckupFindProcessA(FileName, WindowText, WindowClass : PAnsiChar) : boolean; external enigma_api_dll_name name 'EP_CheckupFindProcessA';
function EP_CheckupFindProcessW(FileName, WindowText, WindowClass : PWideChar) : boolean; external enigma_api_dll_name name 'EP_CheckupFindProcessW';
FileName - file name of your protected application
WindowText - *enigma* (so the text of the window should contain word Enigma)
WindowClass - you may keep it empty, or, for better detection, you may open in Enigma Protector the panel Checkup - Executed Process, then click Add Processes button, then find your window in the list and get it Class name. And you may use this class name when you call EP_CheckupFindProcess.
If this function will return false, then such window is not found, and you may terminate your application.
Do you forget to make a delay from the application start before checking of the window, because there is needed some time from calling of plugin till showing of the window.