B
Bob Rock
Hello,
I'd like to prevent hacking of my application by messages sent from the
external. The dialog box already has the maximize button disabled however
I've seen that a simple ShowWindow with the correct window handle sent from
an external application can maximize it. I have tracked window messages sent
to the dialog and there isn't much .... there are WM_GETMINMAXINFO messages
sent to "know" what the dialog can do (max size, position when maximized,
etc.) and WM_WINDOWPOSCHANGING messages sent just before changing
position/size/z-order.
By handling WM_GETMINMAXINFO messages and changing returned info (max size
and position when maximized) and then handling WM_WINDOWPOSCHANGING messages
and ignoring messages when the new size in WINDOWPOS is different from the
one that the dialog should have I can in fact prevent maximizing ... the
problem is that (1) the dialog gets redrawn (even if in the same position
and size) and (2) the state of dialog "maximized" is somehow associated to
it because afterwards I see from the system menu that it can only be
restored or minimized. It there a simpler solution or am I missing just a
few more steps?
Bob Rock
I'd like to prevent hacking of my application by messages sent from the
external. The dialog box already has the maximize button disabled however
I've seen that a simple ShowWindow with the correct window handle sent from
an external application can maximize it. I have tracked window messages sent
to the dialog and there isn't much .... there are WM_GETMINMAXINFO messages
sent to "know" what the dialog can do (max size, position when maximized,
etc.) and WM_WINDOWPOSCHANGING messages sent just before changing
position/size/z-order.
By handling WM_GETMINMAXINFO messages and changing returned info (max size
and position when maximized) and then handling WM_WINDOWPOSCHANGING messages
and ignoring messages when the new size in WINDOWPOS is different from the
one that the dialog should have I can in fact prevent maximizing ... the
problem is that (1) the dialog gets redrawn (even if in the same position
and size) and (2) the state of dialog "maximized" is somehow associated to
it because afterwards I see from the system menu that it can only be
restored or minimized. It there a simpler solution or am I missing just a
few more steps?
Bob Rock