Solved

About Box question

Posted on 2000-03-22
13
131 Views
Last Modified: 2010-05-02
I put an About Box in my pgm. but i don't know how to put the  instead (misc) in : This product is licensed to misc

Here is my code:
In a module
Declare Function ShellAbout Lib "shell32.dll" Alias "ShellAboutA" (ByVal hwnd As Long, _
        ByVal szApp As String, ByVal szOtherStuff As String, ByVal hIcon As Long) As Long
0
Comment
Question by:dosyl
  • 6
  • 5
  • 2
13 Comments
 
LVL 32

Accepted Solution

by:
Erick37 earned 75 total points
ID: 2645576
Do you need to use ShellAbout, or can you use the frmAbout template provided with VB?
Project->Add Form->About Dialog
You can customize that as you wish.
0
 
LVL 1

Author Comment

by:dosyl
ID: 2645779
Erick37
Your idea is good, but when i run the pgm. the title is never what i write, it is the name of the project.
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2645822
You can change the title:

If using the frmAbout form, change the line
Me.Caption = "About " & App.Title
to whatever you want.

If using ShellAbout use this:

Call ShellAbout(Me.hWnd, "Win Title#Application Name", "Other Information", Me.Icon.Handle)
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2645848
Or if you are referring to the label's caption, the line
lblTitle.Caption = App.Title
can be modified.

I normally keep a global variable called sAppName which holds the name of the application.  The startup code sets this variable to
sAppName = "My Application's Name"

Then you can use sAppName anywhere in the app to set captions, etc.  This reduces the number of static strings in the code, and makes changing the title much easier.
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2645857
Sorry, but you can't change the "This product is licensed to" information using the ShellAbout API.

With ShellAbout:

   hwnd is the handle to the owner window
   szApp is the string that appears in the titlebar
   szOtherStuff is the string that appears after the copyright information


So for example:

   ShellAbout 0&,"Hello","World",0

Would show a box that looks like this:

_________________________________________________________
About Hello                                        
_________________________________________________________

Microsoft Hello
Windows 95
Copyright © 1981-1995 Microsoft Corp
World

This product is licensed to:
John Smyth


Physical Memory Available to Windows:  48.576 KB
System Resources:                      57% Free


                                          [OK]
_________________________________________________________
               
0
 
LVL 1

Author Comment

by:dosyl
ID: 2645912
mcrider
Where do you write John Smyth?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Author Comment

by:dosyl
ID: 2645934
I tried to take the vb template. I didn't think to look in the form_load to write my Caption.
Are we able with a label to change line?
Exeample:
Company
Tel: 555-4444
Adress
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2645953
Yes, modify it as much as you like:

Private Sub Form_Load()
    Dim sAppInfo As String
    sAppInfo = "Company Name" & vbCrLf & _
            "Tel: 555-1212" & vbCrLf & _
            "6.0 VB Lane" & vbCrLf & _
            "Microville, MS"
    Me.Caption = "About " & App.Title
    lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision
    lblTitle.Caption = sAppInfo
End Sub

You will have to adjust the label sizes so everything fits...
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2645957
Like I said, you can't change "John Smyth".... You can only change the text that says "Hello" and the text that says "World".

You can always just build your own form from scratch and put anything on it you want...


Cheers!®©
0
 
LVL 1

Author Comment

by:dosyl
ID: 2645980
Erick37
I'm in the clouds, i knowed that.
0
 
LVL 1

Author Comment

by:dosyl
ID: 2646008
Adjusted points from 50 to 75
0
 
LVL 1

Author Comment

by:dosyl
ID: 2646009
Erick37
I increase your point for your patience.
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2646018
Thanks!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now