Solved

process background in win9x

Posted on 2000-03-06
14
258 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Decoding 32 bit binary streams 6 43
Error on moodle after upgrade 3 131
notReplace  challenge 53 131
Window placement 17 83
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

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