Windows XP Group Application Name / TaskManager Icon 
Author Message
 Windows XP Group Application Name / TaskManager Icon

I have embedded TCL/TK into a simple windows executable and could use
a little help from some MFC experts as to how I should go about the
following:

1. Changing (at run time) the application name (name of the
executable) that Windows displays in its Start "running application"
bar. As I have not set this windows uses "xwish" - the name of my
executable. This is the equivalent of [info nameofexecutable].

I only need to be able to do this as XP groups multiple toplevel
windows together and then no longer shows the title I had set with "wm
title". Instead it shows the executable name.

Sounds like TK needs a wm title -default argument? Or is this
something more fundamental?

Using [tk appname newname] does not help.

2. Changing (at run time) the icon which windows associates with the
executable. Once again this is an XP feature ;-) grouping multiple
toplevels together. Setting this with [wm iconbitmap -default] works
correctly until a number of toplevels exist, at which point XP groups
them together and shows the icon associated with my executable. As
this has not been set it then shows an "ugly" default
icon...(Microsoft's way of telling the world that the program was not
Made-For-Windows)

Note: This grouping feature may be disabled for the task bar,
apparently though XP comes with it enabled.

Thanks for any tips!

Mark



Sun, 19 Feb 2006 16:15:36 GMT  
 Windows XP Group Application Name / TaskManager Icon

Quote:

> I have embedded TCL/TK into a simple windows executable and could use
> a little help from some MFC experts as to how I should go about the
> following:

> 1. Changing (at run time) the application name (name of the
> executable) that Windows displays in its Start "running application"
> bar. As I have not set this windows uses "xwish" - the name of my
> executable. This is the equivalent of [info nameofexecutable].

> I only need to be able to do this as XP groups multiple toplevel
> windows together and then no longer shows the title I had set with "wm
> title". Instead it shows the executable name.

> Sounds like TK needs a wm title -default argument? Or is this
> something more fundamental?

> Using [tk appname newname] does not help.

> 2. Changing (at run time) the icon which windows associates with the
> executable. Once again this is an XP feature ;-) grouping multiple
> toplevels together. Setting this with [wm iconbitmap -default] works
> correctly until a number of toplevels exist, at which point XP groups
> them together and shows the icon associated with my executable. As
> this has not been set it then shows an "ugly" default
> icon...(Microsoft's way of telling the world that the program was not
> Made-For-Windows)

> Note: This grouping feature may be disabled for the task bar,
> apparently though XP comes with it enabled.

> Thanks for any tips!

KDE can use a similar option to group applications together on the
taskbar. If you are using multiple toplevels within the same app, you
might like to experiment with setting the toplevels' -class so that all
toplevels have the same (and hopefully unique) class: i.e.

   toplevel .window1 -class MyApp
   toplevel .window2 -class MyApp

In addition, if you are only using the main window "." in the app, and
have several instances of the app running, you can set the class of . in
two ways:

1) If you start the app using the wish executable (most likely) you can
set the appname (and class for .) on the command line:

   wish -name myApp myapp.tcl

but you may need to create a new shortcut in order to do this.

2) If you start the app using tclsh and then package require Tk, you can
set the argv before doing so:

   tclsh myapp.tcl

   set ::argv [list -name myApp]
   set ::argc [llength $::argv]
   package require Tk

This option requires Tk 8.4 or higher.

You will probably need to experiment a bit, cause I haven't tried this
on Windows XP, but this is what I do on KDE.

--
Mark G. Saye



Mon, 20 Feb 2006 00:22:01 GMT  
 Windows XP Group Application Name / TaskManager Icon

Quote:
> KDE can use a similar option to group applications together on the
> taskbar. If you are using multiple toplevels within the same app, you
> might like to experiment with setting the toplevels' -class so that all
> toplevels have the same (and hopefully unique) class: i.e.

>    toplevel .window1 -class MyApp
>    toplevel .window2 -class MyApp

> In addition, if you are only using the main window "." in the app, and
> have several instances of the app running, you can set the class of . in
> two ways:

> 1) If you start the app using the wish executable (most likely) you can
> set the appname (and class for .) on the command line:

>    wish -name myApp myapp.tcl

> but you may need to create a new shortcut in order to do this.

Thanks but unfortunately none of this worked in XP with TK8.4.4. Seems
like adding a resource file to the windows executable is the way to
go, much like wish handles its resource file. I still don't know how
to change this then at run time but at least it's a start.

Something for the folks at http://tcl.projectforum.com/tk/Home to take
a look at perhaps!

Mark



Mon, 20 Feb 2006 15:28:42 GMT  
 Windows XP Group Application Name / TaskManager Icon

Quote:

> 1. Changing (at run time) the application name (name of the
> executable) that Windows displays in its Start "running application"
> bar. As I have not set this windows uses "xwish" - the name of my
> executable. This is the equivalent of [info nameofexecutable].

It is the title of the toplevel (wm title $toplevel ?title?).

Quote:
> Sounds like TK needs a wm title -default argument? Or is this
> something more fundamental?

Why -default?  Just title windows as they are created.  They should
not all get the same title, as each window should have a purpose.
Perhaps you aren't titling the main '.' window?

Quote:
> 2. Changing (at run time) the icon which windows associates with the
> executable. Once again this is an XP feature ;-) grouping multiple
> toplevels together. Setting this with [wm iconbitmap -default] works
> correctly until a number of toplevels exist, at which point XP groups
> them together and shows the icon associated with my executable. As
> this has not been set it then shows an "ugly" default
> icon...(Microsoft's way of telling the world that the program was not
> Made-For-Windows)

For the executable you have to modify the resource section of the
executable, which must be done outside Tk.  Otherwise at runtime you
can change what the taskbar/titlebar uses, as you have noted above.

--
     Jeff Hobbs                     The Tcl Guy
     Senior Developer               http://www.ActiveState.com/
         Tcl Support and Productivity Solutions



Sat, 25 Feb 2006 23:29:35 GMT  
 Windows XP Group Application Name / TaskManager Icon

Quote:

> > 1. Changing (at run time) the application name (name of the
> > executable) that Windows displays in its Start "running application"
> > bar. As I have not set this windows uses "xwish" - the name of my
> > executable. This is the equivalent of [info nameofexecutable].

> It is the title of the toplevel (wm title $toplevel ?title?).

> > Sounds like TK needs a wm title -default argument? Or is this
> > something more fundamental?

> Why -default?  Just title windows as they are created.  They should
> not all get the same title, as each window should have a purpose.
> Perhaps you aren't titling the main '.' window?

I can only see this as being necessary where a 'wish' is being used
and a developer does not want WinXP to show the "Wish Application"
executable resource name in the Taskbar (when multiple toplevels are
being employed). The "Wish Application" text is compiled into the wish
through its resource.

Quote:
> > 2. Changing (at run time) the icon which windows associates with the
> > executable. Once again this is an XP feature ;-) grouping multiple
> > toplevels together. Setting this with [wm iconbitmap -default] works
> > correctly until a number of toplevels exist, at which point XP groups
> > them together and shows the icon associated with my executable. As
> > this has not been set it then shows an "ugly" default
> > icon...(Microsoft's way of telling the world that the program was not
> > Made-For-Windows)

> For the executable you have to modify the resource section of the
> executable, which must be done outside Tk.  Otherwise at runtime you
> can change what the taskbar/titlebar uses, as you have noted above.

Right but as I said with WinXP this only is possible provided WinXP
does not group all the Toplevels, try this script out and you should
see what I mean:

wm title . "Main Window"
toplevel .top1
wm title .top1 "Top1"
toplevel .top2
wm title .top2 "Top2"
toplevel .top3
wm title .top3 "Top3"
toplevel .top4
wm title .top4 "Top4"
toplevel .top5
wm title .top5 "Top5"
toplevel .top6
wm title .top6 "Top6"
toplevel .top7
wm title .top7 "Top7"
toplevel .top8
wm title .top8 "Top8"

Now if I only have one row in the Taskbar WinXP makes one Taskbar
entry with the name "Wish Application" and only shows Main Window, Top
1....Top8 when I click on the taskbar button. I have no way of
changing the text "Wish Application". The same goes for its Icon.

For my own application, this is not a problem as you suggested I have
set the resource section outside of TK. However, I'd still like to be
able to do this at run time too.

Thanks for your input!



Tue, 28 Feb 2006 19:48:18 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. ANN: Icons XP Group II Released

2. Change Application Icon in MS Windows TCL/Tk application

3. shortcuts / icons / program groups on windows?

4. Access named pipe in Windows XP

5. Application Error on Windows XP

6. An application in Clipper 5.3 does not work in full scrren mode at XP Windows

7. Clipper application does not work on full screen of Windows XP

8. problem with clipper database application under Windows XP

9. application icon on Windows

10. using windows icons in tk application

11. How to change the icon of application for Windows

12. Removing the TK icon from application windows...

 

 
Powered by phpBB® Forum Software