-
Excel VBA - VBA Equivalent of hWnd property
I want to use the About Box API, which requires passing the hWnd of the calling form. In VB6, I would do
Code:
Private 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
Private Sub mnuAbout_Click()
ShellAbout Me.hWnd, "My Program", "Another fine product from HackWare", ByVal 0&
End Sub
I did some Googling, and found what I thought would be the answer in Application.ActiveWindow.Hwnd. However, when I run this, I get an "Object Does Not Support This Property Or Method" run time error.
Code:
ShellAbout Application.ActiveWindow.hwnd, "Main Menu", "Another fine product from HackWare", ByVal 0&
So, for Excel VBA, what would I use as the hWnd of the spreadsheet (no userform in this project).
-
Have you tried this:
Code:
ShellAbout Application.hwnd, "Main Menu", "Another fine product from HackWare", ByVal 0&
-
Ok, that worked, but why did it work?
What is the difference between Application.ActiveWindow.hwnd and Application.hWnd
-
Easy, there is no hwnd property for ActiveWindow
At least according to the Intellisence list.
-
 Originally Posted by Ron Weller
Easy, there is no hwnd property for ActiveWindow
At least according to the Intellisence list.
You are right.
Well, that is the last darn time I'm going to believe something I find on a Google search. 
Thanks again.
Similar Threads
-
By slimasian in forum .NET
Replies: 0
Last Post: 05-15-2008, 04:24 PM
-
Replies: 146
Last Post: 08-12-2002, 10:40 PM
-
By Rob Teixeira in forum .NET
Replies: 129
Last Post: 06-06-2002, 05:23 AM
-
By Rob Teixeira in forum .NET
Replies: 15
Last Post: 05-31-2002, 03:30 PM
-
By Rattagarn V. in forum VB Classic
Replies: 5
Last Post: 10-09-2000, 07:36 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|