?
Solved

process background in win9x

Posted on 2000-03-06
14
Medium Priority
?
266 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
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

 

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month9 days, 11 hours left to enroll

762 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