CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 1999
    Location
    France
    Posts
    393

    A stupid one HCURSOR --> HICON and HICON --> HCURSOR

    Hi,

    I know there are some ways to pass from one to another and experienced some.

    But please can you indicate the best way to transform a HCURSOR to a HICON and vice versa.

    Thanks a lot

  2. #2
    Join Date
    May 2005
    Posts
    4,954

    Re: A stupid one HCURSOR --> HICON and HICON --> HCURSOR

    Quote Originally Posted by F.Mayis
    Hi,

    I know there are some ways to pass from one to another and experienced some.

    But please can you indicate the best way to transform a HCURSOR to a HICON and vice versa.

    Thanks a lot
    you can use ::CreateIcon(..) to create an icon from the raw bits you can get from HCURSOR using the ::GetIconInfo(..).

    look at this thread for usage of ::GetIconInfo(..) and ::CreateIcon(..)
    just pass the ::GetIconInfo(..) the HCURSOR and you will get its data.

    Cheers
    If a post helped you dont forget to "Rate This Post"

    My Article: Capturing Windows Regardless of Their Z-Order

    Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured