Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - AddIconHandle (ActiveX) 8.6
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

AddIconHandle (ActiveX) 8.6

 Post Reply Post Reply
Author
Message
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post Topic: AddIconHandle (ActiveX) 8.6
    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.

 

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.