ReactOS 0.4.15-dev-7704-gc07eb9f
main.c
Go to the documentation of this file.
1#include <windows.h>
2#include <setupapi.h>
3#include <tchar.h>
4#include <stdlib.h>
5#include "resource.h"
6
7typedef BOOL (WINAPI * SH_GIL_PROC)(HIMAGELIST *phLarge, HIMAGELIST *phSmall);
8typedef BOOL (WINAPI * FII_PROC)(BOOL fFullInit);
9
10/*** Shell32 undoc'd functions ***/
11 /* Shell_GetImageLists @71 */
12 /* FileIconInit @660 */
13
14BOOL
16 UINT uID)
17{
18 HWND hLV;
20 LV_ITEM lvItem;
21 TCHAR Buf[6];
22 INT ImageListCount = -1;
23 INT i = 0;
24
27
28 if (uID == IDC_SYSTEM)
29 {
30 HIMAGELIST hLarge, hSmall;
34
35 hShell32 = LoadLibrary(_T("shell32.dll"));
36 if(hShell32 == NULL)
37 return FALSE;
38
41
43 {
45 return FALSE;
46 }
47
49
50 Shell_GetImageLists(&hLarge, &hSmall);
51
52 ImageListCount = ImageList_GetImageCount(hSmall);
53
55 hSmall,
57
59 }
60 else if (uID == IDC_DEVICE)
61 {
64
66
70 }
71 else
72 return FALSE;
73
74 lvItem.mask = LVIF_TEXT | LVIF_IMAGE;
75
76 while (i <= ImageListCount)
77 {
78 lvItem.iItem = i;
79 lvItem.iSubItem = 0;
80 lvItem.pszText = _itot(i, Buf, 10);
81 lvItem.iImage = i;
82
83 (void)ListView_InsertItem(hLV, &lvItem);
84
85 i++;
86 }
87
88 return TRUE;
89}
90
96{
97 switch (message)
98 {
99 case WM_INITDIALOG:
101 return TRUE;
102
103 case WM_CLOSE:
104 EndDialog(hwnd, 0);
105 return TRUE;
106
107 case WM_COMMAND:
108 {
109 switch(LOWORD(wParam))
110 {
111 case IDOK:
112 EndDialog(hwnd, 0);
113 return TRUE;
114
115 case IDC_SYSTEM:
117 return TRUE;
118
119 case IDC_DEVICE:
121 return TRUE;
122 }
123 }
124 }
125
126 return FALSE;
127}
128
129int WINAPI
130WinMain(HINSTANCE hThisInstance,
131 HINSTANCE hPrevInstance,
132 LPSTR lpszArgument,
133 int nCmdShow)
134{
136
137 icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
140
141 return DialogBox(hThisInstance,
143 NULL,
144 DlgProc);
145}
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow)
Definition: main.c:8
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
DLGPROC DlgProc
Definition: desk.c:122
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDC_SYSTEM
Definition: resource.h:270
INT WINAPI ImageList_GetImageCount(HIMAGELIST himl)
Definition: imagelist.c:2063
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
#define CALLBACK
Definition: compat.h:35
#define IDC_DEVICE
Definition: resource.h:8
BOOL WINAPI SetupDiGetClassImageList(OUT PSP_CLASSIMAGELIST_DATA ClassImageListData)
Definition: devclass.c:322
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
SP_CLASSIMAGELIST_DATA ImageListData
Definition: hdwwiz.c:34
BOOL WINAPI Shell_GetImageLists(HIMAGELIST *lpBigList, HIMAGELIST *lpSmallList)
Definition: iconcache.cpp:686
#define _itot
Definition: tchar.h:608
BOOL(WINAPI * SH_GIL_PROC)(HIMAGELIST *phLarge, HIMAGELIST *phSmall)
Definition: main.c:7
BOOL(WINAPI * FII_PROC)(BOOL fFullInit)
Definition: main.c:8
BOOL DisplayImageList(HWND hwnd, UINT uID)
Definition: main.c:15
#define IDC_LSTVIEW
Definition: resource.h:2
#define IDD_IMGLST
Definition: resource.h:1
static HMODULE hShell32
Definition: string.c:34
unsigned int UINT
Definition: ndis.h:50
#define BOOL
Definition: nt_native.h:43
#define LOWORD(l)
Definition: pedump.c:82
#define LVSIL_SMALL
Definition: commctrl.h:2299
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2408
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2304
#define LV_ITEM
Definition: commctrl.h:2337
#define ListView_DeleteAllItems(hwnd)
Definition: commctrl.h:2414
#define LVIF_TEXT
Definition: commctrl.h:2309
#define ICC_COOL_CLASSES
Definition: commctrl.h:69
#define LVIF_IMAGE
Definition: commctrl.h:2310
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
struct _SP_CLASSIMAGELIST_DATA SP_CLASSIMAGELIST_DATA
BOOL WINAPI FileIconInit(BOOL bFullInit)
Definition: shellord.c:1683
Definition: tftpd.h:60
int32_t INT_PTR
Definition: typedefs.h:64
int32_t INT
Definition: typedefs.h:58
#define _T(x)
Definition: vfdio.h:22
#define LoadLibrary
Definition: winbase.h:3797
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define WM_CLOSE
Definition: winuser.h:1620
#define WM_COMMAND
Definition: winuser.h:1739
#define WM_INITDIALOG
Definition: winuser.h:1738
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:829
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define DialogBox
Definition: winuser.h:5760
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
char TCHAR
Definition: xmlstorage.h:189
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182