delphi 實現無視窗移動

2021-05-27 20:19:03 字數 1683 閱讀 9598

procedure imglistmousedown(sender: tobject; button: tmousebutton; shift: tshiftstate; x, y: integer);

private

procedure wmnchittest(var msg: twmnchittest); message wm_nchittest;

procedure tfrmstarthit.wmnchittest(var msg: twmnchittest);

const

coffset = 10;

varvpoint: tpoint;

begin

inherited;

vpoint := screentoclient(point(msg.xpos, msg.ypos));

if ptinrect(rect(0, 0, coffset, coffset), vpoint) then

msg.result := httopleft

else if ptinrect(rect(width - coffset, height - coffset, width, height), vpoint) then

msg.result := htbottomright

else if ptinrect(rect(width - coffset, 0, width, coffset), vpoint) then

msg.result := httopright

else if ptinrect(rect(0, height - coffset, coffset, height), vpoint) then

msg.result := htbottomleft

else if ptinrect(rect(coffset, 0, width - coffset, coffset), vpoint) then

msg.result := httop

else if ptinrect(rect(0, coffset, coffset, height - coffset), vpoint) then

msg.result := htleft

else if ptinrect(rect(width - coffset, coffset, width, height - coffset), vpoint) then

msg.result := htright

else if ptinrect(rect(coffset, height - coffset, width - coffset, height), vpoint) then

msg.result := htbottom;

end;

procedure tfrmstarthit.imglistmousedown(sender: tobject;

button: tmousebutton; shift: tshiftstate; x, y: integer);

const

sc_dragmove = $f012;

begin

if (button = mbleft) then

begin

releasecapture;

(self as tcontrol).perform(wm_syscommand, sc_dragmove, 0);

end;

end;

Delphi中正常視窗的實現

關鍵字vcl,正常視窗,正常化 1 引言 用delphi所提供的vcl類庫編寫的windows應用程式,有乙個明顯不同於標準windows視窗的特點 主視窗的系統選單與工作列上的系統選單不相同。一般情況下,主視窗的系統選單有六個選單項而工作列系統選單只有三個選單項。實際使用中我們發現用vcl開發的程...

fragstats移動視窗

在使用fragstats製作移窗圖時,移窗大小的選取是一件令人困擾的事情。下面我就談一談移窗及其大小的選取,如有錯漏,歡迎指正。首先,先來了解一下移窗的工作機制。設定視窗大小,勾選所要計算的景觀指數,執行程式啟動後,視窗會從影象左上角開始從左向右乙個像元乙個像元的移動,移動過程中視窗範圍內的景觀指數...

無視窗外掛程式1

mfc控制項的不建立視窗也允許啟用的選項查探 在atl無視窗activex控制項中響應timer訊息 uiflash.h ioleinplacesitewindowless duilib修復activexui控制項bug,以支援flash透明動態背景 cbitmap和hbitmap的區別及相互轉換方...