⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myapp.c

📁 一个操作系统源代码 用于嵌入式设备 在Vc++环境下仿真 成功移植到多款处理器上
💻 C
字号:
#include <stdio.h>
#include <string.h> 
#include <math.h>


#include <asixwin.h>
#include <asixapp.h>

#include <asixwin\asix_mn.h>
#include <asixwin\select.h>
#include <asixwin\asix_sb.h>
#include <asixwin\asix_lb.h>
#include <asixwin\disp.h>
#include <asixwin\asix_ed.h>
#include <asixwin\asix_key.h>

#include <resource\bitmap.h>
#include <resource\picture.h>

extern void myapp(void);



//注册表
TASKDESCRIPTION MyAppTskDesp = 
{"我的应用", ASIX_APP, 0, yanshi, 2048, 1, LCD_WIDTH, LCD_HEIGHT, myapp, APP_PRI};

void myapp()
{
     //窗口和控件ID
     U32     mainwin;
     U32     editor;
     U32     button;
     U32     display;
     U32     scroll;
     U32     tskbar;
     
     //函数变量
     U8      quit = 0; 
     U8      i = 0;
//   U16     length = ALLNUM;
     MSG     msg; 
     U32     pGC;
     S16     row = 1;
     S16     dragflag = 0;

     
      
	 //创建按钮
     mainwin = CreateWindow(WNDCLASS_WIN, "我的应用", WS_OVERLAPPEDWINDOW, 0, 0, LCD_WIDTH, LCD_HEIGHT, 0, 0, NULL); 
     
	 button = CreateWindow(WNDCLASS_BUTTON, "Hello World!", WS_CHILD|BS_REGULAR, 50, 47, 140, 20, mainwin, 0, NULL);
     
	 //display = CreateWindow(WNDCLASS_STATIC, NULL, WS_CHILD|SS_TEXT|SS_BOARD|SS_MULTILINE, display_x, display_y, display_w, display_h, mainwin, 0, NULL);
     //tskbar = CreateWindow(WNDCLASS_TSKBAR, NULL, WS_CHILD|TBS_TYPICAL, 0, 0, 0, 0, mainwin, 0, NULL);
     //scroll = CreateWindow(WNDCLASS_SCROLL, NULL, WS_CHILD|SBS_VERT, scroll_x, scroll_y, scroll_w, scroll_h,mainwin, MAKELONG(1, ALLNUM - NUM + 1), NULL);
       
     //显示列表
     /*for(i = 0; i < NUM; i++)
     {
	     SetWindowText(list[i], gpc + i, NULL); 
     }*/
     
     pGC = GetGC();

	 SysCreateCursor( pGC, 100, 100, 16, 16, ASIX_CURSOR_ON, FREMAX, CURSOR_REC );
 	
 	while(!quit){
 		ASIXGetMessage(&msg, NULL, 0, 0); 
		switch(msg.message)
		{
			case WM_COMMAND:
				SetWindowText(button, "HAHA", NULL);
				MessageBox(0,"This the first ASIX Window App of Mine!","MyApp",MB_YESNOCANCEL|MB_ICONHAND);
				break;
			case WM_QUIT:
				quit = 1; 
			   	break; 
		 }
			
          DefWindowProc(msg.message, msg.lparam, msg.data, msg.wparam); 

      }


      	DestroyWindow( mainwin ); 
	EndofTask(); 
	return;  

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -