首页 > 其他 > 详细

MINIGUI 编译 helloworld

时间:2014-03-30 23:55:14      阅读:979      评论:0      收藏:0      [点我收藏+]

MiniGui 编译hello.c 文件成功!记载一下!
MiniGui 版本v3.0 和 2 编译 差异 是极其的大!
 
源文件代码 :
 
#include <stdio.h>
#include 
<minigui/common.h>
#include 
<minigui/minigui.h>
#include 
<minigui/gdi.h>
#include 
<minigui/window.h>

static int HelloWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lparam)
{
    HDC hdc;
    
switch(message){
        
case MSG_PAINT:
            hdc = BeginPaint(hWnd);
            TextOut(hdc, 
6060"duanYuLei!");
            EndPaint(hWnd, hdc);
            
return 0;

        
case MSG_CLOSE:
            DestroyMainWindow(hWnd);
            PostQuitMessage(hWnd);
            
return 0;
    }
    
return DefaultMainWinProc(hWnd, message, wParam, lparam);
}

int MiniGUIMain(int argc, char const *argv[])
{
    MSG Msg;
    HWND hMainWnd;
    MAINWINCREATE CreateInfo;

#ifdef _MGRM_PROCESSES
    JoinLayer(NAME_DEF_LAYER, "HelloWorld"00);

#endif

    CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER | WS_CAPTION;
    CreateInfo.dwExStyle = WS_EX_NONE;
    CreateInfo.spCaption = 
"HelloWorld";
    CreateInfo.hMenu = 
0;
    CreateInfo.hCursor = GetSystemCursor(
0);
    CreateInfo.hIcon = 
0;
    CreateInfo.MainWindowProc = HelloWinProc;
    CreateInfo.lx = 
0;
    CreateInfo.ty = 
0;
    CreateInfo.rx = 
240;
    CreateInfo.by = 
180;
    CreateInfo.iBkColor = COLOR_lightwhite;
    CreateInfo.dwAddData = 
0;
    CreateInfo.hHosting = HWND_DESKTOP;

    hMainWnd = CreateMainWindow(&CreateInfo);
    
if(hMainWnd == HWND_INVALID)
        
return -1;
    ShowWindow(hMainWnd, SW_SHOWNORMAL);

    
while(GetMessage(&Msg, hMainWnd)){
        TranslateMessage(&Msg);
        DispatchMessage(&Msg);
    }

    MainWindowThreadCleanup(hMainWnd);

    
return 0;
}

#ifndef _MGRM_PROCESSES
#include 
<minigui/dti.c>
#endif


 
照着官方文档编译都会失败。原来官方文档都不全面!
 
正确编译规则:
 
编译选项:
 
gcc HelloWorld.c -lminigui_ths -lpthread -lpng -ljpeg -lz -ldl -o (filename) 
 
无线程
 
gcc –o helloworld helloworld.c –lminigui_procs –ljpeg –lpng –lz -ldl
 
 
PS:开始画MiniGui 界面!
 
图片:
 
bubuko.com,布布扣
 
 

MINIGUI 编译 helloworld,布布扣,bubuko.com

MINIGUI 编译 helloworld

原文:http://www.cnblogs.com/firstrate/p/3633976.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!