读书人

API CloseWindow 函数有关问题

发布时间: 2012-01-20 18:53:53 作者: rapoo

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

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

读书人网 >C#

热点推荐