Results 1 to 31 of 31

Thread: [vb6] Fix Palette when IDE Manifested - AddIn

Hybrid View

  1. #1
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    441

    Re: [vb6] Fix Palette when IDE Manifested - AddIn

    very good job!, if I remember correctly it is the same solution that is used with the option buttons in windows xp
    leandroascierto.com Visual Basic 6 projects

  2. #2

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: [vb6] Fix Palette when IDE Manifested - AddIn

    Quote Originally Posted by LeandroA View Post
    very good job!, if I remember correctly it is the same solution that is used with the option buttons in windows xp
    You may have a better memory. I thought it was that the WM_PRINTCLIENT message wasn't being handled? But am not sure any longer.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    6,192

    Re: [vb6] Fix Palette when IDE Manifested - AddIn

    Quote Originally Posted by LaVolpe View Post
    You may have a better memory. I thought it was that the WM_PRINTCLIENT message wasn't being handled? But am not sure any longer.
    For manifested frame controls to prevent option and check buttons widget images getting garbled *and* to prevent flicker on mouse hovering I use this in subclassproc

    Code:
            Case WM_PRINTCLIENT, WM_MOUSELEAVE
                ControlSubclassProc = DefWindowProc(hWnd, wMsg, wParam, lParam)
                Exit Function
    Edit: Btw, in this line
    Code:
            lValue = SetWindowSubclass(hWnd, AddressOf WindowProc, hWnd Xor lValue, lValue)
    the Xor usage is a nice trick but mostly useless.

    If you always pass 0 for uIdSubclass there is *no* chance for collision with anyone else's add-in using the same 0 for uIdSubclass because the subclass entries are keyed both on uIdSubclass *and* pfnSubclass so to collide the other add-in has to use the same AddressOf WindowProc which is very unlikely.

    Quote Originally Posted by MSDN
    uIdSubclass

    Type: UINT_PTR

    The subclass ID. This ID together with the subclass procedure uniquely identify a subclass. To remove a subclass, pass the subclass procedure and this value to the RemoveWindowSubclass function. This value is passed to the subclass procedure in the uIdSubclass parameter.
    cheers,
    </wqw>

  4. #4
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,700

    Re: [vb6] Fix Palette when IDE Manifested - AddIn

    Quote Originally Posted by wqweto View Post
    Code:
            Case WM_PRINTCLIENT, WM_MOUSELEAVE
                ControlSubclassProc = DefWindowProc(hWnd, wMsg, wParam, lParam)
                Exit Function
    Hello. Do you know what is the difference between calling DefWindowProc and not subclassing the messages at all?

  5. #5
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    6,192

    Re: [vb6] Fix Palette when IDE Manifested - AddIn

    Quote Originally Posted by Eduardo- View Post
    Hello. Do you know what is the difference between calling DefWindowProc and not subclassing the messages at all?
    If the custom subclassproc swallows the messages they will just stop working.For instance WM_PRINTCLIENT is used by AnimateWindow API so it will break for no apparent reason.

    Generally you don't want to *not* forward system messages to *next* window proc which you don't explicitly respond to and/or implement. Calling DefWindowProc here instead just skips the VB's window proc which is buggy.

    cheers,
    </wqw>

  6. #6
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,700

    Re: [vb6] Fix Palette when IDE Manifested - AddIn

    Quote Originally Posted by wqweto View Post
    Calling DefWindowProc here instead just skips the VB's window proc which is buggy.
    Ah, OK, I understand it now. Thank you.

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