are there any method to make these changes to the EXE file iteself .
Thanks,
Main Topics
Browse All TopicsDear Experts ,
I have a software quite old (1998). it is in EXE . I think it is made by BORLAND C 3.00 because it contains libraries files for BoRLAND C 3.00 .It is working fine . but the problem is that I WANT TO DISABLE RIGHT MOUSE CLICK (as it displays Copy,Cut and past that I do NOT want user to access).
This is quite easy for you all , but the real problem is that the software I have is COMPILED INTO EXE .
I guess someone may work on the software as ASSEMBLY or may DEcompile it .
I will pay for the solution
Thanks,
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I believe you can override the mouse down event, and test if the button's value (1 = left button, 2 = right button).
If the button is equal to 2, do nothing. If 1, then do what ever you need it to.
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
' add your code here
End Sub
Hi,
If you are still interested, there is a way. Code to load a dll can be injected into the application and the actual start address of the application can be stored so that the dll can pass the control to the entry point of the executable. This injected dll will place hook for mouse messages for the application. This can be done and will require some bit of effort. Let me know if you are interested.
Regards,
Gaurav
hi,
make a vc win 32 application project named launch - add a file main.cpp
//////////////////////////
//main.cpp for launcher
#include <windows.h>
typedef void (__stdcall *SetHook)(HHOOK);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, char * strCmdLine, int nCmdShow)
{
HINSTANCE hHookLib = LoadLibrary("hook.dll");
// ff handle is found
if(hHookLib)
{
// get address to hook proc
HOOKPROC pHookProc = (HOOKPROC)GetProcAddress(h
SetHook pSetHook = (SetHook)GetProcAddress(hH
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
// create process
if(CreateProcess(strCmdLin
{
//set a mouse hook
HHOOK hHook = SetWindowsHookEx(WH_MOUSE,
// pass teh refrence to the dll so that it can use it
pSetHook(hHook);
// wait for the process to complete
WaitForSingleObject(pi.hPr
// remove the hook
UnhookWindowsHookEx(hHook)
// close process handle
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
}
return 0;
}
//////////////////////////
create a dll project named hook in vc - add a file main.cpp and paste the following code
//////////////////////////
// main.cpp - for hook.dll
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
// ".shared" is defined in exports.def to allow
// all instances of the dll to share these variables
#pragma data_seg(".shared")
HHOOK hHook = 0;
#pragma data_seg()
// Set the values for the window and hook for the windows hook
void WINAPI SetHook(HHOOK hk)
{
hHook = hk;
}
// HookProc
LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lParam)
{
if(nCode >= 0)
{
// if right button then consume message
switch(wParam)
{
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
return 1;
}
}
return CallNextHookEx(hHook, nCode, wParam, lParam);
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(
}
return TRUE;
}
//////////////////////////
add another file to the project named exports .def
////////////////
EXPORTS
SetHook
MouseProc
SECTIONS
.shared READ WRITE SHARED
//////////////
in the project setting link tab append the text below to define the exports
/def:".\exports.def"
compile both the projects and you would get launch.exe and hook.dll. place thse files in the directory of the target application and say launch.exe <full path of your application>.
I can send you built projects and source if you can give me your email address.
regards,
Gaurav
wings_gaurav@yahoo.com
have uploaded the built solution and source code at
http://www.4shared.com/fil
-wings
I have tested it for notepad , it worked well , but when i tested it for my application , it gave me the following message Box during loading the software
"The Logon system has been tampered with . The Adminstrator will need to re-installe. "
This message box has a title "Security Check failure"
When I press the OK button of this message box , the software closes .
What do you think .
Thanks,
Waleed
i think the software is checking for hooks and displaying the error message! this makes the problem more complex. there might be a way to add the hook after the logon occurs. for this to de done the code will need to be modified to wait for the main window to open and therafter add the hook. Untill i can have a look at the application i will not be able to help you with this.
regards,
gaurav
hi,
i have made the hook system wide now and uploaded the file at
http://www.4shared.com/fil
hope this works better with your application.
-gaurav
Business Accounts
Answer for Membership
by: DarrylshPosted on 2006-04-29 at 06:01:05ID: 16568742
You have to use a system wide mouse hook to capture the right clicks, once captured you check to see if they are for the application you are trying to block, if they are, you basically just "eat" that input but if they are not then you pass them on so that the right click still works elsewhere as intended.