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

📄 folderctrl.h

📁 funambol windows mobile plugin source code, the source code is taken from the funambol site
💻 H
字号:
/*
 * Copyright (C) 2003-2007 Funambol, Inc
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY, TITLE, NONINFRINGEMENT or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 * 02111-1307  USA
 */

#ifndef _INCL_FOLDERCTRL
#define _INCL_FOLDERCTRL

#pragma once
#include "stdafx.h"


#include <list>
using namespace std;

#if defined(WIN32_PLATFORM_PSPC)
//  defines and functions used by Pocket PC folder view tree control
#include <aygshell.h>

//Menu Bar Height
#define MENU_HEIGHT 26

//#define SHGetMenu(hWndMB)  (HMENU)SendMessage((hWndMB), SHCMBM_GETMENU, (WPARAM)0, (LPARAM)0);
#define SHGetSubMenu(hWndMB,ID_MENU) (HMENU)SendMessage((hWndMB), SHCMBM_GETSUBMENU, (WPARAM)0, (LPARAM)ID_MENU);
#define SHSetSubMenu(hWndMB,ID_MENU) (HMENU)SendMessage((hWndMB), SHCMBM_SETSUBMENU, (WPARAM)0, (LPARAM)ID_MENU);

//Alternate definition
#define SHMenuBar_GetMenu(hWndMB,ID_MENU) (HMENU)SendMessage((hWndMB), SHCMBM_GETSUBMENU, (WPARAM)0, (LPARAM)ID_MENU);

typedef enum tagIMAGES { IMAGE_OPEN, IMAGE_CLOSED, IMAGE_EXE, IMAGE_TREE, IMAGE_DOCUMENT} IMAGES;

/**
 * application instance handle
 */
extern HINSTANCE g_hInstance;

/**
 * handle to the menubar window
 */
extern HWND hwndCB;

extern HIMAGELIST himl;			// handle of the image list

/**
 * inits the image list for the tree, images for folder expanded/closed
 */
BOOL InitTreeViewImageLists(HWND);

// currently does nothing
BOOL InitTreeViewItems(HWND);

/**
 * adds an item to the tree
 * @param hwndTV     - handle of the treeview to add the item to
 * @param lpszItem   - string to add to the tree
 * @param htiParent  - handle of the tree item that will be this item's parent
 * @param fDirectory - TRUE if this item is a directory
 */
HTREEITEM AddItemToTree(HWND hwndTV, LPTSTR lpszItem, HTREEITEM htiParent, BOOL fDirectory);

/**
 * populates the tree with the folders from pszDirectory folder
 * @param hwndTV          - TreeView to add the contents to
 * @param pszDirectory    - Path of the directory to list the contents for
 * @param htiParent       - TreeView item to add the contents as children of
 */
BOOL GetDirectoryContents(HWND hwndTV, LPTSTR pszDirectory, HTREEITEM htiParent);

/**
* @param hwndTV  - handle of the treeview control
* @param tvi     - item to build the path for
* @param lpszDir - string to place the path into
 */
BOOL BuildDirectory(HWND hwndTV, TV_ITEM tvi, LPTSTR lpszDir);

#define IDC_TREEVIEW	101
#define CX_BITMAP		 16
#define CY_BITMAP		 15
#define NUM_BITMAPS		  3

#endif


#if defined(WIN32_PLATFORM_WFSP)
    // Smartphone platform

    /**
     *  adds an item to the listbox containing the folders from the current folder
     */
    void AddItemToList(CListBox* , CString);

    /**
     *  populates the listbox with the subfolders of the <pszDirectory> folder
     */
    BOOL GetDirectoryContents( CListBox* list1, LPTSTR pszDirectory);

    /**
     *  takes the folders from the <path> list and constructs the path in <outString>
     * @param path : list, each element contains a folder from the path
     * @param outString: [OUT] will contain the constructed path
     * @return : always TRUE
     */
    BOOL BuildDirectory(list<CString> path, CString& outString);

    /**
     * adds the root to <list1>, not used anywhere
     */
    BOOL InitListViewItems(CListBox* list1);
#endif

#endif

⌨️ 快捷键说明

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