Solved

About Box question

Posted on 2000-03-22
13
134 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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
 
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 Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

808 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