Select category to view:

  • .Useful Things

    DO EVENTS

    Whilst your application will be multi threaded if you hold waiting for something you need to use this to allow other tasks on the same thread to execute, and to tell the OS that your holding so it’s OK for it to attend to other things. (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
    (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. (more…)

    Foreground Window Detect and Set

    Define The DLL Functions

    	[System::Runtime::InteropServices::DllImport(L"user32.dll")]
    	static System::IntPtr GetForegroundWindow();
    
     (more...)

    Getting Arguments Passed To The Application Exe

    //N.B. You can do this anywhere in the application – it doesn’t have to be in the main function.

    
    	array<String^> ^arguments = Environment::GetCommandLineArgs();
    	if (arguments != nullptr)
    	{
    		for each (String ^argument in arguments)
    		{
    			//CHECK THE NEXT ARGUMENT
    			//Note that if there we're no arguments you still get the exe filename / path as the first argument)
    
     (more...)

    Launching Specific Things

    Launching A Web Page In A Browser

    System::Diagnostics::Process::Start("http://www.ibexuk.com");

    (more…)

    Manipulating Other Applications

    FULL LIST OF AVAILABLE FUNCTIONS ON MSDN:
    http://msdn.microsoft.com/en-us/library/dd469351(VS.85).aspx (more…)

    Other System Applications

    Other Applications / Processes Running

    This is a C# example of finding all processes that are running with something particular in their name (include System.Diagnostics namespace):- (more…)