CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Location
    SF Bay
    Posts
    51

    How Do I Prevent My Application From Showing Up On the Screen's TASKBAR?

    Hi,

    I've searched the forum on getting this accomplished and it seems that the solution is to set the extended style of the application's main CDialog object to WS_EX_TOOLWINDOW (or just check it in the resource manager). However it doesn't work for some reason. The application still shows up on the taskbar. I've included the relevant code, please let me know if you see something I'm doing incorrectly. FYI the size of the CDialog object is determined by the size of the monitor screen, thus the reason for calling SetWindowPos().

    Here is the OnInitDialog() function where I set the style of the CTickerDlg object which inherits from CDialog:


    BOOL CTickerDlg::OnInitDialog()
    {
    CDialog::OnInitDialog();

    // Set the icon for this dialog. The framework does this automatically
    // when the application's main window is not a dialog

    SetIcon(m_hIcon, TRUE); // Set big icon
    SetIcon(m_hIcon, FALSE); // Set small icon

    // Get the width and height of the monitor screen to determine the size and
    // location of the ticker.

    m_WinXSize = GetSystemMetrics (SM_CXSCREEN); // screen width.
    m_WinYSize = GetSystemMetrics (SM_CYSCREEN); // screen height.
    ModifyStyleEx(0, WS_EX_TOOLWINDOW);
    SetWindowPos(NULL, 0, m_WinYSize-55, m_WinXSize, 30, SWP_NOZORDER | SWP_SHOWWINDOW);

    return TRUE; // return TRUE unless you set the focus to a control
    }





  2. #2
    Join Date
    Apr 1999
    Posts
    37

    remove WS_EX_APPWINDOW

    Hi,
    Its important that u remove the extended style WS_EX_APPWINDOW also.So change ModifyStyleEx to this
    ModifyStyleEx(WS_EX_APPWINDOW,WS_EX_TOOLWINDOW).




  3. #3
    Join Date
    May 1999
    Location
    SF Bay
    Posts
    51

    Thanks! It worked out beautifully (EOM)

    Thanks! It worked out beautifully.


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