Print Page | Close Window

AddIconHandle (ActiveX) 8.6

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=319
Printed Date: 03 May 2024 at 9:39pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: AddIconHandle (ActiveX) 8.6
Posted By: robs
Subject: AddIconHandle (ActiveX) 8.6
Date Posted: 30 December 2003 at 2:16pm

When using LoadResPicture in VB, it seems to always load icons 32X32 pixels, which looks ugly on the docking panes.

I've had luck resizing the icons using code such as:

Private Declare Function CopyImage Lib "user32" (ByVal handle As Long, ByVal imageType As Long, ByVal newWidth As Long, ByVal newHeight As Long, ByVal lFlags As Long) As Long

Private Cons IMAGE_ICON=2

Private Const LR_COPYFROMRESOURCE =3

   Dim p As stdole.IPictureDisp
   Set p = LoadResPicture(101, 1)
   Dim l As Long
   l = CopyImage(p.handle, IMAGE_ICON, 16, 16, LR_COPYFROMRESOURCE)

  DockingPane.AddIconHandle (l,ID)

The code above will resize the icon in the resource file to 16X16.

Good luck.

 




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net