Solved

process background in win9x

Posted on 2000-03-06
14
256 Views
Last Modified: 2013-11-20
hi
  I have some question can I make my program
run  as background process in win9x . I don't want it  show  when it run.


does anyone know how to do that  ? please advise me.
0
Comment
Question by:eakkung
  • 9
  • 5
14 Comments
 
LVL 1

Accepted Solution

by:
olgat earned 150 total points
ID: 2590963
Set m_nCmdShow = SW_HIDE in your application's InitInstance()
0
 

Author Comment

by:eakkung
ID: 2595064
umm.  I still have a little  question . Can  I  hide my application name  or change  while hold down   CTRL-ALT_DELETE ?

(when I  set my window  sw_show  , I can change my  application  name but when I set  it to  sw_hide  I can not do that).


please give  advise to me

thank you
0
 
LVL 1

Expert Comment

by:olgat
ID: 2595396
To remove your program from the Ctrl+Alt+Delete list do the following:

DWORD dwID = GetCurrentProcessId()
RegisterServiceProcess(dwID, RSP_SIMPLE_SERVICE)

To restore your application to the Ctrl+Alt+Delete list just "undo" it

RegisterServiceProcess(dwID,
RSP_UNREGISTER_SERVICE)
0
 

Author Comment

by:eakkung
ID: 2596960
I got a problem when  I use RegisterServiceProcess(dwID, RSP_SIMPLE_SERVICE) . I put it into my application's InitInstance().
and compile  it tell error to me like this

error C2065: 'RegisterServiceProcess' : undeclared identifier.


I use VC6  and win98.   how should I do.

0
 
LVL 1

Expert Comment

by:olgat
ID: 2597885
Sorry, I forgot to mention:
to call RegisterServiceProcess, you have to retrieve a function pointer using GetProcAddress on KERNEL32.DLL.
Something like that:

typedef DWORD (WINAPI *RegisterServiceProcess)(DWORD dwProcessId,DWORD dwType);
RegisterServiceProcess fncptr=NULL;
HMODULE hModule = ::GetModuleHandle(TEXT("kernel32.dll"));
fncptr=(RegisterServiceProcess)::GetProcAddress(hModule, "RegisterServiceProcess");
if (fncptr!=NULL)
   (*fncptr)(0, 1);


0
 

Author Comment

by:eakkung
ID: 2598678
Adjusted points to 150
0
 

Author Comment

by:eakkung
ID: 2598679
thank you very much,  I can do that  in Win98 . Can I hide  my process(from
task manager / application) in winnt like  in win98.?

where I can get  tutorial  about questions that I ask you. ( I saw in msdn  but  I don't undestand
and it have no  tuturail  to teach me)  I would like
to get it  and study by myself  so  I will not  bother  you  more than this.  

thank you for you kind  , :-)

p.s. I will increase  point  to 150  for you  
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:eakkung
ID: 2598680
thank you very much,  I can do that  in Win98 . Can I hide  my process(from
task manager / application) in winnt like  in win98.?

where I can get  tutorial  about questions that I ask you. ( I saw in msdn  but  I don't undestand
and it have no  tuturail  to teach me)  I would like
to get it  and study by myself  so  I will not  bother  you  more than this.  

thank you for you kind  , :-)

p.s. I will increase  point  to 150  for you  
0
 
LVL 1

Expert Comment

by:olgat
ID: 2599875
Thank you for points.
There is no tutorial on this issue in MSDN, you are right. Let me think a little where it could be found.

About NT: I think it is the same, but I have no NT machine to test. Again, let me think about it.
0
 

Author Comment

by:eakkung
ID: 2600981
thank you for you help.

I test in  NTmachine  ,with  your  solution  it can
hide from   task manager/ service  but It can not
hide  from   task manager/application.

I will waiting  for your advise.  

thank again...
0
 

Author Comment

by:eakkung
ID: 2607372
hi  olgat

 I have some a little question about hide window.  when I set   m_nCmdShow = SW_HIDE in my application's InitInstance() .It will  have a
flash  before it hide.  Can I get rid of that flash.?



please advise me again .. if you want me to post  this question  to new question for get new point to   you  . You can tell me ,I will post it to new  question.


thank you in advance.
0
 
LVL 1

Expert Comment

by:olgat
ID: 2607471
Do upu have a dialog-based or windowed application ?
0
 

Author Comment

by:eakkung
ID: 2608138
I have a dialog - based .
0
 

Author Comment

by:eakkung
ID: 2608530
I have a dialog - based .
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now