Windows创建Sciter的第一个程序.HelloWorld

介绍什么的就免了.直接进入正题

平台: Windows 10

IDE : Visual studio 2017

首先从官网下载最新的SDK,https://sciter.com/download/

创建流程. https://sciter.com/forums/topic/simple-question-about-sciter/

总结一下关键点. (注意:官网教程里的SDK目录和项目目录是同级目录,所以使用了相对路径,实际项目中要依据情况更改)

1. 将 sciter-sdk\include 加入包含目录

2. 更改输出目录(可选)

3. 更改DPI 识别选项

4. 将 sciter-sdk/include/sciter-win-main.cpp 文件添加到项目

5.替换IDE自动生成的 helloWorld.cpp 为

// HelloWorld.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "HelloWorld.h"

#include "sciter-x-window.hpp"

class frame : public sciter::window {
public:
  frame() : window(SW_TITLEBAR | SW_RESIZEABLE | SW_CONTROLS | SW_MAIN | SW_ENABLE_DEBUG) {}
};

#include "resources.cpp"

int uimain(std::function<int()> run) {

  //sciter::debug_output_console console; - uncomment it if you will need console window

  sciter::archive::instance().open(aux::elements_of(resources)); // bind resources[] (defined in "resources.cpp") with the archive

  frame *pwin = new frame();

  // note: this:://app URL is dedicated to the sciter::archive content associated with the application
  pwin->load(WSTR("this://app/main.htm"));

  pwin->expand();

  return run();

}

 

6.在项目根目录下添加 res/main.htm

<html>
    <head>
        <title>Test</title>
        <style></style>
        <script type="text/tiscript"></script>
    </head>
    <body>

      Hello World!

    </body>
</html>

  

7.在项目根目录下添加 pack-resources.bat . 然后保存运行

..\sciter-sdk\bin\packfolder.exe res resources.cpp -v "resources"

 

8.将 sciter.dll 移动到输出目录,即可编译运行

 

转载于:https://www.cnblogs.com/kappaboy/p/7133568.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值