?
Solved

process background in win9x

Posted on 2000-03-06
14
Medium Priority
?
269 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 5
14 Comments
 
LVL 1

Accepted Solution

by:
olgat earned 600 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
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 

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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

649 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