SetWindowRgn在子控制項中無效的處理辦法

2021-06-03 01:57:35 字數 669 閱讀 6271

setwindowrgn

新增:dword style = getclasslong(m_hwnd, gcl_style);

setclasslong(m_hwnd, gcl_style, style & ~cs_parentdc);   

兩行///

緣由:專案中edit控制項在介面滾動時會部分被遮罩,因此需要部分顯示

在wince下setwindowrgn可以直接起作用,但是在windows上卻無效果,網上能找到實現的原始碼,不過均為mfc。

經過一番摸索和查詢,發現了問題所在,去除控制項預設的cs_parentdc屬性即可。

**:g_hedit = createwindow(_t("edit"),_t("test"),ws_visible|ws_child|bs_defpushbutton,0,50,100,50,hwnd,null, null,null);

dword style = getclasslong(g_hedit, gcl_style);

setclasslong(g_hedit, gcl_style, style & ~cs_parentdc);    

hrgn hrgn = null;

hrgn = createrectrgn(0,0,100,20);

setwindowrgn(g_hedit,hrgn,true);

shell 後台和子程序後台管控

後台數可控是避免資源過度占用的有效控制 子程序裡的後台狀態檢測實現複雜,這裡提供一種方式。cat fifo.sh bin bash ls proc self fd 獲取已用檔案操作符 ulimit n 可用最多檔案操作符個數 mkfifo fifo 1001 建立管道檔案 三個標準檔案操作符,分別為...

Ehcache怎樣在Element級上控制過期時間

cachemanager ehcachemanager new cachemanager ehcachemanager.addcache default ehcache cache ehcachemanager.getcache default element e new element aa aa...

在xcode中使用github進行版本控制

1,在xcode中使用github進行 控制,要先登入github.com 新建乙個repo倉庫。2,在xcode中使用source control check out 把remote repo check out 到本地。可以使用https,或是ssh方式,此處不再詳細介紹ssh方式設定方法。3,...