Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Max To
#1
This utility makes windows maximize to specified parts of the screen: http://maxto.net/
I'd like to do this with QM. MSDN says to intercept the WM_GETMINMAXINFO message and change the values. But my WindowProc is only receiving the message when the window is moved, not when it is maximized or minimized. What's wrong?
Function WinProcMessages
Code:
Copy      Help
function [nCode] [wParam] [CWPSTRUCT*m]

;BEGIN DIALOG
;0 "" 0x90CB0A40 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030009 "" "" ""


if(getopt(nargs)=0)
,int+ g_whook=SetWindowsHookEx(WH_CALLWNDPROC &WinProcMessages 0 GetCurrentThreadId)
,if(!ShowDialog("WinProcMessages" 0)) ret
,
sel m.message
,case WM_GETMINMAXINFO
,out "WM_GETMINMAXINFO"

ret CallNextHookEx(g_whook nCode wParam m)
#2
Quote:For a window with the WS_OVERLAPPED or WS_THICKFRAME style, the DefWindowProc function sends the WM_GETMINMAXINFO message to the window.

WS_OVERLAPPED means that it is not WS_POPUP (0x80000000).
WS_THICKFRAME - resizable.

Code:
Copy      Help
;0 "" 0x10CB0A40 0x100 0 0 223 135 "Dialog"
#3
Thanks! Now how do you get it to apply to other windows? Is there a way to get thread id's for other windows and then replace the "GetCurrentThreadId"?
#4
Not sure but probably the hook must be in dll. Read SetWindowsHookEx help.
#5
Is there any way to create dll's with QM?
#6
QM cannot create dlls.

If you know C++ a little, and want to create a dll but don't know how, read this:
Knapsack problem


Forum Jump:


Users browsing this thread: 1 Guest(s)