Reputation: 10927
I'm resizing a window with MoveWindow()
but I don't own that window. I simply stole it from a different process and now I'm messing around with its hWindow.
However the process which I stole it from was running a message loop, handling some of those messages (WM_MOVE
, WM_SIZE
, WM_GETMINMAXINFO
, etc.) which basically prevent me from doing whatever I want with it. Sometimes, it won't even let me size it past a given maximum which is key to making it run in fullscreen.
Except using asm, is there any way I can bypass messaging?
Upvotes: 0
Views: 147
Reputation: 61970
SetWindowPos
has a flag to not tell the window that you're doing something with it:
SetWindowPos (hwnd, 0, x, y, width, height, SWP_NOZORDER | SWP_NOSENDCHANGING);
As mentioned in the comments, relying on this behaviour in code you'll be using for more than having a bit of fun is not good, nor fair to the other windows, and you can very easily run into problems. Raymond Chen has some particularly interesting blog posts on this, namely things like "What if two programs did this?"
Upvotes: 1