菜鸟提问

jackgwf 2005-07-05 10:33:23
ShowWindow(hwnd,nCmdshow) 函数的参数nCmdshow是窗口显示形式标识,
有SW_HIDE,SW_SHOWMAXMIZE的选择,我写成
ShowWindow (hwnd, SW_SHOWMINIMIZE) ;为什么报错?
--------------------Configuration: aa - Win32 Debug--------------------
Compiling...
1.cpp
E:\VC++\aa\1.cpp(149) : error C2065: 'SW_SHOWMINIMIZE' : undeclared identifier
Error executing cl.exe.
'SW_SHOWMINIMIZE' 未定义??????不是系统定义好的吗?
...全文
121 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
an_bachelor 2005-07-06
  • 打赏
  • 举报
回复
ShowWindow
The ShowWindow function sets the specified window's show state.

BOOL ShowWindow(
HWND hWnd, // handle to window
int nCmdShow // show state of window
);

Parameters
hWnd
Handle to the window.
nCmdShow
Specifies how the window is to be shown. This parameter is ignored the first time an application calls ShowWindow, if the program that launched the application provides aSTARTUPINFO structure. Otherwise, the first time ShowWindow is called, the value should be the value obtained by the WinMain function in its nCmdShow parameter. In subsequent calls, this parameter can be one of the following values: Value Meaning
SW_FORCEMINIMIZE Windows NT 5.0 and later: Minimizes a window, even if the thread that owns the window is hung. This flag should only be used when minimizing windows from a different thread.
SW_HIDE Hides the window and activates another window.
SW_MAXIMIZE Maximizes the specified window.
SW_MINIMIZE Minimizes the specified window and activates the next top-level window in the Z order.
SW_RESTORE Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window.
SW_SHOW Activates the window and displays it in its current size and position.
SW_SHOWDEFAULT Sets the show state based on the SW_ flag specified in theSTARTUPINFO structure passed to theCreateProcess function by the program that started the application.
SW_SHOWMAXIMIZED Activates the window and displays it as a maximized window.
SW_SHOWMINIMIZED Activates the window and displays it as a minimized window.
SW_SHOWMINNOACTIVE Displays the window as a minimized window. The active window remains active.
SW_SHOWNA Displays the window in its current state. The active window remains active.
SW_SHOWNOACTIVATE Displays a window in its most recent size and position. The active window remains active.
SW_SHOWNORMAL Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.


Return Values
If the window was previously visible, the return value is nonzero.

If the window was previously hidden, the return value is zero.

Remarks
The first time an application calls ShowWindow, it should use the WinMain function's nCmdShow parameter as its nCmdShow parameter. Subsequent calls to ShowWindow must use one of the values in the given list, instead of the one specified by the WinMain function's nCmdShow parameter.

As noted in the discussion of the nCmdShow parameter, the nCmdShow value is ignored in the first call to ShowWindow if the program that launched the application specifies startup information in theSTARTUPINFO structure. In this case, ShowWindow uses the information specified in the STARTUPINFO structure to show the window. On subsequent calls, the application must call ShowWindow with nCmdShow set to SW_SHOWDEFAULT to use the startup information provided by the program that launched the application. This behavior is designed for the following situations:

Applications create their main window by calling CreateWindow with the WS_VISIBLE flag set.
Applications create their main window by calling CreateWindow with the WS_VISIBLE flag cleared, and later call ShowWindow with the SW_SHOW flag set to make it visible.
Windows CE: The nCmdShow parameter does not support the following values:

SW_MAXIMIZE

SW_MINIMIZE

SW_RESTORE

SW_SHOWDEFAULT

SW_SHOWMAXIMIZED

SW_SHOWMINIMIZED

SW_SHOWMINNOACTIVE

QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winuser.h.
Import Library: Use user32.lib.

See Also
Windows Overview, Window Functions,CreateProcess, CreateWindow, ShowOwnedPopups,STARTUPINFO, WinMain


xqk 2005-07-06
  • 打赏
  • 举报
回复
haha
an_bachelor 2005-07-06
  • 打赏
  • 举报
回复
暈 你不會看MSDN然後copy過去嗎?難道你一直靠猜?汗!
jackgwf 2005-07-05
  • 打赏
  • 举报
回复
我书写的好多都不能桶过,帮我改改,谢谢
SW_HIDE
SW_SHOWNORMAL
SW_SHOWMINIMIZE
SW_SHOWMAXMIZE
SW_SHOWNOACTIVE
SW_RESTORE
jackgwf 2005-07-05
  • 打赏
  • 举报
回复
晕,原来是书写错,难怪我试了N次都错
chen18s 2005-07-05
  • 打赏
  • 举报
回复
呵呵!楼上的说对了啊
楼主,应该是SW_SHOWMINIMIZED 才对
an_bachelor 2005-07-05
  • 打赏
  • 举报
回复
SW_SHOWMINIMIZED != SW_SHOWMINIMIZE
版权所有:HOC网络安全小组(www.21cnhoc.com) 制 作 人:玩火的女人 我是一个大菜鸟,之所以弄这个菜鸟宝典是希望跟我一样菜的菜鸟能得到进步。 这些文章有一部分是我参考一些书籍按自己的理解去写的,很大的一部分是从网络收集而来的。不妥之处还望大家指正。 很多人都说自己不知道该从哪里学起。如果你是刚刚起步,不要老想着一步登天,也不要以为入侵就是最高境界!不要以为你靠着一些黑客软件、靠着一些漏洞资料,靠着别人所教的傻瓜式地去做,去入侵了,你就是高手,那样,到头来你会发现自己一无所获。也可能很多人只知如何攻击,却不知道自己如何防护。 比如你按着某些黑客教程成功地利用了一个CGI漏洞,入侵成功,可是你知道为什么会成为CGI 的漏洞吗?你会根据一个CGI 的工作状态来判断他可能有哪些漏洞或那方面的漏洞吗? 一系列的问题就是得有一系列的基础知识。 想学,好!那你先从一个普通的用户开始吧! 最起码你得知道硬件的基本构成吧,什么是主板?主板是拿来干嘛的?什么是CPU?CPU是怎么样来工作的?什么是内存?什么是硬件,等等。而操作系统,WINDOWS98/WINDOWS2000/LINUX这些系统你都了解了吧?常用的软件,如果你连WIZIP都不会用,那你就先修练一下自己吧。那网络呢?网络是拿来干嘛的?而在平常的操作中,碰到的问题都解决了吗?等等。。。 如果上面的都懂了,你应该向前进了,你可以学更深的东西了。 那从TCP/IP网络协议学起吧,这对网络来说是很有用的哦。学会用一系列的网络命令,再弄懂端口等是怎么样去工作的。有空就学服务器的配置,服务器有多少种,都是拿来干嘛的?它是怎么样配置和工作的?等等。。。 以上的都懂了,你再参考一些资料,去简单地入侵一个站点,应该是没有难度的了。如果你觉得自己已经不错了,那再进一步吧!学编程。 编程是什么?是拿来干嘛的?学它有什么用?学了它有什么好处?我该学什么语言?给自己定个位,好好学吧! 如果你已经有一个编程强项,而对各类的编程语言都了解,都熟悉那个领域了,那我想相对我来说你已经是个大高手了,我要像你学习。 但,其实,想让自己的技术进步都得自己去研究、多看书、多查资料的,没有人连端口都不懂就入侵了某些网站的。很多高手都是自学的。如果你连努力都不想努力,那何来进步?多看、多写、多实践,你很快就会变成高手了。相信自己。 你自己去实践和思考绝对胜过一碰到问题就上论坛问,其实论坛里面有很多你所需要的资料的,是你自己不想找罢了。而如果你把论坛里的那些文章都看完,你不成高手才怪。想学习就用点心!在学习的过程中碰到自己确定搞不定的,你可以提问,我想大家都会很热心地帮助你的。 愿大家能一起进步! 这个真不错,上传了

16,551

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧