powerbuilder中一个按钮,取消BS-ownerdraw风格的代码.

这是一段对错误的代码,

long ll_style ,ll_newstyle ;

this.hwnd = handle(this) ; 
this.hdc = Getdc(hwnd) ; 


ll_style = GetWindowLong(hwnd, -16)  // -16 是 GWL_STYLE

// 3. 去除 BS_OWNERDRAW 样式(BS_OWNERDRAW 的值是 0x0000000BL,即 11)
ll_newstyle = BitAnd(ll_style, BitNot(11))  // 去除 BS_OWNERDRAW

// 4. 设置新的窗口样式
SetWindowLong(hwnd, -16, ll_newstyle)

// 5. 使用 SetWindowPos 更新窗口外观
// SWP_NOMOVE = 2, SWP_NOSIZE = 1, SWP_NOZORDER = 4, SWP_FRAMECHANGED = 32
SetWindowPos(hwnd, 0, 0, 0, 0, 0, BitOr({2, 1, 4, 32}))

但是效果,有点意思.

Logo

讨论HarmonyOS开发技术,专注于API与组件、DevEco Studio、测试、元服务和应用上架分发等。

更多推荐