Solved

About Box question

Posted on 2000-03-22
13
133 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
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…

773 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