quote:
Originally posted by eSouL
I can't use ShowWindow(). I need to PostMessage() to the conversation window so I have to activate the window for a brief moment before returning control to my custom window. If the conversation window is visible on screen, it will create flickerings when I do so. Hence it needs to stay at a negative x position area. But I want a way to bring it back. The MoveWindow() function is a bit buggy.
API's like
MoveWindow(), etc aren't buggy at all. They work absolutely perfect. The use of them (aka your own code) is most likely buggy if you experience abnormalities.
Instead of hiding a window you can also minimize it. in general speaking, activating a window, showing/hiding it, restoring/minimizing it are three different independant things.
Also, why do you need
PostMessage()? It is quite possible that with another method you do not need the '
PostMessage() approach' at all. Also, in normal circumstances, this API doesn't require you to activate a window, since it send its message to the handle of a window, not to the activate window. But all this depends on what you want do and what your current code is.
But why do you ask how to change the 'Left' coordinate of a window when you first said:
quote:
Originally posted by eSouL
My plugin hides a conversation window (IMessengerConversationWnd object) by changing its 'Left' property to -20000
Don't this mean you already know how to set the 'Left'?...
Finally, to simply change a coordinate you indeed could also use
SetWindowPos(), like ME said. But this is in general, it highly depends on your overall code. Because most stuff can be greatly optimized or done in another shorter approach. And many Window API's already contain ways to set coordinates strait away, without using additional API's. So it all strongly depends on your current code to do it in the proper and/or efficient way.
PS: notice that I linked all the API's talked about to the
MSDN Library. This should be your number one stop to get info about the API's (not some other website which only provides half the info)