flat assembler
Message board for the users of flat assembler.

Index > Windows > CreateProcess+SW_HIDE fails.

Author
Thread Post new topic Reply to topic
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
Hello everyone, I'm having trouble when calling CreateProcess with SW_HIDE option. It does work on some apps, but not on everything. I've tried it on calc.exe and seems it is ignoring this parameter. Is there any way to do it without using ShowWindow API ? I'm initializing structure like this:
Code:
sinfo STARTUPINFO
pinfo PROCESS_INFORMATION
mov [sinfo.cb],sizeof.STARTUPINFO
mov [sinfo.dwFlags],STARTF_USESHOWWINDOW
mov [sinfo.wShowWindow],SW_HIDE
invoke CreateProcess,0,"calc.exe",0,0,0,0,0,0,sinfo,pinfo
invoke ExitProcess,0    

Thank you.
Post 20 Jan 2012, 18:20
View user's profile Send private message Reply with quote
Yardman



Joined: 12 Apr 2005
Posts: 245
Location: US
Yardman
[ Post removed by author. ]


Last edited by Yardman on 04 Apr 2012, 04:50; edited 1 time in total
Post 20 Jan 2012, 21:46
View user's profile Send private message Reply with quote
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
So, without ShowWindow, there's no way to do it ? Sad
Post 20 Jan 2012, 21:59
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1418
Location: Toronto, Canada
AsmGuru62
To be safe - I would have set all bytes in STARTUPINFO to zero, since there are some reserved values that must be NULL:

http://msdn.microsoft.com/en-us/library/ms686331(v=vs.85).aspx

It is also possible that some apps do not respect the hiding flag - why would someone start the CALC.EXE in hidden form?
They want to work with it right away.

Smile
Post 20 Jan 2012, 22:57
View user's profile Send private message Send e-mail Reply with quote
Yardman



Joined: 12 Apr 2005
Posts: 245
Location: US
Yardman
[ Post removed by author. ]


Last edited by Yardman on 04 Apr 2012, 04:50; edited 1 time in total
Post 20 Jan 2012, 22:58
View user's profile Send private message Reply with quote
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
AsmGuru62
I was doing that, just forget to write it sorry Smile
Yardman
What do you mean with CREATE_SUSPENDED ? What are you suggesting ? ^^
--
I don't want someone to hide "calc.exe" from them, just trying to find a way how to hide the app which not accepts nCmdShow parameter Smile
Post 21 Jan 2012, 08:36
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.