?? animation.c
字號:
/* ** $Id: animation.c,v 1.2 2004/08/01 09:43:19 weiym Exp $**** Listing xx.x**** animation.c: Sample program for MiniGUI Programming Guide** Usage of ANIMATION control and GIF89a loader.**** Copyright (C) 2004 Feynman Software.**** License: GPL*/#include <stdio.h>#include <stdlib.h>#include <string.h>#include <minigui/common.h>#include <minigui/minigui.h>#include <minigui/gdi.h>#include <minigui/window.h>#include <minigui/control.h>#include <minigui/mgext.h>static int AnimationWinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam){ switch (message) { case MSG_CREATE: { ANIMATION* anim = CreateAnimationFromGIF89aFile (HDC_SCREEN, "banner.gif"); if (anim == NULL) return 1; SetWindowAdditionalData (hWnd, (DWORD) anim); CreateWindow (CTRL_ANIMATION, "", WS_VISIBLE | ANS_AUTOLOOP, 100, 10, 10, 300, 200, hWnd, (DWORD)anim); SendMessage (GetDlgItem (hWnd, 100), ANM_STARTPLAY, 0, 0); CreateWindow (CTRL_ANIMATION, "", WS_VISIBLE | ANS_AUTOLOOP, 200, 10, 210, 300, 200, hWnd, (DWORD)anim); break; } case MSG_LBUTTONDOWN: SendMessage (GetDlgItem (hWnd, 200), ANM_STARTPLAY, 0, 0); break; case MSG_DESTROY: DestroyAnimation ((ANIMATION*)GetWindowAdditionalData (hWnd), TRUE); DestroyAllControls (hWnd); return 0; case MSG_CLOSE: DestroyMainWindow (hWnd); PostQuitMessage (hWnd); return 0; } return DefaultMainWinProc(hWnd, message, wParam, lParam);}int MiniGUIMain (int argc, const char* argv[]){ MSG Msg; HWND hMainWnd; MAINWINCREATE CreateInfo;#ifdef _LITE_VERSION SetDesktopRect(0, 0, 1024, 768);#endif if (!InitMiniGUIExt()) { return 1; } CreateInfo.dwStyle = WS_CAPTION | WS_BORDER | WS_VISIBLE; CreateInfo.dwExStyle = WS_EX_NONE; CreateInfo.spCaption = "動畫控件" ; CreateInfo.hMenu = 0; CreateInfo.hCursor = GetSystemCursor (IDC_ARROW); CreateInfo.hIcon = 0; CreateInfo.MainWindowProc = AnimationWinProc; CreateInfo.lx = 0; CreateInfo.ty = 0; CreateInfo.rx = 240; CreateInfo.by = 320; CreateInfo.iBkColor = GetWindowElementColor (BKC_CONTROL_DEF); CreateInfo.dwAddData = 0; CreateInfo.dwReserved = 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); MiniGUIExtCleanUp (); return 0;}#ifndef _LITE_VERSION#include <minigui/dti.c>#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -