Beispiel #1
0
int CreateCounterDialog(HWND hWnd)
{
	MSG           Msg;
	HWND          hcwd;
	MAINWINCREATE CreateInfo;
#ifdef _LITE_VERSION
	SetDesktopRect(0, 0, 1024, 768);
#endif
	CreateInfo.dwStyle        = WS_VISIBLE | WS_BORDER | WS_CAPTION;
	CreateInfo.dwExStyle      = WS_EX_NONE;
	CreateInfo.spCaption      = MSG_CALCULATION;
	CreateInfo.hMenu          = 0;
	CreateInfo.hCursor        = GetSystemCursor(0);
	CreateInfo.hIcon          = 0;
	CreateInfo.MainWindowProc = CounterDialogProc;
	CreateInfo.lx             = 0;
	CreateInfo.ty             = 0;
	CreateInfo.rx             = 320;
	CreateInfo.by             = 240;
	CreateInfo.iBkColor       = COLOR_lightwhite;
	CreateInfo.dwAddData      = 0;
	CreateInfo.hHosting       = hWnd;

	hcwd = CreateMainWindow(&CreateInfo);

	ShowWindow(hcwd, SW_SHOWNORMAL);

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

	MainWindowThreadCleanup(hcwd);
	return 0;
}
Beispiel #2
0
int MiniGUIMain (int args, const char* arg[])
{
	HWND hMainWnd;
	MSG Msg;
	MAINWINCREATE CreateInfo;	
	
	DoSysCmd("date >> CurrentVer");
	DoSysCmd("echo \""PROVER"\" >> CurrentVer");
	init();
	InitCreateInfo (&CreateInfo);
	hMainWnd = CreateMainWindow (&CreateInfo);
	if (hMainWnd == HWND_INVALID)
		return -1;
	ShowWindow (hMainWnd, SW_SHOWNORMAL);
	SetCursorPos (805, 605) ;
	while ( GetMessage (&Msg, hMainWnd) )
	{
		TranslateMessage (&Msg);
		DispatchMessage (&Msg);
	}
	I_DEV_IOBoard_Exit();
	MainWindowThreadCleanup (hMainWnd);
	system_close();
	exit(0);

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

#if defined(_LITE_VERSION) && !(_STAND_ALONE)

    int i;
    const char* layer =NULL;

    for (i = 1; i < argc; i++) {
        if (strcmp (argv[i], "-layer") == 0) {
            layer = argv[i + 1];
            break;
        }
    }

    //GetLayerInfo (layer, NULL, NULL, NULL);

    if (JoinLayer (layer, argv[0], 0, 0) == INV_LAYER_HANDLE) {
        printf ("JoinLayer: invalid layer handle.\n");
        exit (1);
    }
#endif


    
    CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER | WS_CAPTION;
    CreateInfo.dwExStyle = WS_EX_NONE;
    CreateInfo.spCaption = "Palette";
    CreateInfo.hMenu = 0;
    CreateInfo.hCursor = GetSystemCursor(0);
    CreateInfo.hIcon = 0;
    CreateInfo.MainWindowProc = PaletteWndProc;
    CreateInfo.lx = 512-SCREEN_W/2;
    CreateInfo.ty = 384-SCREEN_H/2;
    CreateInfo.rx = 512+SCREEN_W/2;
    CreateInfo.by = 384+SCREEN_H/2;
    CreateInfo.iBkColor = PIXEL_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;
}
Beispiel #4
0
//flag=0: Enroll , flag=1: Verify
int CreateFaceEnrollWindow(HWND hWnd, int pin)
{
	MSG msg;
	HWND hMainWnd;
	MAINWINCREATE CreateInfo;

	if(0==InitFaceEnroll())
        	return 0;

	f_pin=pin;
	regok=0;

	SetMenuTimeOut(time(NULL));
	ismenutimeout=0;

	hWnd = GetMainWindowHandle(hWnd);
	CreateInfo.dwStyle = WS_VISIBLE ;
	CreateInfo.dwExStyle = WS_EX_NONE;
	CreateInfo.spCaption = "Face";
	CreateInfo.hMenu = 0;
//	CreateInfo.hCursor = GetSystemCursor(0);
	CreateInfo.hIcon = 0;
        CreateInfo.MainWindowProc = FaceEnrollWinProc;
        CreateInfo.lx = 0;
        CreateInfo.ty = 0;
        CreateInfo.rx = g_rcScr.right;
        CreateInfo.by = g_rcScr.bottom;
        CreateInfo.iBkColor = 0x00FFA2BE;
        CreateInfo.dwAddData = 0;
        CreateInfo.hHosting = hWnd;
	
	LoadBitmap(HDC_SCREEN, &fvbg, GetBmpPath("mainmenu.jpg"));
	LoadBitmap(HDC_SCREEN, &fvbar, GetBmpPath("bar.bmp"));

        hMainWnd = CreateMainWindow(&CreateInfo);
        if (hMainWnd == HWND_INVALID)
	{
		UnloadBitmap(&fvbg);
		UnloadBitmap(&fvbar);
                return 0;
	}

        ShowWindow(hMainWnd, SW_SHOWNORMAL);
        while (GetMessage(&msg, hMainWnd))
        {
                TranslateMessage(&msg);
                DispatchMessage(&msg);
        }

        MainWindowThreadCleanup(hMainWnd);
	UnloadBitmap(&fvbg);
	UnloadBitmap(&fvbar);
        return regok;
}
Beispiel #5
0
int net_3gadd(HWND Wnd)
{
	MSG           Msg;
	MAINWINCREATE CreateInfo;
	HWND          MPlayerWnd;
        PMAINWIN2 pWin;  //channing	
	
	
	fWnd = Wnd;

    
#if _DEBUG
        pWin2 = (PMAINWIN2)Wnd;
        printf ("net_3gadd\n");        
        printf ("pWin=0x%p \n",pWin2);
        printf ("fWnd=0x%p \n",fWnd);        
        printf ("pWin->WinType=0x%x\n",pWin2->DataType);        
        printf ("pWin->WinType=0x%x\n",pWin2->WinType);
#endif 
        


	CreateInfo.dwStyle        = WS_CAPTION | WS_BORDER | WS_VISIBLE;
	CreateInfo.dwExStyle      = WS_EX_NONE;
	CreateInfo.spCaption      = MSG_ADD_FILE;
	CreateInfo.hMenu          = 0;
	CreateInfo.hCursor        = GetSystemCursor(IDC_ARROW);
	CreateInfo.hIcon          = 0;
	CreateInfo.MainWindowProc = Desktop;
	CreateInfo.lx             = 0;
	CreateInfo.ty             = 0;
	CreateInfo.rx             = 320;
	CreateInfo.by             = 210;
	CreateInfo.iBkColor       = GetWindowElementColor(BKC_CONTROL_DEF);
	CreateInfo.dwAddData      = 0;
	CreateInfo.dwReserved     = 0;
	CreateInfo.hHosting       = 0;

	MPlayerWnd = CreateMainWindow(&CreateInfo);
	if (MPlayerWnd == HWND_INVALID) {
		return -1;
	}

	ShowWindow(MPlayerWnd, SW_SHOWNORMAL);

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

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

#ifdef _MGRM_PROCESSES
    JoinLayer(NAME_DEF_LAYER , "timeeditor" , 0 , 0);
#endif

#ifdef _LITE_VERSION
    if (!InitVectorialFonts ()) {
        printf ("InitVectorialFonts: error.\n");
        return 1;
    }
#endif

    CreateInfo.dwStyle = WS_CAPTION | WS_BORDER | WS_VISIBLE;
    CreateInfo.dwExStyle = WS_EX_IMECOMPOSE;
    CreateInfo.spCaption = CAPTION;
    CreateInfo.hMenu = 0;
    CreateInfo.hCursor = GetSystemCursor(0);
    CreateInfo.hIcon = 0;
    CreateInfo.MainWindowProc = TimeEditorWinProc;
    CreateInfo.lx = 0; 
    CreateInfo.ty = 0;
    CreateInfo.rx = 240;
    CreateInfo.by = 320;
    CreateInfo.iBkColor = PIXEL_lightwhite;
    CreateInfo.dwAddData = 0;
    CreateInfo.hHosting = HWND_DESKTOP;
    
    hMainWnd = CreateMainWindow (&CreateInfo);
    
    if (hMainWnd == HWND_INVALID)
        return 3;

    ShowWindow(hMainWnd, SW_SHOWNORMAL);

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

    MainWindowThreadCleanup (hMainWnd);

#ifndef _MGRM_THREADS
    TermVectorialFonts ();
#endif

    return 0;
}
Beispiel #7
0
int CreateDelUserWindow(HWND hOwner, char *pin2, int pin)
{
	MSG msg;
	HWND hMainWnd;
	MAINWINCREATE CreateInfo;

	memset(&deluser, 0, sizeof(TUser));
	if (FDB_GetUserByCharPIN2(pin2, &deluser)==NULL)
		return 0;
	//	printf("deluser pin %d  pin2 %s\n",deluser.PIN,deluser.PIN2);
	delpin = deluser.PIN;

	printf("%s, %d, hOwner=0x%X\n", __FUNCTION__, __LINE__, hOwner);

	delret=0;
	pwddelhint=0;
	fpdelhint=0;
	hOwner = GetMainWindowHandle (hOwner);
	CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER | WS_CAPTION;
	CreateInfo.dwExStyle = WS_EX_NONE;
	CreateInfo.spCaption = LoadStrByID(MID_DELUSER);
	CreateInfo.hMenu = 0;
	CreateInfo.hIcon = 0;
	CreateInfo.MainWindowProc = Delwinproc;
	CreateInfo.lx = 0;
	CreateInfo.ty = 0;
	CreateInfo.rx = gOptions.LCDWidth;
	CreateInfo.by = gOptions.LCDHeight;
	CreateInfo.iBkColor = COLOR_black;
	CreateInfo.dwAddData = 0;
	CreateInfo.hHosting = hOwner;

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

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

	printf("start:%s, %d\n", __FUNCTION__, __LINE__);
	MainWindowThreadCleanup(hMainWnd);
	printf("end:%s, %d\n", __FUNCTION__, __LINE__);

	return delret;

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

	while(GetMessage(&Msg,hMainWnd))
	{
		TranslateMessage(&Msg);
		DispatchMessage(&Msg);
	}
    MainWindowThreadCleanup(hMainWnd);
	return 0;
}
Beispiel #9
0
int MiniGUIMain (int argc, const char* argv[])
{
    MSG Msg;
    MAINWINCREATE CreateInfo;

    ledfd = LED_Init();
    dcmfd = DCM_Init();
    coinInit(&coin50, COIN_50, 99);
    coinInit(&coin10, COIN_10, 50);
    coinInit(&coin5, COIN_5, 50);
    coinInit(&coin1, COIN_1, 50);
    stuffInit(&stuff1, 1, 18);
    stuffInit(&stuff2, 10, 15);
    stuffInit(&stuff3, 10, 22);
    LED_MAP_Create(&map, pattern);

    LoadBitmap(HDC_SCREEN, &pic_bk, "./img/bk.bmp");

    JoinLayer(NULL , "ASM" , 0 , 0);

    CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER | WS_CAPTION;
    CreateInfo.dwExStyle = WS_EX_NONE;
    CreateInfo.spCaption = "A Slot Machine - Simulator";
    CreateInfo.hMenu = 0;
    CreateInfo.hCursor = GetSystemCursor(0);
    CreateInfo.hIcon = 0;
    CreateInfo.MainWindowProc = MainHandler;
    CreateInfo.lx = 0;
    CreateInfo.ty = 0;
    CreateInfo.rx = 480;//g_rcScr.right;
    CreateInfo.by = 272;//g_rcScr.bottom;
    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;
}
Beispiel #10
0
int CreateOneLogWindow(HWND hOwner,int pin,time_t st1,time_t ed1)
{

	MSG Msg;
	HWND hMainWnd;
	MAINWINCREATE CreateInfo;

	hOwner = GetMainWindowHandle (hOwner);
	InitMiniGUIExt();

	findret=1;
	oneuserpin=pin;
	onesttm=st1;
	oneedtm=ed1;
	mylogcount=0;
	//CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER | WS_CAPTION;
	CreateInfo.dwStyle = WS_VISIBLE;
	CreateInfo.dwExStyle = WS_EX_NONE;
	CreateInfo.spCaption = LoadStrByID(MID_ATTQUERY);
	CreateInfo.hMenu = 0;
	//CreateInfo.hCursor = GetSystemCursor(0);
	printf("______%s%d\n", __FILE__, __LINE__);
	CreateInfo.hIcon = 0;
	CreateInfo.MainWindowProc = ControlOneLogWinProc;
	CreateInfo.lx = 0;
	CreateInfo.ty = 0;
	CreateInfo.rx = gOptions.LCDWidth;
	CreateInfo.by = gOptions.LCDHeight;
	CreateInfo.iBkColor = 0x00FFA2BE;
	CreateInfo.dwAddData = 0;
	CreateInfo.hHosting = hOwner;

	hMainWnd = CreateMainWindow (&CreateInfo);

	if (hMainWnd == HWND_INVALID)
		return -1;

	ShowWindow(hMainWnd, SW_SHOWNORMAL);

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

	MainWindowThreadCleanup (hMainWnd);

	MiniGUIExtCleanUp ();
	return findret;
}
Beispiel #11
0
int CreateWiFiPWDWindow(HWND hWnd, int ptype)
{
	char wincap[20];

	MSG msg;
	HWND hMainWnd;
	MAINWINCREATE CreateInfo;

	pwdmode=ptype;

	hWnd = GetMainWindowHandle(hWnd);
	CreateInfo.dwStyle = WS_VISIBLE|WS_BORDER|WS_CAPTION;
	CreateInfo.dwExStyle = WS_EX_NONE;
	if(pwdmode)		//WPA
		sprintf(wincap, "%s%s", LoadStrByID(MID_WIFI_PWDWPA), LoadStrByID(MID_PWD));
	else			//WEP
		sprintf(wincap, "%s%s", LoadStrByID(MID_WIFI_PWDWEP), LoadStrByID(MID_PWD));
	CreateInfo.spCaption = wincap;

	CreateInfo.hMenu = 0;
	//CreateInfo.hCursor = GetSystemCursor(0);
	CreateInfo.hIcon = 0;
	CreateInfo.MainWindowProc = WiFiPWDWinProc;
	CreateInfo.lx = 0;
	CreateInfo.ty = 0;
	CreateInfo.rx = g_rcScr.right;
        CreateInfo.by = g_rcScr.bottom;
	CreateInfo.iBkColor = 0x00FFA2BE;
	CreateInfo.dwAddData = 0;
	CreateInfo.hHosting = hWnd;

	//if (LoadBitmap(HDC_SCREEN,&wifipwdbkg,GetBmpPath("submenubg.jpg")))
	//	return 0;
	hMainWnd = CreateMainWindow(&CreateInfo);
	if (hMainWnd == HWND_INVALID)
		return 0;
	ShowWindow(hMainWnd, SW_SHOWNORMAL);
	
	while (GetMessage(&msg,hMainWnd))
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}

	MainWindowThreadCleanup(hMainWnd);

	return 0;
}
Beispiel #12
0
int CreateCallDialog (HWND hWnd)
{
	MSG Msg;
	//pthread_t th_message_read;
	MAINWINCREATE CreateInfo;
#ifdef _LITE_VERSION
	SetDesktopRect(0, 0, 1024, 768);
#endif

	CreateInfo.dwStyle        = WS_VISIBLE | WS_BORDER | WS_CAPTION;
	CreateInfo.dwExStyle      = WS_EX_NONE;
	CreateInfo.spCaption      = MSG_CALL;
	CreateInfo.hMenu          = 0;
	CreateInfo.hCursor        = GetSystemCursor(0);
	CreateInfo.hIcon          = 0;
	CreateInfo.MainWindowProc = CallWinProc;
	CreateInfo.lx             = 0;
	CreateInfo.ty             = 0;
	CreateInfo.rx             = 320;
	CreateInfo.by             = 240;
	CreateInfo.iBkColor       = COLOR_lightwhite;
	CreateInfo.dwAddData      = 0;
	CreateInfo.hHosting       = hWnd;

	hcwd = CreateMainWindow(&CreateInfo);


	//tty_init();
	//gprs_init();
	//pthread_create (&th_message_read, NULL, message_read_com, NULL);
	flagcall = 1;
	if (tag == 0) {
		ShowWindow(hcwd, SW_HIDE);
	}
	//else
	// ShowWindow(hcwd, SW_SHOWNORMAL);
	// tag = 2;
	while (GetMessage(&Msg, hcwd)) {
		TranslateMessage(&Msg);
		DispatchMessage(&Msg);
	}
	// pthread_join (th_message_read, NULL);
	tty_end();
	MainWindowThreadCleanup(hcwd);

	return 0;
}
Beispiel #13
0
int KeyBoard (HWND hWnd)
{
	MSG           Msg;
	HWND          hKB;
	MAINWINCREATE CreateInfo;

	if (!InitMiniGUIExt()) {
		return 2;
	}

	//設置鍵盤窗口屬性
	CreateInfo.dwStyle        = WS_VISIBLE | WS_THINFRAME;
	CreateInfo.dwExStyle      = WS_EX_TOPMOST | WS_EX_TOOLWINDOW;
	CreateInfo.spCaption      = "  ";
	CreateInfo.hMenu          = 0;
	CreateInfo.hCursor        = GetSystemCursor(IDC_ARROW);
	CreateInfo.hIcon          = 0;
	CreateInfo.MainWindowProc = KeyBoardPro;
	CreateInfo.lx             = 145;
	CreateInfo.ty             = 121;
	CreateInfo.rx             = 320;
	CreateInfo.by             = 215;
	CreateInfo.iBkColor       = GetWindowElementColor(BKC_CONTROL_DEF);
	CreateInfo.dwAddData      = 0;
	CreateInfo.dwReserved     = 0;
	CreateInfo.hHosting       = hWnd;

	//創建鍵盤窗口
	hKB = CreateMainWindow(&CreateInfo);
	if (hKB == HWND_INVALID) {
		return -1;
	}

	//顯示鍵盤窗口
	ShowWindow(hKB, SW_SHOWNORMAL);

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

	MiniGUIExtCleanUp();
	MainWindowThreadCleanup(hKB);
	return 0;
}
Beispiel #14
0
int CreateModemWindow(HWND hWnd)
{
	MSG msg;
	HWND hMainWnd;
	MAINWINCREATE CreateInfo;

	hWnd = GetMainWindowHandle(hWnd);
	CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER | WS_CAPTION;
	CreateInfo.dwExStyle = WS_EX_NONE;
	CreateInfo.spCaption = LoadStrByID(MID_MODEM_MOBILENET);
	CreateInfo.hMenu = 0;
	CreateInfo.hCursor = GetSystemCursor(0);
	CreateInfo.hIcon = 0;
	CreateInfo.MainWindowProc = ModemWinProc;
	CreateInfo.lx = 0;
	CreateInfo.ty = 0;
	CreateInfo.rx = g_rcScr.right;
	CreateInfo.by = g_rcScr.bottom;
	CreateInfo.iBkColor = 0x00FFA2BE;
	CreateInfo.dwAddData = 0;
	CreateInfo.hHosting = hWnd;

	if (LoadBitmap(HDC_SCREEN, &ModemBkg, GetBmpPath("submenubg.jpg"))){
		return 0;
	}

	hMainWnd = CreateMainWindow(&CreateInfo);
	if (hMainWnd == HWND_INVALID){
		return 0;
	}

	ShowWindow(hMainWnd, SW_SHOWNORMAL);

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

	MainWindowThreadCleanup(hMainWnd);

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

#ifdef _MGRM_PROCESSES
    JoinLayer(NAME_DEF_LAYER , "scrollbar" , 0 , 0);
#endif

    CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER | WS_CAPTION;
    CreateInfo.dwExStyle = WS_EX_NONE;
    CreateInfo.spCaption = SCB_ST_CAP;
    CreateInfo.hMenu = 0;
    CreateInfo.hCursor = GetSystemCursor(0);
    CreateInfo.hIcon = 0;
    CreateInfo.MainWindowProc = ScrollbarProc;
    CreateInfo.lx = 0;
    CreateInfo.ty = 0;
    CreateInfo.rx = g_rcScr.right;
    CreateInfo.by = g_rcScr.bottom;
    CreateInfo.iBkColor = COLOR_lightwhite;
    CreateInfo.dwAddData = 0;
    CreateInfo.hHosting = HWND_DESKTOP;

    hMainWnd = CreateMainWindowEx (&CreateInfo, "flat", 0, 0, 0);

    if (hMainWnd == HWND_INVALID)
    {
        return -1;
    }

    ShowWindow(hMainWnd, SW_SHOWNORMAL);

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

    MainWindowThreadCleanup (hMainWnd);

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

    width = 640;
    height = 480;

#ifdef _MGRM_PROCESSES
    JoinLayer(NAME_DEF_LAYER , "picasso" , 0 , 0);
#endif
    
    CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER | WS_CAPTION;
    CreateInfo.dwExStyle = WS_EX_NONE;
    CreateInfo.spCaption = "Picasso Demos";
    CreateInfo.hMenu = 0;
    CreateInfo.hCursor = GetSystemCursor(0);
    CreateInfo.hIcon = 0;
    CreateInfo.MainWindowProc = PlatformProc;
    CreateInfo.lx = 0;
    CreateInfo.ty = 0;
    CreateInfo.rx = width;
    CreateInfo.by = height+24;
    CreateInfo.iBkColor = PIXEL_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;
}
int CreateNewWiFiWindow(HWND hWnd, char* selssid)
{
	MSG msg;
	MAINWINCREATE CreateInfo;

	LoadWindowStr();
	memset(my_ssid, 0, sizeof(my_ssid));
	nstrcpy(my_ssid, selssid, strlen(selssid));

	hWnd = GetMainWindowHandle(hWnd);
	CreateInfo.dwStyle = WS_VISIBLE|WS_BORDER|WS_CAPTION;
	CreateInfo.dwExStyle = WS_EX_NONE;
	CreateInfo.spCaption = LoadStrByID(MID_WIFI_SETTING);
	CreateInfo.hMenu = 0;
	CreateInfo.hIcon = 0;
	CreateInfo.MainWindowProc = NewWiFiWinProc;
	CreateInfo.lx = 0;
	CreateInfo.ty = 0;
	CreateInfo.rx = g_rcScr.right;
	CreateInfo.by = g_rcScr.bottom;
	CreateInfo.iBkColor = 0x00FFA2BE;
	CreateInfo.dwAddData = 0;
	CreateInfo.hHosting = hWnd;

	if (LoadBitmap(HDC_SCREEN,&wifibkg,GetBmpPath("submenubg.jpg"))) {
		return 0;
	}
	WififHwnd = CreateMainWindow(&CreateInfo);
	if (WififHwnd == HWND_INVALID) {
		return -1;
	}
	ShowWindow(WififHwnd, SW_SHOWNORMAL);

	while (GetMessage(&msg,WififHwnd))
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}

	MainWindowThreadCleanup(WififHwnd);
	return 0;
}
Beispiel #18
0
int Network_connect (HWND hWnd)
{
	int           i = 99;
	MSG           Msg;
	HWND          hcwd;
	MAINWINCREATE CreateInfo;

        DEB("[network]Network_connect\n ");

#ifdef _LITE_VERSION
	SetDesktopRect(0, 0, 800, 600);
#endif

	CreateInfo.dwStyle        = WS_VISIBLE | WS_BORDER | WS_CAPTION;
	CreateInfo.dwExStyle      = WS_EX_NONE;
	CreateInfo.spCaption      = MSG_3G_CONNECT;
	CreateInfo.hMenu          = 0;
	CreateInfo.hCursor        = GetSystemCursor(0);
	CreateInfo.hIcon          = 0;
	CreateInfo.MainWindowProc = networkProc;
	CreateInfo.lx             = 0;
	CreateInfo.ty             = 0;
	CreateInfo.rx             = 320;
	CreateInfo.by             = 240;
	CreateInfo.iBkColor       = COLOR_lightgray;
	CreateInfo.dwAddData      = 0;
	CreateInfo.hHosting       = hWnd;

	hcwd = CreateMainWindow(&CreateInfo);



	ShowWindow(hcwd, SW_SHOWNORMAL);

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

	MainWindowThreadCleanup(hcwd);
	return 0;
}
Beispiel #19
0
int more_note(HWND hWnd)
{
	MSG           Msg;
	HWND          hMainWnd;
	MAINWINCREATE CreateInfo;

	//窗口信息
	CreateInfo.dwStyle        = WS_VISIBLE | WS_BORDER | WS_CAPTION;  //風格
	CreateInfo.dwExStyle      = WS_EX_NONE;
	CreateInfo.spCaption      = MSG_MEMO;                           //標題名
	CreateInfo.hMenu          = 0;                                  //無菜單
	CreateInfo.hCursor        = GetSystemCursor(0);
	CreateInfo.hIcon          = 0;
	CreateInfo.MainWindowProc = More_noteWindowProc;      //消息處理過程函數
	CreateInfo.lx             = 0;
	CreateInfo.ty             = 0;
	CreateInfo.rx             = 320;
	CreateInfo.by             = 210;
	CreateInfo.iBkColor       = COLOR_lightwhite;
	CreateInfo.dwAddData      = 0;
	CreateInfo.hHosting       = hWnd;                       //托管窗口

//創建主窗口
	hMainWnd = CreateMainWindow(&CreateInfo);               //創建主窗口

	if (hMainWnd == HWND_INVALID) {
		return -1;
	}

//顯示主窗口
	ShowWindow(hMainWnd, SW_SHOWNORMAL);                      //顯示主窗口
//消息循環
	while (GetMessage(&Msg, hMainWnd)) {
		TranslateMessage(&Msg);
		DispatchMessage(&Msg);
	}
//恢復並關閉gprs串口
//資源清理
	MainWindowThreadCleanup(hMainWnd);

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

#ifdef _MGRM_PROCESSES
    int i;
    const char* layer = NULL;

    for (i = 1; i < argc; i++) {
        if (strcmp (argv[i], "-layer") == 0) {
            layer = argv[i + 1];
            break;
        }
    }
    GetLayerInfo (layer, NULL, NULL, NULL);
    //if (JoinLayer ("same","same"/* argv[0]*/, 0, 0) == INV_LAYER_HANDLE) {
    if (JoinLayer (layer, argv[0], 0, 0) == INV_LAYER_HANDLE) {
        printf ("JoinLayer: invalid layer handle.\n");
        exit (1);
    }
#endif

    InitCreateInfo (&CreateInfo);
    hMainWnd = CreateMainWindow (&CreateInfo);
    if (hMainWnd == HWND_INVALID)
        return -1;

    srand (time (NULL));

    ShowWindow (hMainWnd, SW_SHOWNORMAL);

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

    MainWindowThreadCleanup (hMainWnd);
    return 0;
}
int MiniGUIMain (int args, const char* arg[])
{
    MSG Msg;
    HWND hMainWnd;
    MAINWINCREATE CreateInfo;

#ifdef _MGRM_PROCESSES
    JoinLayer(NAME_DEF_LAYER , "caretdemo" , 0 , 0);
#endif
    
    CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER | WS_CAPTION;
    CreateInfo.dwExStyle = WS_EX_NONE;
    CreateInfo.spCaption = CD_ST_CAP;
    CreateInfo.hMenu = 0;
    CreateInfo.hCursor = GetSystemCursor(0);
    CreateInfo.hIcon = 0;
    CreateInfo.MainWindowProc = CaretdemoWinProc;
    CreateInfo.lx = 0;
    CreateInfo.ty = 0;
    CreateInfo.rx = 320;
    CreateInfo.by = 240;
    CreateInfo.iBkColor = COLOR_lightgray;
    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;
}
Beispiel #22
0
int CreateSMSBoard(HWND hWnd, int smscount)
{
	MSG msg;
	MAINWINCREATE CreateInfo;

	bsmscount = smscount;
	//	printf("bsmscount:%d\n",bsmscount);
	if(!GetIDX2List(bsmscount)) return 0;

	hWnd= GetMainWindowHandle(hWnd);
	CreateInfo.dwStyle = WS_VISIBLE;// | WS_BORDER | WS_CAPTION;
	CreateInfo.dwExStyle = WS_EX_NONE;
	CreateInfo.spCaption = "";
	CreateInfo.hMenu = 0;
	//CreateInfo.hCursor = GetSystemCursor(0);
	CreateInfo.hIcon = 0;
	CreateInfo.MainWindowProc = boardwinproc;
	CreateInfo.lx = 0;
	CreateInfo.ty = 0;
	CreateInfo.rx = gOptions.LCDWidth;//g_rcScr.right;
	CreateInfo.by = gOptions.LCDHeight;//g_rcScr.bottom;
	//CreateInfo.iBkColor = COLOR_lightgray;
	CreateInfo.iBkColor = 0x00FFA2BE;
	CreateInfo.dwAddData = 0;
	CreateInfo.hHosting = hWnd;

	hSMSWnd = CreateMainWindow(&CreateInfo);
	if (hSMSWnd == HWND_INVALID)
		return 0;
	ShowWindow(hSMSWnd, SW_SHOWNORMAL);

	while (GetMessage(&msg,hSMSWnd))
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}

	MainWindowThreadCleanup(hSMSWnd);
	return 0;
}
Beispiel #23
0
int CreateMainStateWindow(HWND hOwner,int key)
{
	MSG msg;
	HWND hMainWnd;
	MAINWINCREATE CreateInfo;


	putkey=key;
	hOwner = GetMainWindowHandle (hOwner);
	CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER;
	CreateInfo.dwExStyle = WS_EX_NONE;
	CreateInfo.spCaption = "";
	CreateInfo.hMenu = 0;
	CreateInfo.hIcon = 0;
	CreateInfo.MainWindowProc = mainstatewinproc;
	CreateInfo.lx = 0;
	CreateInfo.ty = 0;
	CreateInfo.rx = g_rcScr.right;
	CreateInfo.by = g_rcScr.bottom;
	CreateInfo.iBkColor = 0xFF00A2BE;
	CreateInfo.dwAddData = 0;
	CreateInfo.hHosting = hOwner;

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

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

	return 1;

}
Beispiel #24
0
int SSR_MENU_ATTPHOTO(HWND hWnd)
{
	MSG msg;
	HWND hMainWnd;
	MAINWINCREATE CreateInfo;

	hWnd = GetMainWindowHandle(hWnd);
	CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER | WS_CAPTION;
	CreateInfo.dwExStyle = WS_EX_NONE;
	CreateInfo.spCaption = LoadStrByID(PID_PHOTO_MNG);
	CreateInfo.hMenu = 0;
	//        CreateInfo.hCursor = GetSystemCursor(0);
	CreateInfo.hIcon = 0;
	CreateInfo.MainWindowProc = AttPhotoProc;
	CreateInfo.lx = 0;
	CreateInfo.ty = 0;
	CreateInfo.rx = g_rcScr.right;
	CreateInfo.by = g_rcScr.bottom;
	CreateInfo.iBkColor = 0x00FFA2BE;
	CreateInfo.dwAddData = 0;
	CreateInfo.hHosting = hWnd;

	//LoadSystem1Str();

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

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

	MainWindowThreadCleanup(hMainWnd);
	return 0;
}
Beispiel #25
0
int DuressParameterWindow(HWND hWnd)
{
    MSG msg;
    HWND hMainWnd;
    MAINWINCREATE CreateInfo;

    hWnd = GetMainWindowHandle (hWnd);
    CreateInfo.dwStyle = WS_VISIBLE | WS_BORDER | WS_CAPTION;
    CreateInfo.dwExStyle = WS_EX_NONE;
    CreateInfo.spCaption = LoadStrByID(MID_LOCK_OP6);
    CreateInfo.hMenu = 0;
    //CreateInfo.hCursor = GetSystemCursor(0);
    CreateInfo.hIcon = 0;
    CreateInfo.MainWindowProc = duressparawinproc;
    CreateInfo.lx = 0;
    CreateInfo.ty = 0;
    CreateInfo.rx = gOptions.LCDWidth;
    CreateInfo.by = gOptions.LCDHeight;
    //CreateInfo.iBkColor = COLOR_lightgray;
    CreateInfo.iBkColor = 0x00FFA2BE;
    CreateInfo.dwAddData = 0;
    CreateInfo.hHosting = hWnd;

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

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

    MainWindowThreadCleanup(hMainWnd);
    return 0;
}
Beispiel #26
0
int MiniGUIMain (int argc, const char* argv[])
{
MSG Msg;
HWND hMainWnd;
MAINWINCREATE CreateInfo;
#ifdef _MGRM_PROCESSES
JoinLayer (NAME_DEF_LAYER , "helloworld" , 0 , 0);
#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 = RGBA2Pixel(HDC_SCREEN, 0xff, 0xff, 0xff, 0x00);
CreateInfo.dwAddData = 0;
CreateInfo.hHosting = HWND_DESKTOP;
hMainWnd = CreateMainWindow (&CreateInfo);
if (LoadBitmap (HDC_SCREEN, &bmp_bkgnd, "/res/topbar/playback.png"))
         return 1;
if (hMainWnd == HWND_INVALID)
return -1;
ShowWindow (hMainWnd, SW_SHOWNORMAL);
while (GetMessage (&Msg, hMainWnd)) {
	fprintf(stderr, "msg\n");
TranslateMessage (&Msg);
DispatchMessage (&Msg);
}
UnloadBitmap(&bmp_bkgnd);
MainWindowThreadCleanup (hMainWnd);
return 0;
}
Beispiel #27
0
void* start_cont_win (void* data)
{
    MSG Msg;
    MAINWINCREATE CreateInfo;
    HWND cont_hwnd;
    CONTAINER_INFO* cont_info = (CONTAINER_INFO*)data;

    CreateInfo.dwStyle = WS_ABSSCRPOS | WS_VISIBLE;
    CreateInfo.dwExStyle = WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
    CreateInfo.spCaption = "";
    CreateInfo.hMenu = 0;
    CreateInfo.hCursor = GetSystemCursor(0);
    CreateInfo.hIcon = 0;

    CreateInfo.MainWindowProc = mgi_container_win_proc;
    CreateInfo.lx = g_rcScr.right-CONT_WIN_WIDTH-20;
    CreateInfo.rx = g_rcScr.right-20;
    CreateInfo.ty = 0;
    CreateInfo.by = CONT_WIN_HEIGHT;
    CreateInfo.iBkColor = GetWindowElementColor(WE_THREED_BODY);
    CreateInfo.hHosting = HWND_DESKTOP;

    cont_hwnd = cont_info->hwnd = CreateMainWindow (&CreateInfo);
    sem_post (&cont_info->wait);

    if (cont_hwnd == HWND_INVALID)
        return NULL;

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

    MainWindowThreadCleanup (cont_hwnd);
    return NULL;

}
static int ControlTestWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
{
    switch (message) {
        case MSG_CREATE:
              create_combobox (hWnd);

              CreateWindow (CTRL_STATIC,
                        selected_, 
                        WS_CHILD | WS_VISIBLE | SS_SIMPLE, 
                        IDC_SELECTED, 
                        210, 10, 200, 25, hWnd, 0);

              CreateWindow (CTRL_BUTTON,
                        Close, 
                        WS_CHILD | WS_VISIBLE, 
                        IDCANCEL, 
                        320, 190, 60, 25, hWnd, 0);

        break;

        case MSG_COMMAND:
        {
            int id   = LOWORD(wParam);
            int code = HIWORD(wParam);
            char str [NAME_MAX + 20], file [NAME_MAX + 1];
            int selected; 

            if (wParam == IDCANCEL) {
                PostMessage (hWnd, MSG_CLOSE, 0, 0);
                break;
            }

            switch (id) {
            case IDC_BOX1:
                if (code != CBN_SELCHANGE)
                    break;

                selected = SendDlgItemMessage (hWnd, IDC_BOX1, CB_GETCURSEL,0,0);
                if (selected >= 0) {
                    SendDlgItemMessage (hWnd, IDC_BOX1, CB_GETLBTEXT, selected, (LPARAM)file);
                    if (strlen (file)) {
                        sprintf (str, "Selected: %s", file);
                        SetDlgItemText (hWnd, IDC_SELECTED, str);
                    }
                }
                break;
            }

        }
        break;

        case MSG_DESTROY:
            DestroyAllControls (hWnd);
            hMainWnd = HWND_INVALID;
	    return 0;

        case MSG_CLOSE:
            DestroyMainWindow (hWnd);
            MainWindowThreadCleanup (hWnd);
            return 0;
    }

    return  DefaultMainWinProc(hWnd, message, wParam, lParam);
}
Beispiel #29
0
static int Verifywinproc(HWND  hWnd, int message, WPARAM wParam, LPARAM lParam)
{
	HDC hdc;
	int id,nc, tmpvalue = 0;
	static char keyupFlag=0;
	switch (message)	
	{
		case MSG_CREATE:

			InitWindow(hWnd);
			SetFocusChild(editacno3);			
			SetWindowText(editacno3,propin);
			SendMessage(editacno3,EM_SETCARETPOS,0,1);
			return 0;
		case MSG_PAINT:
			hdc=BeginPaint(hWnd);
		    tmpvalue= SetBkMode(hdc,BM_TRANSPARENT);
		    SetTextColor(hdc,PIXEL_lightwhite);		
			TextOut(hdc,60,70,LoadStrByID(HID_PLACEFINGER));			     
			EndPaint(hWnd,hdc);
			return 0;
		case MSG_KEYUP:
			if(3 == gOptions.TFTKeyLayout)
			{
				keyupFlag=1;
			}
			break;
		case MSG_KEYDOWN:
			SetMenuTimeOut(time(NULL));
			if(3 == gOptions.TFTKeyLayout)
			{
				if(1==keyupFlag)
					keyupFlag=0;
				else
					break;
			}
			if ((GetFocusChild(hWnd)==editacno3)&&((LOWORD(wParam)==SCANCODE_ENTER)
				||(LOWORD(wParam)==SCANCODE_F10)))
				procverifychoose(hWnd);		
			if ((LOWORD(wParam)==SCANCODE_ESCAPE))		
				PostMessage (hWnd, MSG_CLOSE, 0, 0L);
			break;		
	    case MSG_DESTROY:
        	DestroyAllControls (hWnd);
	        hMainWnd1 = HWND_INVALID;
        	return 0;
		case MSG_CLOSE:
			DestroyMainWindow(hWnd);
			MainWindowThreadCleanup (hWnd);
			return 0;
		case MSG_COMMAND:
			id = LOWORD(wParam);
			nc = HIWORD(wParam);
			if (id==ID_ACNO)
			{
				if (nc==EN_CHANGE)
				{
					memset(propin,0,24);
                    GetWindowText (editacno3, propin, 24);
					printf("keybuffer:%s\n",propin);
				}
			}
			break;

	}
	return DefaultMainWinProc(hWnd,message,wParam,lParam);
}