• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

changing icon and caption during runtime

Hi everybody,

that questions looks to be simple, but it isn`t. I know how to change Caption (Me.Caption = "") and Icon (Me.Icon) BUT this doesn't have any effect on then TaskSwitcher and TaskManager of 2000/XP. Please, can anyone tell which fu/&%$ยงยง"$"% API-calls are needed!

Thanx a lot

Andy
0
Fischermaen
Asked:
Fischermaen
1 Solution
 
Richie_SimonettiIT OperationsCommented:
Use me. refresh after change those values. It works on 2000.
0
 
Richie_SimonettiIT OperationsCommented:
i did use a timer to test:

Private Sub Timer1_Timer()
Static l As Boolean
If l = True Then
    l = False
    With Me
        .Icon = LoadPicture(App.Path & "\a1.ico")
        .Caption = "Change 1"
        .Refresh
    End With
Else
    l = True
    With Me
        .Icon = LoadPicture(App.Path & "\mc.ico")
        .Caption = "Change 2"
        .Refresh
    End With
End If


End Sub
0
 
FischermaenAuthor Commented:
Sorry Richie, it doesn`t work.

In the TaskSwitcher (Alt-Tab) I see it with the wrong icon and the right caption and in the Task Manager (Ctrl-Shift-Esc) both are wrong.

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Richie_SimonettiIT OperationsCommented:
Ah1, i got it. AFAIK, you can't change it without changing the exe icon.
That is not dynamic. It is always shows the application icon (the exe file you know).
0
 
FischermaenAuthor Commented:
Can I change the application icon and name during runtime ?
0
 
Richie_SimonettiIT OperationsCommented:
It is a dangerous idea. Those values are embeded inside the compiled exe. The only idea is binary edit the exe but...
I have a question for you: Why do you need this?
0
 
FischermaenAuthor Commented:
Changing the binary is really dangerous, you're right. But can anyone tell, how the visual basic IDE can do this. (To see this, open the Task-Manager and then open a project in VB, close it and open another one. You will see the captions changes in the task-list. It works with the editor and all other programs, execpt my one :-(

But to your question. I developed a basic program for my company, which is used as an ole-container for many other "add-ins". My basic program is quite "stupid", it even doesn't know it's name. :-) A section in the registry tells my program, what's it's name, icon, version a.s.o. is - and of course, which add-ins have to be loaded. All these add-ins together "form" the programm the user will see. So my .exe needs to change it's name and icon (the user should not know, how our architecture is like)

I only want to do things all other programs can do either.
0
 
FischermaenAuthor Commented:
Changing the binary is really dangerous, you're right. But can anyone tell, how the visual basic IDE can do this. (To see this, open the Task-Manager and then open a project in VB, close it and open another one. You will see the captions changes in the task-list. It works with the editor and all other programs, execpt my one :-(

But to your question. I developed a basic program for my company, which is used as an ole-container for many other "add-ins". My basic program is quite "stupid", it even doesn't know it's name. :-) A section in the registry tells my program, what's it's name, icon, version a.s.o. is - and of course, which add-ins have to be loaded. All these add-ins together "form" the programm the user will see. So my .exe needs to change it's name and icon (the user should not know, how our architecture is like)

I only want to do things all other programs can do either.
0
 
FischermaenAuthor Commented:
Hello Everybody,

i found the solution by myself. If you want to change icon and caption in both task-switcher and task-manager, you have ot set the big and the small icon with that code-snippet:

lngIcon = SendMessage(Me.hwnd, WM_GETICON, ICON_BIG, ByVal 0)
SendMessage GetRootParent(Me.hwnd), WM_SETICON, ICON_SMALL, ByVal lngIcon
SendMessage GetRootParent(Me.hwnd), WM_SETICON, ICON_BIG, ByVal lngIcon

And the caption is to be changed with that code-snippet:

Me.Caption = NewValue
App.Title = NewValue

Important is to set App.Title, so that task-manager also changes the displayed caption.

thanks a lot to ritchie for trying to help me

andy
0
 
Richie_SimonettiIT OperationsCommented:
Amazing. I never thought about api! :D
0
 
CleanupPingCommented:
Fischermaen:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
Computer101Commented:
Points refunded and placed in PAQ

Computer101
E-E Admin
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now