Home > OS >  ::CreateProcess on top of other windows applications MFC
::CreateProcess on top of other windows applications MFC

Time:10-27

I'm developing the MFC Application(C ) On i want to open the Labview program in side the MFC application and and run top of the other windows on the main application. So it dos 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 the this excitable program run on top of the other windows. Are there any of the method to do that?

thank you.

CodePudding user response:

I used the Labviwe 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.

CodePudding user response:

Another solution is to use

SetWindowPosition

In your main frame, you can write:

SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
  • Related