日期:2014-05-20  浏览次数:20885 次

API CloseWindow 函数问题!
大家好,我在程序中调用下面函数
[DllImport( "user32.dll ")]
                        static   extern   bool   CloseWindow(IntPtr   hWnd);
结果窗口不是被关掉了,而是最小化了,服了,这是怎么回事,我想关掉窗口,应该用什么函数呢?


------解决方案--------------------
SendMessage(hWnd,WM_CLOSE,null);
或者WM_DEST
POSTQUITMESSAGE(hWnd)
------解决方案--------------------
CloseWindow不是我们现在意义上的把窗口关闭了,而是使其最小化,是变成图标的形式.

要直正的关闭窗口,要用DestroyWindow这个函数.
------解决方案--------------------
CloseWindow Function

--------------------------------------------

The CloseWindow function minimizes (but does not destroy) the specified window.
To destroy a window, an application must use the DestroyWindow function.
------解决方案--------------------
呵呵, 用DestroyWindow

楼主肯定是看着名字理解的