InterProcess Communication Using Visual C++ 6.0 | CodeGuru

InterProcess Communication Using Visual C++ 6.0

Environment: eg VC6 WIN9x/WINNT/WIN2K By using Visual C++ you can easily communicate with other application running on your desktop computer. You can easily do work on them. For example you can place text in a textbox, click a button and much more. In the Windows OS every object you see is a window and if […]

Written By
CodeGuru Staff
CodeGuru Staff
Nov 26, 2001
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Environment: eg VC6 WIN9x/WINNT/WIN2K

By using Visual C++ you can easily communicate with other application running on your desktop computer. You can easily do work on them. For example you can place text in a textbox, click a button and much more. In the Windows OS every object you see is a window and if you get the handle of a window, you can do many different things with it.

The key is to get the handle of the window and then make it into a CWnd Object. You can then play around with all the basic window APIs. You can even get the handle of your desktop, your Start button, and the system tray.

I will show you an example of how to get the handle of the windows Start button and enable and disable it. In the same way, you can capture any window running on the desktop.

  1. Create an MFC Dialog based Application
  2. Place two buttons in it and name them “enable” and “disable”
  3. In the “disable” button click event write the following code segment (say I call a function disable in it):
    // make them either global or class variables.
    
    HWND starthandle;
    CWnd StartButton;
    
    void disable(void)
    {
      // Since there is only one button on the desktop, you
      // will automatically get the handle of it, otherwise
      // you will give its caption name.
      // Button is the class name of the (Button) in windows.
      // You can see the description of (FindWindowEx) in MSDN
      // for more details.
    
      starthandle = FindWindowEx(NULL,NULL,"Button","");
      StartButton.m_hWnd=starthandle;
    
      // Now you have the button in the window form.
      // You can type cast it in either CButton or do whatever
      // you like. I will only make it invisible, so...
    
      StartButton.ShowWindow(FALSE);
    }
    
    void enable(void)
    {
      StartButton.ShowWindow(TRUE);
    }

    Downloads

    None

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.