VB.NET disable fade-in for forms

前端 未结 3 532
忘了有多久
忘了有多久 2020-12-21 18:25

I want to disable the form fade-in effect for a window. I think I found the right function

 _
Private Sh         


        
3条回答
  •  执笔经年
    2020-12-21 19:18

    The documentation for DWMWA_TRANSITIONS_FORCEDISABLED reads:

    Use with DwmSetWindowAttribute. Enables or forcibly disables DWM transitions. The pvAttribute parameter points to a value of TRUE to disable transitions or FALSE to enable transitions.

    The macros TRUE and FALSE are declared as:

    #define FALSE 0
    #define TRUE  1
    

    So you need to pass 1 for the attrValue parameter.

    The boolean type that Windows uses natively is BOOL. This is declared like this:

    typedef int BOOL;
    

    And since sizeof(int) is 4, the attrSize you need to pass is 4.

提交回复
热议问题