c++ - Window Maximum Maximise -
I'm looking at the size (to create a program where I can set the maximum maximum size in the window when press maximum buttons for you) and run all windows up position (max / max window of x / y coordinates) it so that I do without my resize manually fit every window inside Rainmeter in my secondary Every time Nitr be visible. I managed to do a simple program I wrote using MINMAXSIZE This method WinAPI works perfectly for my short program, but the next 1 or 2 articles on the Internet There are very few documents in I was wondering whether this would be the best way to set the maximum size, or if there is another way to do this. The way I was planning to implement it in all applications or DLL injection or hook (not an experience to me), so I imagine the views of their people in ways having had. I know that there are some applications that already do, but I thought it could be a learning experience, and also, I tried all those applications which are very well (Although they may all be due to the Windows function). > If any of you are still uncertain about this which I am talking about, then what I want to do (although it does not work very well, as I did my last Said in the paragraphs). Advance. What do you want to do that handles the global window hook? As you may be aware, this message is: The window was sent when the window size or position is going to change the default max size and position of an application window, or its default minimum or You can use this message to override the maximum tracking size. This will allow you to assign the default value to the sizes that you do not care about in this case (minimum X / Y), so that you can set up Bella with maximum values Please leave. Your windows should be done with the hook and should look something like this: The hMod (instance_handle) should be set only on the basis of the circumstances (see the docs for this). A global hook mandate DwThreadId be your CallWndProc that looks like this: Unfortunately some of you are going to tackle that only the windows that will be hooked up were the ones that were present when you made your phone to SetWindowsHookEx (). I am not aware of this in a clear way, it is less than calling SetWindowsHookEx (ergh!) You can do this with DLL injection and can effectively sub-class with each window, and / But when you can only use the set-window hook-X, then why go to all those troubles? :) To change the X / Y, you may have to add the override and you may have to check SC_MAXIMIZE, then use it to properly use / (if you default it is 0, 0 But do not want to).
case WM_GETMINMAXINFO: {DefWindowProc (HWnd, message, wParam, lParam); MINMAXINFO * mmi = (MINMAXINFO *) lParam; Mm- & gt; PtMaxTrackSize.x = 100; Mm- & gt; PtMaxTrackSize.y = 100; Return 0; }
SetWindowsHookEx (WH_CALLWNDPROC, hook_procedure, instance_handle, 0);
__ declspec (dllexport) LRESULT WINAPI CallWndProc (int nCode, wParam wParam, lParam lParam) {CWPSTRUCT * CWP = ( CWPSTRUCT *) lParam; If (WM_GETMINMAXINFO == cwp-> messages) {DefWindowProc (hWnd, message, wParam, lParam); MINMAXINFO * mmi = (MINMAXINFO *) lParam; Mm- & gt; PtMaxTrackSize.x = 100; Mm- & gt; PtMaxTrackSize.y = 100; Return 0; } Return CallNextHookEx (next_hook, ncode, wParam, lParam); }
Comments
Post a Comment