How to start a doc view app in hidden mode - Page 2
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18

Thread: How to start a doc view app in hidden mode

  1. #16
    Join Date
    Sep 2017
    Posts
    7

    Re: How to start a doc view app in hidden mode

    Quote Originally Posted by Igor Vartanov View Post
    BTW, taskbar button appears for top-level windows having WS_EX_APPWINDOW style and never does for WS_EX_TOOLWINDOW. So maybe an explicit juggling with the styles is required.
    Yes Igor, this could be a solution ... but is there possible to change this style flag, at runtime ? Because, at some point, this app should be visible ...

    In fact, while I am thinking, this flag should be setup as WS_EX_TOOLWINDOW only at startup, right after, I could switch back this flag as WS_EX_APPWINDOW ...

  2. #17
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,582

    Re: How to start a doc view app in hidden mode

    Afraid WS_EX_APPWINDOW style cannot be (un)set at runtime. Documentation says nothing about that, so you have to do some experiments.

    You may try to play with ITaskbarList shell interface to explicitly control the button visibility (which originally is window manager responsibility), but I suspect there must be some race between calling CreateWindowEx and button show-up, otherwise you have to force MFC to not set the style somehow.

    Well, as I said before, you're trying to interfere with standard window manager behavior and MFC routine execution. Typically, window manager does its work just fine, but under condition of heavyweight window tasks coming in a row there inevitably comes a lag. Not because of your code, but because of the limited performance of the Windows core component.

    You might live with that.

    Or you might radically refactor your app startup. Like, start with invisible tool window serving your tray icon needs, but create a MDI frame window only when instructed to go visible. Good knowledge of MFC is a must, as you are to change the standard way of launching MDI frame and doc-view part if you have one.

    Or even more radically, like splitting your functionality to a server part sitting in the tray and client GUI launched on demand. The server process may be hosted in interactive session or may be a Windows system service. And in the latter case you get three application executables (GUI client, tray icon agent, service) and installer package. You're going to have a lot of fun on this way.

    Everything has its price. Even fighting a little flicker in task bar does.
    Last edited by Igor Vartanov; Yesterday at 03:34 AM.
    Best regards,
    Igor

  3. #18
    Join Date
    Sep 2017
    Posts
    7

    Re: How to start a doc view app in hidden mode

    Hi Igor, and thank you for your research.

    I have tried to solve this issue by using ITaskbarList and seem to work, but this puzzle the code (I have remove the app icon from taskbar, but I have to ensure that I put this icon back, and clean up, etc.) ... is no worth it.

    And second solution is more complicate, and again, is no worth it ... I guess I should live with that. Thank you again !

Page 2 of 2 FirstFirst 12

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This a Codeguru.com survey!


On-Demand Webinars (sponsored)