Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INT WINAPI NCHITTEST(HWND hWnd, LPARAM lParam)
- {
- int iSide = 0; int iTopBot = 0; int cur = 0;
- int Set = 0x10003; int bMarg = 6; int HT = 2;
- WINDOWPLACEMENT wlcmt; POINT curPos;
- GetWindowPlacement(hWnd, &wlcmt);
- GetCursorPos(&curPos);
- ScreenToClient(hWnd, &curPos);
- if (curPos.x < bMarg) { iSide = 1; };
- if (curPos.x > (wlcmt.rcNormalPosition.right - bMarg)) { iSide = 2; };
- if (curPos.y < bMarg) { iTopBot = 3; };
- if (curPos.y > (wlcmt.rcNormalPosition.bottom - bMarg)) { iTopBot = 6; };
- cur = iSide + iTopBot;
- if (wlcmt.showCmd != 3)
- {
- switch(cur) {
- case 1: { Set = 0x10010; HT = 10; }
- case 2: { Set = 0x10010; HT = 11; }
- case 3: { Set = 0x10013; HT = 12; }
- case 4: {
- Set = 0x1000D;
- HT = 13;
- }
- case 5: {
- Set = 0x1000F;
- HT = 14;
- }
- case 6: {
- Set = 0x10013;
- HT = 15;
- }
- case 7: {
- Set = 0x1000F;
- HT = 16;
- }
- case 8: {
- Set = 0x1000D;
- HT = 17;
- }
- if (HT != 2) return HT;
- }
- if ((abs((lParam >> 16) & 0xFFFF) - wlcmt.rcNormalPosition.top) < 30) return 2;
- SetClassLong(hWnd, -12, Set);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement