Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: C++ Seattle minimize application



Permlink Replies: 7 - Last Post: Oct 27, 2016 3:21 PM Last Post By: Doug Hay
Doug Hay

Posts: 122
Registered: 5/26/05
C++ Seattle minimize application
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 20, 2016 11:41 PM
When I minimize my application on Windows 10, the small 1/4" x 1.5" 'sliver' appears in the lower left corner. Why doesn't it minimize like other Windows 10 programs, onto an icon on the taskbar?

Pic here

www.douglashay.com/tracks/snip.PNG

Thanks!

This is probably in the wrong forum, but at least questions in this forum get answers :)

Edited by: Doug Hay on Aug 20, 2016 11:42 PM
Antonio Estevez

Posts: 665
Registered: 4/12/00
Re: C++ Seattle minimize application [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 21, 2016 12:15 AM   in response to: Doug Hay in response to: Doug Hay
El 21/08/2016 a las 8:42, Doug Hay escribió:
When I minimize my application on Windows 10, the small 1/4" x 1.5" 'sliver' appears in the lower left corner. Why doesn't it minimize like other Windows 10 programs, onto an icon on the taskbar?

Pic here

www.douglashay.com/tracks/snip.PNG

Thanks!

This is probably in the wrong forum, but at least questions in this forum get answers :)

Edited by: Doug Hay on Aug 20, 2016 11:42 PM

Most likely you are minimizing the form instead of the application

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: C++ Seattle minimize application [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 22, 2016 11:00 AM   in response to: Doug Hay in response to: Doug Hay
Doug wrote:

When I minimize my application on Windows 10, the small 1/4" x 1.5"
'sliver' appears in the lower left corner. Why doesn't it minimize
like other Windows 10 programs, onto an icon on the taskbar?

Pic here

www.douglashay.com/tracks/snip.PNG

Thanks!

This is probably in the wrong forum, but at least questions in this
forum get answers :)

It means you must have done something in your code to make the window incompatible
for minimizing to the Taskbar. Only top-level unowned windows, or windows
with the WS_EX_APPWINDOW style, can minimize to the Taskbar. But you have
not shown your code, so we can't see what you did to cause this behavior.

--
Remy Lebeau (TeamB)
Doug Hay

Posts: 122
Registered: 5/26/05
Re: C++ Seattle minimize application [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 18, 2016 11:33 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
I am just using WindowState = wsMinimized;

If a user adds my icon to the Taskbar, if they minimize my program (which doesn't minimize to the task bar, it creates a small rectangle above the Windows icon in the lower left corner). So if they click the icon on the taskbar it doesn't restore the program that is running, it starts another copy of the program which is not what I want. I want to make it where they hover over the icon in the taskbar, and it will show which windows are available to select. I have the main form, then I have forms for racing and practice.

Thanks for the help!
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: C++ Seattle minimize application [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 18, 2016 12:04 PM   in response to: Doug Hay in response to: Doug Hay
Doug wrote:

I am just using WindowState = wsMinimized;

You have to be doing more than that to cause the symptoms you have described.

If a user adds my icon to the Taskbar

How is the user adding your icon to the Taskbar?

if they minimize my program (which doesn't minimize to the task
bar, it creates a small rectangle above the Windows icon in the
lower left corner).

Which again means you must have done something in your code to make the window
incompatible for minimizing to the Taskbar. Please show your actual code.
In particular, are you overriding the Form's CreateParams() method?

--
Remy Lebeau (TeamB)
Doug Hay

Posts: 122
Registered: 5/26/05
Re: C++ Seattle minimize application [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 18, 2016 12:39 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
I am just using WindowState = wsMinimized;

You have to be doing more than that to cause the symptoms you have described.

If a user adds my icon to the Taskbar

How is the user adding your icon to the Taskbar?

Just by drag and drop a desktop icon onto the task bar. Then there is a shortcut to the app on the taskbar.

if they minimize my program (which doesn't minimize to the task
bar, it creates a small rectangle above the Windows icon in the
lower left corner).

Which again means you must have done something in your code to make the window
incompatible for minimizing to the Taskbar. Please show your actual code.

void __fastcall TFormStartup::ButtonMinimizeClick(TObject *Sender)
{
WindowState = wsMinimized;
}

In particular, are you overriding the Form's CreateParams() method?

No I am not.

Thanks for the help!
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: C++ Seattle minimize application [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 18, 2016 1:03 PM   in response to: Doug Hay in response to: Doug Hay
Doug wrote:

Just by drag and drop a desktop icon onto the task bar. Then there
is a shortcut to the app on the taskbar.

Well, then it makes perfect sense why a new instance of your app is being
created each time they click on that Taskbar icon. They are executing the
shortcut each time, which creates a new process. They are not clicking on
the Taskbar button of the app that is already running - because there is
no Taskbar button! You said it yourself, your app is not minimizing to the
Taskbar correctly, so there is nothing on the Taskbar for the user to click
on! You need to figure you what you broken in your app that is preventing
it from minimizing to the Taskbar correctly. You had to have done SOMETHING
to cause it, because Forms minimize correctly by default.

void __fastcall TFormStartup::ButtonMinimizeClick(TObject *Sender)
{
WindowState = wsMinimized;
}

That is not the code I wanted to see. And FYI, if you are trying to minimize
the whole app, you should be using Application.Minimize() instead.

What ELSE is your Form doing exactly? Are you doing anything to mess around
with your Form's window styles (from the Win32 API perspective, not the VCL's)?
Does your app have multiple Forms open at a time? If so, how are they related
to each other?

--
Remy Lebeau (TeamB)

Doug Hay

Posts: 122
Registered: 5/26/05
Re: C++ Seattle minimize application [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 27, 2016 3:21 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Thank you for the reply.

My application has many forms, and there can be 3 or 4 open at a time, all are just opened with Form->Show();

When I minimize I want to just minimize that one form. So I just change the WindowState. Yesterday on 2 different Windows 10 PC's the exact same application acted differently on each PC. One one it minimized to the taskbar, on the other it minimized to a small rectangle in the lower left corner. What I would like is when I hover over the icon in the task bar that it displays the available forms and I select which one I want to restore.

If I put my application as a shortcut on the taskbar, run it, then click the Windows minimize button the app minimizes to a small rectangle. (see pic). Clicking the icon in the task bar does nothing, it doesn't start a second copy of the program or restore it. I must click the restore or maximize on the small rectangle shown in the pic. Yesterday I was logged onto a PC with Team Viewer, and if he minimized the program the taskbar showed the program if you hovered over the icon, but clicking on it did nothing. Also he had no small rectangle like the one in the picture in the link below. So he had to use task manager to kill it.

See pic here www.douglashay.com/tracks/min.png

Maybe I could send the minimize message instead.

So I am confused for sure! Thank you for the help.

Remy Lebeau (TeamB) wrote:
Doug wrote:

Just by drag and drop a desktop icon onto the task bar. Then there
is a shortcut to the app on the taskbar.

Well, then it makes perfect sense why a new instance of your app is being
created each time they click on that Taskbar icon. They are executing the
shortcut each time, which creates a new process. They are not clicking on
the Taskbar button of the app that is already running - because there is
no Taskbar button! You said it yourself, your app is not minimizing to the
Taskbar correctly, so there is nothing on the Taskbar for the user to click
on! You need to figure you what you broken in your app that is preventing
it from minimizing to the Taskbar correctly. You had to have done SOMETHING
to cause it, because Forms minimize correctly by default.

void __fastcall TFormStartup::ButtonMinimizeClick(TObject *Sender)
{
WindowState = wsMinimized;
}

That is not the code I wanted to see. And FYI, if you are trying to minimize
the whole app, you should be using Application.Minimize() instead.

What ELSE is your Form doing exactly? Are you doing anything to mess around
with your Form's window styles (from the Win32 API perspective, not the VCL's)?
Does your app have multiple Forms open at a time? If so, how are they related
to each other?

--
Remy Lebeau (TeamB)

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02