The MASM Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
MASM32 Downloads
Home
Help
Search
Login
Register
The MASM Forum
»
Microsoft 64 bit MASM
»
Examples
»
Demo using WM_NCHITTEST
« previous
next »
Print
Pages: [
1
]
Author
Topic: Demo using WM_NCHITTEST (Read 3620 times)
hutch--
Administrator
Member
Posts: 10313
Mnemonic Driven API Grinder
Demo using WM_NCHITTEST
«
on:
November 03, 2018, 06:07:02 PM »
There are a number of interesting things you can do using the lower level non client message, this is just one of them. It is built into the core of every version of Windows I can remember and it is an old technique that does something useful, you can use it to click and drag from any position in the window area to move the window with that mouse. In this example I have restricted its range to where the title bar normally is and have used a line at the height of the title bar area to appear and function like a title bar.
Effectively any size title bar you want at any colour you want and it is small and efficient code produced by the lowest level guts of a window.
Logged
hutch at movsd dot com
http://www.masm32.com
felipe
Member
Posts: 1381
Re: Demo using WM_NCHITTEST
«
Reply #1 on:
November 04, 2018, 01:21:48 AM »
Nice one :icon14: Thanks :t
Logged
sinsi
Guest
Re: Demo using WM_NCHITTEST
«
Reply #2 on:
November 04, 2018, 09:51:31 AM »
Does your way work when a windows has a border (resizing etc)?
I use this
Code:
[Select]
wm_lbuttondown: invoke SendMessage,hwnd,WM_NCLBUTTONDOWN,HTCAPTION,lparam
Logged
hutch--
Administrator
Member
Posts: 10313
Mnemonic Driven API Grinder
Re: Demo using WM_NCHITTEST
«
Reply #3 on:
November 04, 2018, 10:11:18 AM »
It does but it does not look any good when you set it to a sizing border. Your method looks good, I will have to try it out.
Logged
hutch at movsd dot com
http://www.masm32.com
hutch--
Administrator
Member
Posts: 10313
Mnemonic Driven API Grinder
Re: Demo using WM_NCHITTEST
«
Reply #4 on:
November 04, 2018, 02:03:33 PM »
sinsi,
I put your mod in the same code and it works fine. :t
.case WM_LBUTTONDOWN
rcall GetCursorPos,ptr$(pt)
rcall ScreenToClient,hWin,ptr$(pt)
cmp pt.y, tbht
ja @F
invoke SendMessage,hWin,WM_NCLBUTTONDOWN,HTCAPTION,lParam
@@:
ret
«
Last Edit: November 04, 2018, 06:15:45 PM by hutch--
»
Logged
hutch at movsd dot com
http://www.masm32.com
Print
Pages: [
1
]
« previous
next »
The MASM Forum
»
Microsoft 64 bit MASM
»
Examples
»
Demo using WM_NCHITTEST