Search code examples
c++windowsmfclabview

CreateProcess on top of other windows applications MFC


I'm developing the MFC Application (C++) On i want to open the Labview program inside the MFC application and run top of the other windows on the main application. So, it does not work on CreateProcess() function.

#define  DIR_TEMP_MONITER   ".\\Application.exe"

STARTUPINFO         stStartup = { NULL, };
PROCESS_INFORMATION     stProcess = { NULL, };

stStartup.cb            = sizeof( STARTUPINFO );// The size of the structure
stStartup.lpReserved            = NULL;         // Reserved
stStartup.lpDesktop     = NULL;         // For NT
stStartup.lpTitle       = NULL;         // Console app title
stStartup.dwFlags       = 0;            // Which member is valid
stStartup.cbReserved2   = 0;
stStartup.lpReserved2   = NULL;


::CreateProcess(DIR_TEMP_MONITER,       // The name of the executable module
        NULL,               // Command line string
        NULL,               // Security descriptor
        NULL,               // Security descriptor
        FALSE,              // Handle inheritance option
        NORMAL_PRIORITY_CLASS,      // High priority class
        NULL,               // New environment block
        NULL,               // Current directory name
        &stStartup,         // Startup information
        &stProcess );           // Process information

I want to make this executable program run on top of the other windows. Is there any other method to do that?


Solution

  • I used the Labview program to Always on top the all application then it open in the windows CreateProcess function. That gives always on top of the other windows applications.

    thank you.