?
Solved

changing icon and caption during runtime

Posted on 2003-03-06
12
Medium Priority
?
243 Views
Last Modified: 2010-04-07
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
Comment
Question by:Fischermaen
[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
12 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8079321
Use me. refresh after change those values. It works on 2000.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8079326
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
 
LVL 1

Author Comment

by:Fischermaen
ID: 8079452
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8079484
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
 
LVL 1

Author Comment

by:Fischermaen
ID: 8079537
Can I change the application icon and name during runtime ?
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8079663
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
 
LVL 1

Author Comment

by:Fischermaen
ID: 8079838
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
 
LVL 1

Author Comment

by:Fischermaen
ID: 8079910
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
 
LVL 1

Author Comment

by:Fischermaen
ID: 8150449
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8151394
Amazing. I never thought about api! :D
0
 

Expert Comment

by:CleanupPing
ID: 8900593
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
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 8903823
Points refunded and placed in PAQ

Computer101
E-E Admin
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month8 days, 8 hours left to enroll

764 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