中易网

win32 api 最简单的程序怎么执行?

答案:2  悬赏:40  
解决时间 2021-03-02 06:52
#include
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MessageBox(NULL, "Goodbye, cruel world!", "Note", MB_OK);
return 0;
}

我正在阅读一本书,书上第一个例子我就不能懂,能不能在vc++6.0中运行这个程序,怎么运行?用.C后缀名的文件,编译没错误,但是执行则有一个错误。要是什么样的文件才能执行这样的程序?

后面我又重新打开编译程序,执行之后出现dos的黑窗口,但是没有“goodbye,cruel world!”这句程序中执行的话。回车之后,窗口就提示press any key to continue 在按回车就结束了
最佳答案
告诉你答案,在调试的选项里c++里和链接里吧—console 改成-windows有两个地方要修改。网上有类似教程
全部回答
bool getclientrect( hwnd hwnd, // handle to window     lprect lprect // client coordinates ); parameters
hwnd
[in] handle to the window whose client coordinates are to be retrieved.
lprect
[out] pointer to a rect structure that receives the client coordinates. the left and top members are zero. the right and bottom members contain the width and height of the window.
return values

if the function succeeds, the return value is nonzero.

if the function fails, the return value is zero. to get extended error information, call getlasterror.

// todo:

the getclientrect function retrieves the coordinates of a window's client area. the client coordinates specify the upper-left and lower-right corners of the client area. because client coordinates are relative to the upper-left corner of a window's client area, the coordinates of the upper-left corner are (0,0).

我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
篮球鞋鞋头窄的问题
康维他蜂蜜真伪辨别 高人进
我妈今年54岁还可以买社保吗
梦幻60打造武器需要多少体力?
五一在哪里啊,我有事要去这个地方
【悬赏】作为一名老师上课用苹果air11.6高配
多玩我的世界盒子哪个材质包的门是透明的
关于钢琴曲<<火把节之夜>>
天旺平价超市马务店地址有知道的么?有点事想
韩国人喝豆浆吗?韩国也有豆浆这种饮品吗
臻什么意思
不懂考研制度,关于从外省考回去什么鬼
人力资源管理专业的从事哪些工作比较好?
求一篇名字叫《原味》的作文,谢谢。上网帮忙
通安新居B区在哪里啊,我有事要去这个地方
推荐资讯
我昨天去建行存了8000元半年的定期,利息为2.
徐铭浚和徐铖悦哪个好听?
机电专业毕业去哪里找工作好?
投稿江汉论坛两个月了,还没有消息,是不是没
商标注册地址和现在地址不一样会不会做废
【创新课的题】题目:将一张8开的报纸铺在地
北兴坚诚五金水电商店花东镇分店怎么去啊,有
澳利文床垫在什么地方啊,我要过去处理事情
不能说的秘密周董唱的那首
100克含糖10%的糖水要变成含糖28%的糖水,需要
光吃蔬菜水果不吃米饭真的能减肥吗?
合同到期但仍在交承包费属于延续合同吗
手机登qq时,显示手机磁盘不足,清理后重新登
刺客的套装怎么选啊?