Jump to content

  • Log In with Google      Sign In   
  • Create Account


Create no window,but still creates it


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 noatom   Members   -  Reputation: 708

Like
0Likes
Like

Posted 30 April 2013 - 06:42 AM

STARTUPINFO si = {0};
    PROCESS_INFORMATION pi;

    ZeroMemory( &si, sizeof(si) );
    si.cb = sizeof(si);
    ZeroMemory( &pi, sizeof(pi) );
	si.wShowWindow = FALSE; 
	si.dwFlags = STARTF_USESHOWWINDOW;
    // Start the child process.
    if( !CreateProcess( NULL,chrPathtoExeFile,NULL,NULL,TRUE,CREATE_NO_WINDOW,NULL,NULL,&si,&pi ))
    {
        //printf( "win32::CreateProcess Error::: (%d).\n", GetLastError() );
        return;
    }

    // Close process and thread handles.
    //CloseHandle( pi.hProcess );
    //CloseHandle( pi.hThread );

 

This line is the problem:

 

CreateProcess( NULL,chrPathtoExeFile,NULL,NULL,TRUE,CREATE_NO_WINDOW,NULL,NULL,&si,&pi )

 

 

why does it create the window when i launch a certain app? i want the windows of that app to be invisible


Alexander Turda - The place where I talk about games, coding, movies, and whatever passes through my mind.


Sponsor:

#2 SiCrane   Moderators   -  Reputation: 9125

Like
1Likes
Like

Posted 30 April 2013 - 06:45 AM

Is the process you are spawning a console app? If not, then the CREATE_NO_WINDOW flag doesn't apply.

#3 noatom   Members   -  Reputation: 708

Like
0Likes
Like

Posted 30 April 2013 - 06:49 AM

no it's not,but even without that flag,the window still appears


Alexander Turda - The place where I talk about games, coding, movies, and whatever passes through my mind.


#4 Orangeatang   Members   -  Reputation: 1248

Like
0Likes
Like

Posted 30 April 2013 - 07:30 AM

SiCrane meant that if you're creating a process that isn't a console application, the CREATE_NO_WINDOW flag is ignored... i.e. only console applications will spawn without a window.



#5 noatom   Members   -  Reputation: 708

Like
0Likes
Like

Posted 30 April 2013 - 07:47 AM

but how do i launch a certain exe as invisible?


Alexander Turda - The place where I talk about games, coding, movies, and whatever passes through my mind.


#6 ColinDuquesnoy   Members   -  Reputation: 960

Like
0Likes
Like

Posted 30 April 2013 - 09:28 AM

Is it a 3rd party application or your own application?

 

If it is your own application you can setup command line arguments to hide the window.

 

If it is a 3rd party application, then you can get the top level window handle with FindWindow then call ShowWindow to hide it. I've never done it myself but I guess it could work...


Edited by renega_666, 30 April 2013 - 09:29 AM.


#7 noatom   Members   -  Reputation: 708

Like
0Likes
Like

Posted 30 April 2013 - 10:06 AM

thanks renega,it worked


Edited by noatom, 30 April 2013 - 10:09 AM.

Alexander Turda - The place where I talk about games, coding, movies, and whatever passes through my mind.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS