CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2000
    Posts
    18

    Service and/or "no-show" window in Windows 95

    My understanding is that Windows 95 does not support services. If it is possible to have a service
    run, how is this done?

    If it is not possible/simple to have a service run, I want a program that does not show a window when
    it executes. I attempt to achieve this with ShowWindow. However, using this does not seem to stop
    a window from appearing briefly on the screen. Is there a way to keey the program from appearing at
    all?

    Here are your options, joex



  2. #2
    Join Date
    Apr 2000
    Location
    San Francisco, California, USA
    Posts
    4,467

    Re: Service and/or "no-show" window in Windows 95

    Here you can read about services in Windows 95/98:
    http://msdn.microsoft.com/library/ps...95scm_5cmq.htm

    You can create an application without any windows at all, or
    you can create an application with invisible windows. To
    create invisible window just make sure that WS_VISIBLE style
    is not specified at window creation. ShowWindow should also
    work.


    Russian Software Development Network -- http://www.rsdn.ru

  3. #3
    Join Date
    Dec 2000
    Posts
    18

    Re: Service and/or "no-show" window in Windows 95

    The window still briefly appears even when WS_VISIBLE is removed from the dialog in the rc file.

    How can a project be created without any windows - I don't mean a console application, because a DOS window also appears for a moment.


  4. #4
    Join Date
    Apr 2000
    Location
    San Francisco, California, USA
    Posts
    4,467

    Re: Service and/or "no-show" window in Windows 95

    You didn't mention in the original post that the window is
    a dialog window. Now I understand your problem, since I had
    the same.

    Modal dialog is shown regardless of WS_VISIBLE style in the
    dialog template. Moreover, calling ShowWindow(SW_HIDE) in
    WM_INITDIALOG handler also won't help, because the system
    shows dialog some later (and I don't know exactly when it
    happens -- I tried to track it without success).

    I resolved it by creating modeless dialog. It will be hidden
    if WS_VISIBLE flag is not specified in the dialog template.

    If you want to create a project without any windows just do
    your job inside WinMain function. Or, if you are using MFC,
    do it inside InitInstance and return FALSE.


    Russian Software Development Network -- http://www.rsdn.ru

  5. #5
    Join Date
    Dec 2000
    Posts
    18

    Re: Service and/or "no-show" window in Windows 95

    If no dialog is created, then putting either:

    return FALSE;
    return TRUE;

    in InitInstance - results in the program exiting. Does there have to be a modeless dialog for this to work?


  6. #6
    Join Date
    Apr 2000
    Location
    San Francisco, California, USA
    Posts
    4,467

    Re: Service and/or "no-show" window in Windows 95

    I mean you should do all your work inside InitInstance and
    exit from this function only when entire program has to exit.


    Russian Software Development Network -- http://www.rsdn.ru

  7. #7
    Join Date
    Dec 2000
    Posts
    18

    Re: Service and/or "no-show" window in Windows 95

    Thanks.

    BTW, to make a modal dialog invisible, do the following:

    in DefWindowProc, put:

    if (message == WM_NCPAINT)
    {
    ShowWindow(SW_HIDE);
    }


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured