Solved

process background in win9x

Posted on 2000-03-06
14
259 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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
 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Folder Comparison 12 54
isEverywhere  challenge 19 82
wordcount challenge 11 134
Updating statistics with error notification email in SQL server 4 110
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

831 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