troubleshooting Question

Display a message box using C++

Avatar of cemplukcute2003
cemplukcute2003 asked on
4 Comments2 Solutions849 ViewsLast Modified:
Hi, can anyone help me to figure out display a message box using C++ code.
I need the code to b compatible with Linux and Mac.
I have this code but it only can run in Windows.

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <unistd.h>
#include <windows.h>
using namespace std;

int main()  {
      const char *filePath = "C:\\WINDOWS\\system32\\spool\\drivers32\\";
      char *msg;

      if(remove(filePath) != 0) {
            msg = "Uninstallation Unsuccessful, Please Contact Admin";
            MessageBox(NULL, msg, "Msg", MB_OK | MB_ICONERROR);
      else {
            msg = "Uninstallation Successful";
            MessageBox(NULL, msg, "Msg", MB_OK | MB_ICONINFORMATION);

      return 0;

Can someone help me, pls?
Thanks in advance

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. 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