Create A New Class

To create A new class, which will create the .cpp and .h files: Project > Add Class > C++ Class Typically: Specify the class name.  You don’t need to provide a base class. Select public and select managed. In the new .h file add the following: The namespace can be a distinct name, or for […]

Read More

Launching Specific Things

Launching A Web Page In A Browser System::Diagnostics::Process::Start("http://www.ibexuk.com"); Opening file in Notepad using namespace System::Diagnostics; ProcessStartInfo ^startInfo = gcnew ProcessStartInfo(); startInfo->FileName = "C:\\Windows\\notepad.exe"; startInfo->Arguments = "\"" + Path::GetDirectoryName(Application::ExecutablePath) + "\\SomeDocName.Config\""; Process::Start(startInfo); Launching Another Application From C++ using namespace System::Diagnostics; Process::Start("C:\\GVNVR\\ViewLog500.exe"); //or System::Diagnostics::Process::Start("C:\\GVNVR\\ViewLog500.exe"); If you need to pass arguments then use ProcessStartInfo ^startInfo = gcnew ProcessStartInfo(); […]

Read More

Foreground Window Detect and Set

Define The DLL Functions [System::Runtime::InteropServices::DllImport(L”user32.dll”)] static System::IntPtr GetForegroundWindow(); [System::Runtime::InteropServices::DllImport(L”user32.dll”)] static bool SetForegroundWindow(System::IntPtr hWnd); Check Some Other Ap Is Not In Foreground System::IntPtr WinHandle = GetForegroundWindow(); //BRING US TO THE FRONT if (WinHandle == ProcessName->MainWindowHandle) //ProcessName is a process we created elsewhere SetForegroundWindow(this->Handle); //Can test return bool value if we want //Use this if you want […]

Read More

Assembly Attributes

You may want to use FileVersionInfo instead of or in attaion to these as they get passed into the .exe file and are viewable in explorer, whereas assembly attributes don’t using namespace System::Windows::Forms; Assembly attributes are basically global text strings that you can get at in your code. Default Assembly Attributes They are in the […]

Read More

FileVersionInfo

You can read file version attributes of your applications exe or other files using this class.  If you prefer to use file attributes for your application rather than assembly attributes (so they show up in the exe file properly in explorer etc), you can use this to read them in you application. Reading Values (Application […]

Read More