Solved

message to minimize a window in the task bar

Posted on 2000-02-17
5
529 Views
Last Modified: 2012-05-04
Hello!

I have a little problem with a application.

I have coded a function which can hide the window in the task bar and show instead his icon.
But this fonction reacts when I receive the message TWMSysCommand::SC_MINIMIZE.

I want to hide my application when it creates and not when I minimize it.

Can you help me in giving me the right message to catch or the right thing to do?

thanks!
0
Comment
Question by:ryuken
[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
  • 3
5 Comments
 
LVL 5

Accepted Solution

by:
jamoville earned 50 total points
ID: 2531779
In the InitInstance of the application you can tell the application to start up minimized.  This is a piece of code I used to start my application hidden.  You would change SW_HIDE to SW_MINIMIZE.

/* Create the main window, this code creates a new frame window object and then sets it as the application's main window object.*/
      
CMainFrame* pFrame = new CMainFrame();
if (pFrame == NULL)
{
  return FALSE;
}

// Set our thread's main window object.
m_pMainWnd = pFrame;

/* The one and only window has been initialized, so show and update it.
We don't want the window to be visible to the user, thus, we hide it.*/

m_pMainWnd->ShowWindow(SW_HIDE);  m_pMainWnd->UpdateWindow();
0
 
LVL 11

Expert Comment

by:alexo
ID: 2531807
If you don't ::ShowWindow() after creation, it will never draw.
Alternatively, try ::ShowWindow(hWnd, SW_HIDE);

This is obviously not a C++ question.  Better try the OWL area.
0
 

Author Comment

by:ryuken
ID: 2541540
Hello Jamoville!

I can't try the solutions that you give me. Because I'm using Borland C++ builder 4 and I can't create myself the main Window.

I can hide the main window if I put a timer which calls a function after this window has been shown.

But it is not perfect.

I have called this function when I have these events: OnCreate, OnShow, OnActivate. But It didn't work.

If you have any others idears, I thanks you.

0
 
LVL 5

Expert Comment

by:jamoville
ID: 2543030
Sorry - I'm not sure with Borland C++.  I would reject my answer and let others respond.  There has got to be someone out there with the answer.
0
 
LVL 5

Expert Comment

by:jamoville
ID: 2543819
Sorry - I'm not sure with Borland C++.  I would reject my answer and let others respond.  There has got to be someone out there with the answer.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

761 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