Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
ImageListUtil.cs
Package: ProgressBar_src.rar [view]
Upload User: nnpulika
Upload Date: 2013-02-15
Package Size: 597k
Code Size: 2k
Category:
StatusBar
Development Platform:
C#
- using System;
- using System.Runtime.InteropServices;
- using UtilityLibrary.Win32;
- namespace UtilityLibrary.General
- {
- /// <summary>
- /// Summary description for ImageListUtil.
- /// </summary>
- public class ImageListUtil : IDisposable
- {
- #region Class Variables
- IntPtr handle = IntPtr.Zero;
- const int IMAGELIST_GROW = 10;
- #endregion
- #region Constructors
- public ImageListUtil(int width, int height, uint flags, int count)
- {
- // Initialize CommonLibrary
- WindowsAPI.InitCommonControls();
- // Create imageList
- handle = WindowsAPI.ImageList_Create(width, height, flags, count, IMAGELIST_GROW);
- }
- public void Dispose()
- {
- // Destroy image list
- if ( handle != IntPtr.Zero )
- {
- WindowsAPI.ImageList_Destroy(handle);
- }
- }
- #endregion
- #region Methods
- public void AddImage(IntPtr hBitmap, IntPtr hMask)
- {
- int rc = WindowsAPI.ImageList_Add(handle, hBitmap, hMask);
- }
- public void RemoveImage(int index)
- {
- WindowsAPI.ImageList_Remove(handle, index);
- }
- public void BeginDrag(int imageIndex, int xHotSpot, int yHotSpot)
- {
- WindowsAPI.ImageList_BeginDrag(handle, imageIndex, xHotSpot, yHotSpot);
- }
- public void DragEnter(IntPtr hWndLock, int x, int y)
- {
- WindowsAPI.ImageList_DragEnter(hWndLock, x, y);
- }
- public void DragMove(int x, int y)
- {
- WindowsAPI.ImageList_DragMove(x, y);
- }
- public void DragLeave(IntPtr hWndLock)
- {
- WindowsAPI.ImageList_DragLeave(hWndLock);
- }
- public void EndDrag()
- {
- WindowsAPI.ImageList_EndDrag();
- }
- #endregion
- }
- }