Is it possible to minimize a dialog to the taskbar?

General Macro Scheduler discussion

Moderators: JRL, Dorian Ellis

Is it possible to minimize a dialog to the taskbar?

Postby Rain » Tue Mar 23, 2010 6:18 pm

When minimizing a macro scheduler dialog from the dialogs title bar it always minimizes to the desktop instead of the taskbar. Is it possible to minimize it to the taskbar without having to either double click the icon in the taskbar or right clicking it and then clicking minimize?

Thank you for your time.
Running Macro Scheduler 13.2.4 on Windows 7 Ultimate

Some of my Scripts I'm sharing with the world


Image
User avatar
Rain
Automation Wizard
 
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm

Postby Marcus Tettmar » Tue Mar 23, 2010 8:23 pm

No, I'm afraid not. That would need a modification to the underlying window class. I'll make a note to investigate whether or not its possible to make this an option for dialogs in future.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
User avatar
Marcus Tettmar
Site Admin
 
Posts: 5789
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK

Postby Rain » Mon Apr 19, 2010 3:22 pm

Thanks Marcus.
Running Macro Scheduler 13.2.4 on Windows 7 Ultimate

Some of my Scripts I'm sharing with the world


Image
User avatar
Rain
Automation Wizard
 
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm

Postby Marcus Tettmar » Mon Apr 19, 2010 3:33 pm

Note, this is possible with V12 via the new dialog objects's OnTaskBar property.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
User avatar
Marcus Tettmar
Site Admin
 
Posts: 5789
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK

Postby CyberCitizen » Fri May 21, 2010 3:43 am

mtettmar wrote:Note, this is possible with V12 via the new dialog objects's OnTaskBar property.

That's great, pity work wont shell out for v12, Been using MS since v4 (2002 I Think) but now I am stuck with v11 & the problem with the dialog designer where you can not edit the background of the dialog (F11). Having to do it manually is a bit of a pain.
FIREFIGHTER
Image
User avatar
CyberCitizen
Automation Wizard
 
Posts: 552
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Postby jpuziano » Fri May 21, 2010 5:28 am

mtettmar wrote:Note, this is possible with V12 via the new dialog objects's OnTaskBar property.

I took the example macro that comes with v12 called "Dialogs - Calculator" and modified the OnTaskBar property to be True instead of False and it does work... however there is no minimize control on the dialog, only the X to close it... so I had to use Windows Key-D (minimize everything) to test this.

Then I checked all the other dialog examples and all were the same in that they all didn't have a minimize control.

So this begs the question, what if I want a minimize control on my dialog, or a maximize control for that matter... what property do I alter to get those to appear? I looked at the Help file of course...

Macro Scheduler v12 'Form Properties' Help Topic wrote:Icon
Specifies the icon that appears when the form is minimized. Enter the filename to load an icon onto the form. Note that the icon data is loaded statically into and stored in the dialog and while the file name is also stored for reference there is no dynamic link to that file.

OnTaskBar
Controls whether form should be shown on and minimized to Windows task bar. Note that in a compiled macro this will also cause the main application task bar icon to hide and remain hidden for the duration of the script.

...but the above were the only two entries that mentioned minimizing in any way.

Thanks for any example you might provide Marcus... or any other v12 dialog wizard that might know how to do this.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)
User avatar
jpuziano
Automation Wizard
 
Posts: 1077
Joined: Sat Oct 30, 2004 12:00 am

Postby Marcus Tettmar » Fri May 21, 2010 9:23 am

Erm there's a minimize button on my dialog example. If there isn't on yours then just add it - add biMinimize to the BorderIcons property.

With OnTaskBar set to true it will now minimize to the task bar, rather than to just above the task bar as is normal for child windows.

Here's an example of a dialog that you can minimize to task bar:

Code: Select all
Dialog>Dialog1
object Dialog1: TForm
  Left = 697
  Top = 447
  HelpContext = 5000
  BorderIcons = [biSystemMenu, biMinimize]
  Caption = 'CustomDialog'
  ClientHeight = 223
  ClientWidth = 439
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  Position = poScreenCenter
  OnTaskBar = True
  PixelsPerInch = 96
  TextHeight = 13
end
EndDialog>Dialog1
Show>Dialog1,r
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
User avatar
Marcus Tettmar
Site Admin
 
Posts: 5789
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK

Postby JRL » Fri Jun 04, 2010 10:29 pm

Erm there's a minimize button on my dialog example. If there isn't on yours then just add it - add biMinimize to the BorderIcons property.
I agree with JP. None of my provided version 12 dialog sample scripts display any title bar buttons except the X to close. But that's not why I'm here.

I want to point out to anyone creating a new dialog that they want to be able to minimize to the task bar, there seem to be three properties that need to be set in order to achieve this new and wondrous phenomenon.

If I create a new blank dialog the code looks like this.

Code: Select all
Dialog>Dialog1
object Dialog1: TForm
  Left = 603
  Top = 101
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'CustomDialog'
  ClientHeight = 223
  ClientWidth = 439
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
end
EndDialog>Dialog1


Notice three major differences between this code and the code Marcus posted.

1) Marcus' code includes "biMinimize" under the BorderIcons property, the default dialog designer code does not.
2) Marcus' code has the OnTaskBar property set to "True", the default dialog designer code sets OnTaskBar to "False"

These were already mentioned.

3) Marcus' code also includes a value for the Position property, the dialog designer code does not explicitly set Position to anything and without being set to something, the dialog will not minimize to the task bar.

Hope this is helpful.
Dick
JRL
Automation Wizard
 
Posts: 2730
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Postby jpuziano » Sat Jun 05, 2010 4:46 pm

JRL wrote:
Erm there's a minimize button on my dialog example. If there isn't on yours then just add it - add biMinimize to the BorderIcons property.
I agree with JP. None of my provided version 12 dialog sample scripts display any title bar buttons except the X to close.

Thanks for confirming what I see JRL. Marcus, it might be beneficial if at least one of the v12 example scripts displayed full title bar buttons... for any users who might want to do this.

JRL wrote:3) Marcus' code also includes a value for the Position property, the dialog designer code does not explicitly set Position to anything and without being set to something, the dialog will not minimize to the task bar.

Great observation, thanks JRL. I hate to say it but, shouldn't this be documented somewhere?

Marcus, if this is indeed the case, then perhaps the default behavior for the dialog designer should be to set Position = poScreenCenter as that would help users who might be wondering why the dialog won't minimize to Taskbar... even though steps 1 and 2 were done.

Take care
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)
User avatar
jpuziano
Automation Wizard
 
Posts: 1077
Joined: Sat Oct 30, 2004 12:00 am

Postby Marcus Tettmar » Mon Jun 07, 2010 9:03 am

jpuziano wrote:
JRL wrote:3) Marcus' code also includes a value for the Position property, the dialog designer code does not explicitly set Position to anything and without being set to something, the dialog will not minimize to the task bar.

Great observation, thanks JRL. I hate to say it but, shouldn't this be documented somewhere?


Maybe, but I'm learning just as much as you guys. I didn't know this was the case. If I did it would either be documented or we'd find out why and change it.

We've unleashed a new organism with the new dialog designer and we're all learning and there are bound to be things I wasn't aware of. Expect improvements and/or documentation updates as things crop up over time.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
User avatar
Marcus Tettmar
Site Admin
 
Posts: 5789
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK

Postby jpuziano » Mon Jun 07, 2010 5:53 pm

mtettmar wrote:We've unleashed a new organism with the new dialog designer and we're all learning and there are bound to be things I wasn't aware of. Expect improvements and/or documentation updates as things crop up over time.

Will do. Thanks Marcus, keep up the great work and congrats on the latest addition to your family. :)
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)
User avatar
jpuziano
Automation Wizard
 
Posts: 1077
Joined: Sat Oct 30, 2004 12:00 am

Postby migro » Tue Dec 27, 2011 7:01 pm

With a compiled macro based on Marcus sample settings above I got 2 tabs in the taskbar, when running the *.exe. Can anyone confirm this?

The tab named: "Macro Sheduler" got only the icon shown inside, the tab named: "CustomDialog" represent the dialog.
Image

It seems to have something to do with "OnTaskBar = True". Without setting it to True, there is no second tab in the taskbar, but also the dialog can be minimized only to the lower left edge of the screen an not to the taskbar. Any idea how to get rid off the second tab with the icon insinde?
regards
migro
User avatar
migro
Pro Scripter
 
Posts: 130
Joined: Thu Nov 06, 2003 5:23 pm
Location: Germany

Postby jpuziano » Tue Dec 27, 2011 8:11 pm

Hi Migro,

migro wrote:Any idea how to get rid of the second tab with the icon inside?

Sure. Open the Help File, search for these topics:
Create exe
Command Line Options

In there you'll find info on Compile Options:
/HIDE
/NOSYSTRAY

I always use both of those when I compile a macro... to hide the Macro Scheduler window itself and prevent it from showing in the System Tray.

Take care
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)
User avatar
jpuziano
Automation Wizard
 
Posts: 1077
Joined: Sat Oct 30, 2004 12:00 am

Postby migro » Tue Dec 27, 2011 8:38 pm

Hi Jpuziano,

thanks a lot for the hint - it works.

I never used "/hide" before, because I didn't got the clou from the help text and thought it will hide the dialog window itself.... ;-)
regards
migro
User avatar
migro
Pro Scripter
 
Posts: 130
Joined: Thu Nov 06, 2003 5:23 pm
Location: Germany

Postby migro » Tue Dec 27, 2011 10:43 pm

Hi,

think I responded a little bit to early. It worked well with the dialog sample from Marcus. When I compiled my dialog (with some tabs and dialog handlers) it didn't work as expected.

I stripped down the code of my dialog and I found the piece where it goes miss, but I haven't any idea why. I use this handler to update a tooltip when dialog tabs are changed.
Code: Select all
// COMPILE_OPTS|H:\SIRONA\Archiv\Macros\Test2.exe|H:\SIRONA\Archiv\Macros\SEB\SEB2.ico|CONSOLE=0|INCLUDES=1| /NOSYSTRAY /HIDE
Dialog>Dialog1
object Dialog1: TForm
  Left = 255
  Top = 101
  HelpContext = 5000
  BorderIcons = [biSystemMenu, biMinimize]
  BorderStyle = bsSingle
  Caption = 'Custom Dialog'
  ClientHeight = 617
  ClientWidth = 696
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  Position = poScreenCenter
  ShowHint = True
  OnTaskBar = True
  PixelsPerInch = 96
  TextHeight = 13
  object LabelToolTip: TLabel
    Left = 512
    Top = 112
    Width = 175
    Height = 449
    AutoSize = False
    Caption = 'Tooltip...'
    Color = 11769220
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clblue
    Font.Height = -15
    Font.Name = 'MS Sans Serif'
    Font.Style = []
    ParentColor = False
    ParentFont = False
    Transparent = True
    WordWrap = True
  end
  object PageControl1: TPageControl
    Left = 0
    Top = 50
    Width = 485
    Height = 513
    ActivePage = ConfigTab
    TabOrder = 0
    object ConfigTab: TTabSheet
      Caption = 'Backup/Restore'
      ExplicitLeft = 0
      ExplicitTop = 0
      ExplicitWidth = 0
      ExplicitHeight = 393
    end
    object NotificationTab: TTabSheet
      Caption = 'Notification'
    end
  end
end
EndDialog>Dialog1

   Let>str501=Job-Parameter festlegen:...
   Let>str502="Email-Benachrichtigungen aktivieren" ...

   AddDialogHandler>Dialog1,ConfigTab,OnShow,TitelConfigTab
   AddDialogHandler>Dialog1,NotificationTab,OnShow,TitelNotificationTab

Show>Dialog1,r

SRT>TitelConfigTab
   // Tooltip für ConfigTab aktualisieren
   SetDialogProperty>Dialog1,LabelToolTip,Caption,str501
END>TitelConfigTab

SRT>TitelNotificationTab
   // Tooltip für NotificationTab aktualisieren
   SetDialogProperty>Dialog1,LabelToolTip,Caption,str502
END>TitelNotificationTab


When I comment out the line: "AddDialogHandler>Dialog1,ConfigTab,OnShow,TitelConfigTab" and compile it with /NoSystray /Hide, only one tab is shown in the taskbar. When I leave it in, 2 tabs are shown in the taskbar.

Any ideas or suggestions what causes this behavior?
regards
migro
User avatar
migro
Pro Scripter
 
Posts: 130
Joined: Thu Nov 06, 2003 5:23 pm
Location: Germany

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest