首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

用nodejs+webkit开发圆桌面程序

2012-09-13 
用nodejs+webkit开发桌面程序说的就是:https://github.com/creationix/topcube。下载nodejs配合https://git

用nodejs+webkit开发桌面程序
说的就是:https://github.com/creationix/topcube。
下载nodejs配合https://github.com/downloads/mapbox/cefclient/cefclient-0.0.2.tar.gz
可以运行例子程序。
https://github.com/mapbox/cefclient是定制的http://code.google.com/p/chromiumembedded/,cefclient-0.0.2.tar.gz是定制程序的编译结果,源代码中的那个exe不行。
优缺点:linux下不说了,在windows下主要是体积大,node加chromiumembedded要十几M(qt、gtk也不小),好处就是只写js+html就能开发桌面程序了,比用c++那些省时间。window下hta虽小,估计会有ie678兼容问题。目标是能跨平台,能用html5的特性(如websocket,本地存储),集成高性能浏览器可高速处理复杂应用界面,不担忧浏览器兼容问题。
解决windows下启动的黑窗口问题:
c生成exe调用vbs

#include <windows.h>#include <stdio.h>int main(){    STARTUPINFO si;    PROCESS_INFORMATION pi;    char bff[512];    //init the STARTUPINFO struct    memset(&si,0,sizeof(si));    si.cb=sizeof(si);    //setup the command line arguments    sprintf(bff,"wscript.exe invis.vbs run.bat %*");    //create the proc with those args    if(!CreateProcess(NULL,bff,NULL,NULL,0,0,NULL,NULL,&si,&pi))    {        printf("ERROR");        getchar();        return 0;    }    //wait till the proc ends    WaitForSingleObject(pi.hProcess,INFINITE);    //close all    CloseHandle(pi.hProcess);    CloseHandle(pi.hThread);    getchar();    return 0;}

vbs调用node没有console黑窗口
Set WshShell = WScript.CreateObject("WScript.Shell")WshShell.Run "node.exe sampleapp/app.js ", 0, False

3.8发现被抄到其它网站,决定不断将想法更新上来。

热点排行