Question

Disable right mouse Click in EXE Program... (I'll pay for the solution)

Asked by: waleed_makarem

Dear 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.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2006-04-28 at 07:43:03ID21831231
Tags

mouse

,

click

,

right

Topic

Miscellaneous Programming

Participating Experts
3
Points
500
Comments
22

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

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.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

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.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

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.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Delphi decompiler ?
    Where can find a Delphi decompiler ? I have exe2dpr but isn't yet a decompiler ( don't read the procedure body ) .
  2. Decompiler?
    Does anyone know of any kind of program that will ??decompile?? an *.exe that was built using delphi?
  3. exe to C++, NEone know a good decompiler..
    im lookin for a decompiler that converts exe (and other files) to C++, anyone know where I can find one? or a name? --note: i've found some that decompile to assembly or C but what i need has to decompile to c++ (and a decent one as well ) ok im new to this board as well, so...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

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.

Join the Community

Answers

 

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.

 

by: waleed_makaremPosted on 2006-04-29 at 15:59:17ID: 16570446

are there any method to make these changes to the EXE file iteself .

Thanks,

 

by: waleed_makaremPosted on 2006-04-30 at 05:42:08ID: 16572331

can you do it in visual basic 6 please .

Thanks,

 

by: Masta120Posted on 2006-04-30 at 14:42:07ID: 16574045

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

 

by: waleed_makaremPosted on 2006-05-01 at 07:36:33ID: 16577503

this is ok , but how to do this with HOOKING mouse events + Testing that this event is triggered from the application of interest not for all applications .

Can you do some code please .

Thanks,

 

by: wings_gauravPosted on 2006-05-01 at 07:56:05ID: 16577674

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

 

by: waleed_makaremPosted on 2006-05-01 at 08:00:56ID: 16577712

yeah , I am really so interest .
do you use Visual basic 6.0

 

by: wings_gauravPosted on 2006-05-01 at 08:02:48ID: 16577736

it will require vc, win 32 api.

-gaurav

 

by: waleed_makaremPosted on 2006-05-01 at 08:08:29ID: 16577781

Ok ,
if so , You will worth at least 500 points for it * 4(experts) =2000 points .

how long will it take to be ready

 

by: wings_gauravPosted on 2006-05-01 at 08:12:32ID: 16577809

give me a day or two. Just to understand the requirements clearly – ALL right mouse clicks will get disabled on an exe fro which you don’t have source code i.e. just the exe.

Right?

-gaurav

 

by: waleed_makaremPosted on 2006-05-01 at 08:17:28ID: 16577854

yeah , but for a certain application ONLY , ie to disable it in A working WORD , but does NOT affect opertion of other softwares eg EXCEL , WORDPAD ,... etc .

 

by: waleed_makaremPosted on 2006-05-04 at 01:50:06ID: 16603679

Hi ,

Any news .................. .

I hope there will be good solution soon .
Waiting for your genius code .


Regards,

 

by: wings_gauravPosted on 2006-05-04 at 09:49:42ID: 16607473

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(hHookLib, "MouseProc");            
            SetHook pSetHook = (SetHook)GetProcAddress(hHookLib, "SetHook");
            
            STARTUPINFO si;
            PROCESS_INFORMATION pi;
            ZeroMemory( &si, sizeof(si) );
            si.cb = sizeof(si);
            ZeroMemory( &pi, sizeof(pi) );

            // create process
            if(CreateProcess(strCmdLine,"", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
            {
                  //set a mouse hook
                  HHOOK hHook = SetWindowsHookEx(WH_MOUSE, pHookProc, hHookLib, pi.dwThreadId);
                  // pass teh refrence to the dll so that it can use it
                  pSetHook(hHook);

                  // wait for the process to complete
                  WaitForSingleObject(pi.hProcess, INFINITE);

                  // 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(hinstDLL);
      }
      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

 

by: waleed_makaremPosted on 2006-05-05 at 02:17:08ID: 16612964

Dear Gaurav ,

Thanks for the code , I hope you can send me the built and the source code projects .
I am very very interested to try  it .

My mail is
waleed.makarem@gmail.com

thanks again .

waleed

 

by: wings_gauravPosted on 2006-05-05 at 03:29:28ID: 16613361

have uploaded the built solution and source code at

http://www.4shared.com/file/1508488/d9ed2729/hook_app.html

-wings

 

by: waleed_makaremPosted on 2006-05-05 at 04:27:02ID: 16613608

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

 

by: wings_gauravPosted on 2006-05-05 at 04:36:04ID: 16613651

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

 

by: waleed_makaremPosted on 2006-05-05 at 04:55:07ID: 16613726

what if we made a simple software , it is a separate software that loads when microsoft windows loads at start up . it checks mouse click then check if the software that triggers the mouse click . if has the same software name of interest, then it will cancel the mouse click event .



waleed

 

by: wings_gauravPosted on 2006-05-05 at 13:20:12ID: 16618017

hi,

i have made the hook system wide now and uploaded the file at

http://www.4shared.com/file/1514560/3fc17eaa/hook_app_-_1.html

hope this works better with your application.

-gaurav

 

by: waleed_makaremPosted on 2006-05-05 at 13:30:05ID: 16618066

sorry, but it seems that it has the same problem .


Waleed

 

by: waleed_makaremPosted on 2006-05-05 at 13:45:15ID: 16618163

i've tried it for winamp and word and excel , it worked great , BUT not for my application .
I do not know why .

thanks,
Waleed

 

by: waleed_makaremPosted on 2006-05-09 at 07:56:22ID: 16639834

Dear Gaurav,

Thanks for your effort and your interest .

Regards,
Waleed

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...