亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dragdrop.c

?? 將UCOS與UCGUI整合到一起,并在BORLAND C++上運行通過的源程序.
?? C
字號:
// (C) Copyright 1992 by Borland International
//
// DragDrop.c - Drag and Drop example in C

// Beginning of file dragdrop.c

/* --------------------------------------------------------------
	This is a code example using the Drag and Drop feature in
	Windows 3.1 with C.  The example shows how to drop files
	into the client area of the main window and then print out
	the file names only if they were dropped in the client area.
	The list of files will be kept in a linked list of structures.
	The code is well commented with Steps to follow the creation
	of the application as well as comments for common pitfalls
	and important lines of code that affect the performance of
	your application.
 --------------------------------------------------------------- */

char HelpText[]=
"\n\rThis application must be run under Windows 3.1.\n\r \
Bring up the Windows 3.1 File Manager.  Select a file\n\r \
with the left mouse button and keep the button down.\n\r \
Now drag the mouse over until it is on top of the drag\n\r \
n' drop window client area.  Now release the left mouse\n\r \
button.  You have just dragged and dropped a file.  To\n\r \
drag a group of files, select the group with the Shift\n\r \
and arrow keys and then repeat the previous directions.";

#define STRICT	// define STRICT to provide maximum type safety
					// as defined by Microsoft

#include <windows.h>
#include <string.h>
#include <alloc.h>
/***************************************************************
	Step 0:
	This is the header file which declares the Drag and Drop
	functions. The functions are in SHELL.DLL
****************************************************************/
#include <shellapi.h>

long FAR PASCAL _export MainWndProc(HWND, unsigned, WORD, LONG);
void AddFiles(HWND, struct List*);

// Definition of structure types for Linked list of files
struct FileList {
	char *lpFileName;	// Name of dragged file
	int x, y;			// Position in client area dropped
	BOOL inClient;		// Dropped in client Flag
	struct FileList *Next;	// Points to next file in group dragged
};
struct List {
	struct List *Next;		// Points to next node in List
	struct FileList *FLptr;	// Points to Filelist(s)
};

// Global variables
HINSTANCE hInst;	// current instance
struct List *liAllFiles;	// Pointer to main list of files
BOOL GetHelp;


/********************************************************************/
void FileDrop( struct FileList* ptr, char *FileName , int px, int py,
				BOOL inClientarea )
{
	ptr->lpFileName =(char*)malloc(strlen( FileName ) + 1 );
	strcpy( ptr->lpFileName, FileName );
	ptr->x = px;
	ptr->y = py;
	ptr->inClient = inClientarea;
	ptr->Next=NULL;
}

char *WhoAmI(struct FileList *ptr)
{
	static char buffer[ 80 ];

	wsprintf( buffer, "File: %s [ %d , %d ] inClient: %d",
			 (LPSTR)ptr->lpFileName, ptr->x , ptr->y, ptr->inClient );

//WARNING!!:  Serious problem recognized:
		//In the small model, without the typecast,
		//lpFileName was two bytes on the stack of which
		//wsprintf took 4.

	return buffer;
}


void WMDropFiles( WORD WParam, HWND hWnd)
/*********************************************************
	Step 3:
	Retrieve a handle to an internal data structure in
	SHELL.DLL.  Get the info of the files out of it.
**********************************************************/
{
	struct FileList *FLptr=NULL, *FLCurrent=NULL, *FLHead=NULL;
	struct List *liFiles;
	int TotalNumberOfFiles;
	int nFileLength;
	char *pszFileName;
	POINT pPoint;
	BOOL inClientArea;
	int i;
/********************************************************
	Step 4:
	Identify the handle
*********************************************************/
	HDROP hDrop = (HDROP)WParam;
				//msg.WParam contains the Handle to the
				//internal data structure which has
				//information about the dropped file(s)

/****************************************************************
	Step 5:
	Find out total number of files dropped, by passing 0xFFFF for
	index parameter to DragQueryFile
*****************************************************************/
	TotalNumberOfFiles = DragQueryFile( hDrop , 0xFFFF, NULL, 0 );
	GetHelp=FALSE;

	liFiles =(struct List*)malloc(sizeof(struct List));

	for ( i = 0; i < TotalNumberOfFiles ; i++ )
	{
/************************************************************
	Step 6:
	Get the length of a filename by telling DragQueryFile
	which file your querying about ( i ), and passing NULL
	for the buffer parameter.
*************************************************************/
		nFileLength  = DragQueryFile( hDrop , i , NULL, 0 );
		pszFileName = (char*)malloc(nFileLength + 1);

/************************************************************
	Step 7:
	Copy a file name.   Tell DragQueryFile the file
	your interested in (i) and the length of your buffer.
	NOTE: Make sure that the length is 1 more then the filename
	to make room for the null charater!
*************************************************************/
		DragQueryFile( hDrop , i, pszFileName, nFileLength + 1 );
			//copies over the filename


/**************************************************************
	Step 8:
	Getting the file dropped. The location is relative to your
	client coordinates, and will have negative values if dropped
	in the non client parts of the window.

	DragQueryPoint copies that point where the file was dropped
	and returns whether or not the point is in the client area.
	Regardless of whether or not the file is dropped in the client
	or non-client area of the window, you will still receive the
	file name.
***************************************************************/

		inClientArea = DragQueryPoint( hDrop , &pPoint );
		FLptr= (struct FileList*)malloc(sizeof(struct FileList));
		if(FLHead == NULL)
			FLHead = FLptr;

		FileDrop(FLptr, pszFileName , pPoint.x, pPoint.y , inClientArea );

		// Add new struct to FileList structure list
		if(FLHead != FLptr)
		{
			FLCurrent->Next=FLptr;
			FLCurrent=FLptr;
			FLptr->Next=NULL;
		}
		else
		{
			FLHead->Next=NULL;
			FLCurrent = FLHead;
		}
	}
	liFiles->FLptr=FLHead;	// Point to first FileList struct in list
	AddFiles( hWnd, (struct List*)liFiles );  //Add this sublist of dropped files
							//to the big list.
/************************************************************
	Step 9:
	Release the memory shell allocated for this handle
	with DragFinish.
	NOTE: This is a real easy step to forget and could
	explain memory leaks and incorrect program performance.
*************************************************************/
	DragFinish( hDrop );
}

/************************************************************/
void AddFiles( HWND hWnd, struct List *pliFiles )
{
	if(liAllFiles==NULL)
	{
		liAllFiles=pliFiles;
		liAllFiles->Next=NULL;
	}
	else
	{
		pliFiles->Next=liAllFiles;  // Put at front of list
		liAllFiles=pliFiles;
	}
	InvalidateRect( hWnd, NULL, TRUE );
	UpdateWindow( hWnd );
}

/************************************************************
	Delete FileList structures on linked list
*************************************************************/
void deleteFileList( struct FileList *pFList)
{
	if(pFList->Next != NULL)
		deleteFileList(pFList->Next);   // Recursion - delete next FileList struct
	free(pFList->lpFileName);       // free string allocation
	free(pFList);                   // free structure FileList
}

/************************************************************
	Delete List structures on linked list
*************************************************************/
void deleteList( struct List *pliFiles)
{
	if(pliFiles != NULL)
	{
		if(pliFiles->Next != NULL)
			deleteList(pliFiles->Next);     // Recursion - delete next List struct
		if(pliFiles->FLptr != NULL)
			deleteFileList(pliFiles->FLptr);// Initial call to free FileList
		free(pliFiles);             // free List struct
	}
}


/**********************************************************************/
BOOL InitApplication(HINSTANCE hInstance)
{
	WNDCLASS  wc;

	// Fill in window class structure with parameters that describe the
	// main window.

	wc.style = CS_HREDRAW | CS_VREDRAW;	// Class style(s).
	wc.lpfnWndProc = (long (FAR PASCAL*)())MainWndProc;	// Function to retrieve messages for
														// windows of this class.
	wc.cbClsExtra = 0;	// No per-class extra data.
	wc.cbWndExtra = 0;	// No per-window extra data.
	wc.hInstance = hInstance;	// Application that owns the class.
	wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	wc.hCursor = LoadCursor(NULL, IDC_ARROW);
	wc.hbrBackground = GetStockObject(WHITE_BRUSH);
    wc.lpszMenuName = "DRAGDROPMENU";
	wc.lpszClassName = "DragnDrop"; // Name used in call to CreateWindow.

	/* Register the window class and return success/failure code. */

	return (RegisterClass(&wc));
}


/************************************************************************/
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
	HWND	hWnd;	// Main window handle.

	/* Save the instance handle in static variable, which will be used in  */
	/* many subsequence calls from this application to Windows.            */

	hInst = hInstance;

	/* Create a main window for this application instance.  */

	hWnd = CreateWindow(
		"DragnDrop",	// See RegisterClass() call.
		"Drag & Drop Example",	// Text for window title bar.
		WS_OVERLAPPEDWINDOW,	// Window style.
		CW_USEDEFAULT,			// Default horizontal position.
		CW_USEDEFAULT,			// Default vertical position.
		CW_USEDEFAULT,			// Default width.
		CW_USEDEFAULT,			// Default height.
		NULL,				// Overlapped windows have no parent.
		NULL,				// Use the window class menu.
		hInstance,			// This instance owns this window.
		NULL				// Pointer not needed.
	);

	/* If window could not be created, return "failure" */

	if (!hWnd)
		return (FALSE);

	/* Make the window visible; update its client area; and return "success" */

	ShowWindow(hWnd, nCmdShow);	// Show the window
	UpdateWindow(hWnd);		// Sends WM_PAINT message
	return (TRUE);		// Returns the value from PostQuitMessage

}


/****************************************************************************
	FUNCTION: MainWndProc(HWND, unsigned, WORD, LONG)
****************************************************************************/
long FAR PASCAL _export MainWndProc(HWND hWnd, unsigned message,
					 WORD wParam, LONG lParam)
{
	HDC hdc;		// HDC for Window
	PAINTSTRUCT ps;	// Paint Struct for BeginPaint call
	RECT rect;
	struct List* Ltemp;
	struct FileList* FLtemp;
	char *bufstring;
	int i;

	switch (message) {
	case WM_CREATE:	// Initialize Global vars
			GetHelp=TRUE;
/************************************************************
	liAllFiles is a pointer to a linked list of structure
	List.  Each List in the linked list will contain the file
	names that were received during a WM_DROPFILES messages
	and will be stored in a linked list of structure FileList.
*************************************************************/
			liAllFiles=NULL;

/****************************************************************
	Step 1:
	calling DragAcceptFiles.  If you pass FALSE, you're saying
	I don't accept them anymore.
*****************************************************************/
			DragAcceptFiles( hWnd , TRUE );

		return NULL;
	case WM_DROPFILES:
/************************************************************
	Step 2:
	Make call to WMDropFiles
*************************************************************/
			WMDropFiles(wParam, hWnd);
		break;
	case WM_PAINT:
	// Display the file name(s)
			hdc=BeginPaint(hWnd,&ps);
			if(GetHelp)
			{
				GetClientRect(hWnd,&rect);
				DrawText(hdc,HelpText,strlen(HelpText),&rect,DT_CENTER|DT_WORDBREAK);
			}
			else
			{
				SetBkMode ( hdc , TRANSPARENT );
				Ltemp=liAllFiles;

				i=0;
				while ( Ltemp != NULL )
				{
					FLtemp=Ltemp->FLptr;
					while( FLtemp != NULL )
					{
						bufstring = WhoAmI(FLtemp);
						TextOut( hdc, 10, 20 * i++, bufstring, strlen(bufstring));
						FLtemp=FLtemp->Next;
					}
					i++;
					Ltemp=Ltemp->Next;
				}
			}
			EndPaint(hWnd,&ps);
		break;
	case WM_COMMAND:	// message: command from application menu
		switch(wParam)
		{
			case 101:
				GetHelp=TRUE;
				InvalidateRect(hWnd,NULL,TRUE);
				UpdateWindow(hWnd);
			break;
			case 102:
				GetHelp=FALSE;
				InvalidateRect(hWnd,NULL,TRUE);
				UpdateWindow(hWnd);
			break;
			case 103:
				GetHelp=FALSE;
				deleteList(liAllFiles);
				liAllFiles=NULL;
				InvalidateRect(hWnd,NULL,TRUE);
				UpdateWindow(hWnd);
			break;
			case 104:
                MessageBox(hWnd,"DRAG n' DROP Example\nCopyright (c) 1992 Borland International, Inc.","ABOUT BOX",MB_OK);
			break;

			default:
			break;
		}
		break;
	case WM_CLOSE:
/****************************************************************
	Step 10:
	Don't accept files anymore
*****************************************************************/
			DragAcceptFiles( hWnd , FALSE );

			deleteList(liAllFiles);
			DestroyWindow(hWnd);
		break;
	case WM_QUIT:
	case WM_DESTROY:	// message: window being destroyed
			PostQuitMessage(0);
		break;
	default:			// Passes it on if unproccessed
		return (DefWindowProc(hWnd, message, wParam, lParam));
	}
	return (NULL);
}

#pragma argsused
/**************************************************************/
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
			 LPSTR lpCmdLine, int nCmdShow)
{
	MSG msg;		// message
	if (!hPrevInstance)	// Other instances of app running?
	if (!InitApplication(hInstance))	// Initialize shared things
		return (FALSE);	// Exits if unable to initialize

	/* Perform initializations that apply to a specific instance */

	if (!InitInstance(hInstance, nCmdShow))
		return (FALSE);

	/* Acquire and dispatch messages until a WM_QUIT message is received. */

	while (GetMessage(&msg,	// message structure
		NULL,	// handle of window receiving the message
		NULL,	// lowest message to examine
		NULL))	// highest message to examine
	{
		TranslateMessage(&msg);	// Translates virtual key codes
		DispatchMessage(&msg);	// Dispatches message to window
	}
	return (msg.wParam);	// Returns the value from PostQuitMessage
}

// end of file dragdrop.c

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美va亚洲va香蕉在线| 日韩中文字幕亚洲一区二区va在线| 综合久久久久综合| 蜜臀久久久99精品久久久久久| 成人免费毛片aaaaa**| 欧美日韩国产精品成人| 中文字幕一区在线| 国产精品正在播放| 91麻豆精品国产91久久久资源速度 | 亚洲免费电影在线| 精东粉嫩av免费一区二区三区| 日本久久一区二区| 欧美国产成人精品| 国产真实乱偷精品视频免| 欧美日韩精品欧美日韩精品| 亚洲欧美日本在线| 国产成人鲁色资源国产91色综| 欧美人动与zoxxxx乱| 一级中文字幕一区二区| 91美女视频网站| 国产精品水嫩水嫩| 国产激情视频一区二区三区欧美| 欧美电影免费观看完整版| 丝袜亚洲另类欧美综合| 日本高清无吗v一区| 亚洲欧洲成人自拍| 成人网页在线观看| 中国av一区二区三区| 国产成人综合亚洲91猫咪| 精品国产一区二区三区忘忧草| 午夜精品aaa| 欧美一区二区三区影视| 无码av免费一区二区三区试看 | 国产一区二区在线观看免费| 日韩午夜电影在线观看| 裸体歌舞表演一区二区| 日韩手机在线导航| 久久超碰97人人做人人爱| 欧美成人综合网站| 激情小说欧美图片| 国产视频不卡一区| 成人国产精品免费网站| 亚洲视频一区在线| 欧美影院精品一区| 免费一区二区视频| 久久夜色精品一区| av不卡免费在线观看| 亚洲激情av在线| 欧美放荡的少妇| 精品一区免费av| 欧美国产精品专区| 日本韩国精品在线| 美女视频一区二区三区| 久久久精品一品道一区| 91免费国产视频网站| 偷窥国产亚洲免费视频| 精品精品国产高清a毛片牛牛| 国产成人av一区| 亚洲欧美日韩中文播放| 欧美日产国产精品| 国产精品12区| 亚洲免费观看高清完整版在线观看熊| 欧美午夜在线一二页| 久久机这里只有精品| 国产精品伦一区二区三级视频| 91国产免费观看| 蜜桃av一区二区三区电影| 中文一区在线播放| 欧美人动与zoxxxx乱| 国产a级毛片一区| 亚洲成精国产精品女| 国产午夜精品在线观看| 精品视频999| 狠狠色狠狠色综合系列| 一区二区三区国产豹纹内裤在线| 欧美一区二区美女| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 成人小视频在线观看| 亚洲第一会所有码转帖| 国产日韩欧美a| 欧美日韩欧美一区二区| 成人午夜又粗又硬又大| 日韩av电影天堂| 中文字幕日韩一区| 精品免费99久久| 欧美日韩亚洲不卡| 99re成人在线| 国产成人99久久亚洲综合精品| 天天综合网天天综合色| 中文字幕综合网| 国产欧美日韩综合| 欧美mv日韩mv国产| 欧美日韩不卡视频| 色综合久久66| 成人app软件下载大全免费| 激情综合网激情| 日本一道高清亚洲日美韩| 一区二区三区在线免费播放| 国产精品丝袜91| 国产亚洲欧美日韩俺去了| 日韩免费观看高清完整版在线观看| 欧美在线综合视频| 色婷婷精品大在线视频| av一区二区久久| caoporm超碰国产精品| 国产在线乱码一区二区三区| 蜜臀av一级做a爰片久久| 亚洲国产精品一区二区尤物区| 亚洲精品中文字幕乱码三区| 中文字幕在线不卡一区二区三区| 2023国产精品| 久久久亚洲综合| 国产女人水真多18毛片18精品视频 | 久久久蜜桃精品| 久久久综合网站| 久久综合九色综合欧美98| 亚洲精品一区二区三区蜜桃下载| 精品国产欧美一区二区| 精品国产亚洲在线| 精品国产乱码久久久久久浪潮| 日韩视频免费观看高清完整版在线观看 | 欧美一级夜夜爽| 4438成人网| 精品国免费一区二区三区| 久久影视一区二区| 国产精品入口麻豆原神| 国产精品久久久久久户外露出| 1区2区3区国产精品| 亚洲激情自拍偷拍| 亚洲综合色丁香婷婷六月图片| 亚洲最色的网站| 亚洲成a人片在线观看中文| 午夜电影久久久| 蜜臂av日日欢夜夜爽一区| 加勒比av一区二区| 国产91色综合久久免费分享| 成人免费视频视频在线观看免费| 99re这里只有精品6| 欧美日韩免费观看一区二区三区| 欧美日韩一区二区三区高清| 欧美一区二区在线不卡| 久久久综合网站| 亚洲精品美国一| 日韩精品亚洲一区二区三区免费| 久久99深爱久久99精品| 成年人国产精品| 这里只有精品视频在线观看| 国产日韩欧美精品综合| 亚洲欧洲99久久| 日本不卡的三区四区五区| 国产精品一二三区在线| 在线影视一区二区三区| 亚洲精品一区二区三区福利| 亚洲欧美色图小说| 精品一区二区三区视频在线观看 | 日本乱人伦aⅴ精品| 日韩欧美国产一区二区在线播放| 欧美国产一区视频在线观看| 香蕉久久一区二区不卡无毒影院 | 91在线云播放| 欧美mv日韩mv亚洲| 亚洲免费av高清| 国产一区二区三区在线看麻豆| 91福利社在线观看| 国产亚洲精品7777| 日韩综合一区二区| 9i看片成人免费高清| 精品裸体舞一区二区三区| 亚洲韩国精品一区| 成人永久看片免费视频天堂| 欧美日韩成人综合天天影院| 国产精品成人免费在线| 久久精品国产免费| 欧美亚洲国产一卡| 国产女主播在线一区二区| 美国毛片一区二区三区| 91福利在线观看| 国产精品久久影院| 国产在线精品一区二区不卡了 | 日韩国产精品久久| 91丨porny丨国产入口| 久久伊人蜜桃av一区二区| 日韩精品一二三四| 欧美日韩中文字幕一区| 亚洲免费色视频| k8久久久一区二区三区| 精品av久久707| 九色综合国产一区二区三区| 欧美人成免费网站| 亚洲高清免费观看 | av影院午夜一区| 久久精品这里都是精品| 久久精品99国产精品日本| 日韩一区二区三区四区五区六区| 亚洲成av人片观看| 欧美日韩免费一区二区三区| 亚洲国产精品自拍| 欧美日本一道本| 视频在线观看一区二区三区| 欧美日韩国产系列|