Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-17-2016, 11:22 AM
derajlance derajlance is offline Change Userform Icon in Taskbar Windows 10 Change Userform Icon in Taskbar Office 2013
Novice
Change Userform Icon in Taskbar
 
Join Date: May 2016
Posts: 18
derajlance is on a distinguished road
Default Change Userform Icon in Taskbar


I think I finally got all of my forms completed and working properly. Now I am trying to just do some cosmetic things.

Specifically, at this point, I am wanting to change the icon that shows in the taskbar for the userform.
I want to change this:

Into this:

I've tried the following code, but have not had any success:
Code:
Private Declare Function GetActiveWindow32 Lib "USER32" Alias _ 
"GetActiveWindow" () As Integer 
 
 
Private Declare Function SendMessage32 Lib "USER32" Alias _ 
"SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, _ 
ByVal wParam As Long, ByVal lParam As Long) As Long 
 
 
Private Declare Function ExtractIcon32 Lib "SHELL32.DLL" Alias _ 
"ExtractIconA" (ByVal hInst As Long, _ 
ByVal lpszExeFileName As String, _ 
ByVal nIconIndex As Long) As Long 
 
Private Sub ChangeIcon() 
    ChangeApplicationIcon 
End Sub 
 
Sub ChangeIcon() 
     
    Dim Icon& 
     
    Const NewIcon$ = "Image2" 
 
    Icon = ExtractIcon32(0, NewIcon, 0) 
    SendMessage32 GetActiveWindow32(), &H80, 1, Icon 
    SendMessage32 GetActiveWindow32(), &H80, 0, Icon 
     
End Sub
"Image2" is the .ico image that is on the userform and set as not visible.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
OneNote Icon on Taskbar Query kevitec57 OneNote 0 03-22-2016 06:37 AM
Taskbar icon always moves when saving Adobe PDF from Word WaltR Word 0 10-03-2015 09:41 AM
Change parent for control from frame to userForm? Cosmo Word VBA 0 05-30-2014 02:19 PM
ICONS change to a different icon lrmaps.423 Windows 0 04-11-2014 07:53 AM
Change Contacts View icon folder to List arthurshurn Outlook 0 10-29-2013 09:53 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:35 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft