Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > General Discussion
  New Posts New Posts RSS Feed - TaskDialog MainIconHandle
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

TaskDialog MainIconHandle

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


Joined: 16 August 2005
Location: United States
Status: Offline
Points: 31
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpcoffeyXXX Quote  Post ReplyReply Direct Link To This Post Topic: TaskDialog MainIconHandle
    Posted: 04 February 2008 at 4:48pm
I'm having a problem with the TaskDialog MainIconHandle.  I'm trying to assign a 32 pixel icon to the TaskDialog MainIcon and it will not show.  While I can get the icon to show using the API method provided in the example, I cannot see why CodeJock's own control cannot deliver the handle.  The code I am using is,

   
    Dim imgIcon As ImageManagerIcon, lngIconHandle As Long
    Dim td as TaskDialog

    Set imgIcons = MyForm.cjImageManagerIcons
   
Set imgIcon = imgIcons.Icons.GetImage(ID_TASK_DIALOG_ICON, 32)
    lngIconHandle = imgIcon.Handle
 
   
Set td = MyForm.cjTaskDialog
    With td
        .MainInstructionText = "CJ image handles do not work."

        .MainIcon = xtpTaskIconCustom
        .MainIconHandle = lngIconHandle
        .ShowDialog
     end with

    Set td = Nothing
    Set imgIcon = Nothing: Set imgIcons = Nothing

The only thing showing up on the TaskDialog is the MainInstructionText.  The image in the ImageManagerIcons is an XP icon with multiple sizes.  Is there something I'm missing?  Thanks for your help.

Sincerely,

John
   


Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2008 at 3:06am
Hi,
 
Yes it's a little strange that the control doesn't deliver the handle.
I also wanted to do simular what you wanted. This is what I found so far:
 
Dim stdPic As StdPicture
Set stdPic = ImageManager.Icons.GetImage(ID_TASK_DIALOG_ICON, 32).CreatePicture(xtpImageNormal)
   
    With taskDialog
        .MainInstructionText = "Some text...."
        .MainIconHandle = stdPic.Handle
        .MainIcon = xtpTaskIconCustom
        .ShowDialog
    End With
 
 
Back to Top
jpcoffeyXXX View Drop Down
Groupie
Groupie


Joined: 16 August 2005
Location: United States
Status: Offline
Points: 31
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpcoffeyXXX Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2008 at 8:33am
Aaron, thank you for the solution. 

A caveat to everyone who is trying to accomplish the same thing, you cannot use an icon with an alpha channel with the StdPicture object.  Initially when I implemented the solution it didn't work.  After removing the icon with the alpha channel from the ImageManager and substituting an icon with 256 colors it worked beautifully.  The weak link here is the StdPicture object which does not support icons with alpha channels.  Again, Aaron thanks for your help.

Sincerely,

John
Back to Top
McKloony View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 January 2007
Location: Germany
Status: Offline
Points: 340
Post Options Post Options   Thanks (0) Thanks(0)   Quote McKloony Quote  Post ReplyReply Direct Link To This Post Posted: 03 June 2008 at 6:58am
Yes, this works great. Do you know, if it is possible to set Icons bigger than 32 x 32? I tryed out with 48 x 48 icons and it was reduced to 32 x 32
Product: Xtreme SuitePro (ActiveX) 16.2.5

Platform: XP / Windows 7

Language: Visual Basic 6.0 SP6
Back to Top
jpcoffeyXXX View Drop Down
Groupie
Groupie


Joined: 16 August 2005
Location: United States
Status: Offline
Points: 31
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpcoffeyXXX Quote  Post ReplyReply Direct Link To This Post Posted: 03 June 2008 at 8:21am
McKloony, I don't know if 48 x 48 icons will work.  Sorry. 

If not, it would be a limitation of the TaskDialog, but probably by design.  When CodeJock created the TD control, I am sure they built it within the design specs supplied by Microsoft.

Cheers,

John
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.156 seconds.