|
1- Don't waste time on that. If your program is worthy enough, then it WILL be cracked/hacked whatever you do and you will loose a lot of valuable time working on "security" instead on the core business of your application.
2- Release a version of your software with a limited set of function and features with code REMOVED from the executable. (for example no save/export/report, limit the number of trade per day/hours, ...)
...
Watched code never compiles.
|
|
|
|
|
dear sirs,
thank you for your email.
I want use this timer in dll no in original source.
You know cracking dll is hard.
Thanks.
|
|
|
|
|
I second Maximilien suggestion. Anyway, you may write usage info, crypted, inside the Windows registry.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Can anybody tell how I get the window handle from a specific process Id. I got the process Id using GetCurrentProcessId()
Regards
Rajmohan
|
|
|
|
|
Which window handle? There are usually more windows belonging to a process (e.g. controls on a dialog like buttons, edit fields have a window handle too). Anyways, i assume you are looking for a top level popup window, one method would be to enumerate all the windows, for example using EnumWindows[^], on every window you could call GetWindowThreadProcessId[^] to get the id of the process the window belongs to and test for equality...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
The handle of what window?
To retrieve all windows of a process, you have to call EnumWindows and, for each window, use GetWindowThreadProcessId to check if a window belongs to a process (the ProcessID of the window equals the ProcessID of the process).
|
|
|
|
|
EnumWindows function is working fine with all windows except my application. I will describe the issue in detail. I have a dll application and I have loaded it into App_Init folder, which loads for every application. I want to know which is currently loaded application and also I need to get the handle of the main window.
I used EnumWindows for navigating through opened application. It is calling for all the application except mine. I dont understand the issue can anybody help me.
Thanks in advance
Regards
Rajmohan
|
|
|
|
|
GetWindowThreadProcessId
what about this?
|
|
|
|
|
See here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
There is no single window handle. A process may have multiple main windows, or none at all. So you have to enumerate all windows, and select the ones which have no owner, and the correct process id. Those will be 'main' windows of the process.
And before thou protests:
Yes, I know that in .Net there is a property called System.Diagnostics.Process.MainWindowHandle, but the implementation is just plain wrong.
|
|
|
|
|
Thank you so much for all the support. I forget to mention the Window Handle,It is of-course the parent window itself
Regards
Rajmohan
|
|
|
|
|
EnumWindows function is working fine with all windows except my application. I will describe the issue in detail. I have a dll application and I have loaded it into App_Init folder, which loads for every application. I want to know which is currently loaded application and also I need to get the handle of the main window.
I used EnumWindows for navigating through opened application. It is calling for all the application except mine. I dont understand the issue can anybody help me.
Thanks in advance
Regards
Rajmohan
|
|
|
|
|
Hi,
I have a dll which is having pure virtual functions. Now what to do with that to redifine the function in my own class?
|
|
|
|
|
john5632 wrote: I have a dll which is having pure virtual functions. Now what to do with that to redifine the function in my own class?
The usual thing you do: derive your class from the abstract one and redefine the methods.
Only the header file of the DLL plays a role in such a game...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
ok, Shell I do load the dll in memory.
Can you please tell the exact steps to do?
|
|
|
|
|
Hello all,
Please tell me how to get window shutdown notification in my MFC application?
-Cvaji
|
|
|
|
|
I know about WM_QUERYENDSESSION
Please tell me whether I can suspend the whole shutdown process when I receives this message
and whether I can resume/cancel the shutdown process.
|
|
|
|
|
I think you cannot suspend the shutdown process, but you can cancel it returning FALSE to the WM_QUERYENDSESSION message.
Maybe, while you are in your WM_QUERYENDSESSION message handler, the shutdown process is suspended, except when ExitWindowsEx was called with the flag EWX_FORCEIFHUNG, but I'm not sure about that.
|
|
|
|
|
Hello Sir
What is the main difference of static variable and Global Variable?
My Suggestion is :
Static variable accessing only through out the class and accessing need for scope resolution operator
Global variable accessing through out the program and accessing the class object.
Sir, My statements are correct or not
Failure is Success If we learn from it!!
|
|
|
|
|
Scoping is possible with a static variable (I'm not talking about a data member of a class, but in general). You could put a static variable within a function and have it retain its value through the life of the program, but the scope is restricted - code from outside the function where it's declared cannot change it.
A static global variable (global scope, but declared as static) is not visible outside the source file where it exists.
You got it right about a static data member.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Just for the sake of completeness, static is only understood by the compiler to scope the entity.
For the system, it is exactly the same as a global variable.
So if you're using an assembler to write programs, you do not have the luxury of static and you have to do the scoping yourself.
|
|
|
|
|
File = CreateFile(LocalPathPFile, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, \ FILE_FLAG_NO_BUFFERING, NULL);
The handle works perfectly! Except when I try to write I get error 87!
if (!WriteFile(File, Data, (DWORD)BytesReceived, NULL, NULL))
{
wchar_t Error[100];
swprintf(Error, L"Write Error: %d", GetLastError());
Tu(Error);
}
Could this mean because this is in a thread, I have to use overlapped for asynchronous I/O.
I declared an OVERLAPPED *Strc, passed it as 5th argument in WriteFile and still ended up with the same problem!
|
|
|
|
|
Fareed Rizkalla wrote: if (!WriteFile(File, Data, (DWORD)BytesReceived, NULL, NULL))
What type of variables are Data , and BytesReceived , and what are the values of those?
Error 87 means you're passing an invalid parameter (ERROR_INVALID_PARAMETER ), so check what you're passing into the call to WriteFile .
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Data is char.
BytesReceived is DWORD.
I forgot to remove the DWORD cast, still the same problem exists!
Data is used by a recv TCP/IP function!
|
|
|
|
|
Fareed Rizkalla wrote: Data is char.
Data CANNOT be char . It must be a void pointer. Please read the documentation[^].
Also, learn to use the error lookup utility that comes with VS.
Fareed Rizkalla wrote: BytesReceived is DWORD.
In which case, casting it to DWORD is totally pointless.
Fareed Rizkalla wrote: I forgot to remove the DWORD cast, still the same problem exists!
As I said above.
“Follow your bliss.” – Joseph Campbell
|
|
|
|