ReactOS 0.4.15-dev-7842-g558ab78
main.c File Reference
#include <windows.h>
#include <setupapi.h>
#include <tchar.h>
#include <stdlib.h>
#include "resource.h"
Include dependency graph for main.c:

Go to the source code of this file.

Typedefs

typedef BOOL(WINAPISH_GIL_PROC) (HIMAGELIST *phLarge, HIMAGELIST *phSmall)
 
typedef BOOL(WINAPIFII_PROC) (BOOL fFullInit)
 

Functions

BOOL DisplayImageList (HWND hwnd, UINT uID)
 
INT_PTR CALLBACK DlgProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nCmdShow)
 

Typedef Documentation

◆ FII_PROC

typedef BOOL(WINAPI * FII_PROC) (BOOL fFullInit)

Definition at line 8 of file main.c.

◆ SH_GIL_PROC

typedef BOOL(WINAPI * SH_GIL_PROC) (HIMAGELIST *phLarge, HIMAGELIST *phSmall)

Definition at line 7 of file main.c.

Function Documentation

◆ DisplayImageList()

BOOL DisplayImageList ( HWND  hwnd,
UINT  uID 
)

Definition at line 15 of file main.c.

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}
#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 IDC_DEVICE
Definition: resource.h:8
BOOL WINAPI SetupDiGetClassImageList(OUT PSP_CLASSIMAGELIST_DATA ClassImageListData)
Definition: devclass.c:322
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:683
#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
#define IDC_LSTVIEW
Definition: resource.h:2
static HMODULE hShell32
Definition: string.c:34
#define LVSIL_SMALL
Definition: commctrl.h:2299
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2408
#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 LVIF_IMAGE
Definition: commctrl.h:2310
struct _SP_CLASSIMAGELIST_DATA SP_CLASSIMAGELIST_DATA
BOOL WINAPI FileIconInit(BOOL bFullInit)
Definition: shellord.c:1683
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
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
char TCHAR
Definition: xmlstorage.h:189
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by DlgProc().

◆ DlgProc()

INT_PTR CALLBACK DlgProc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 92 of file main.c.

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}
WPARAM wParam
Definition: combotst.c:138
BOOL DisplayImageList(HWND hwnd, UINT uID)
Definition: main.c:15
#define LOWORD(l)
Definition: pedump.c:82
Definition: tftpd.h:60
#define WM_CLOSE
Definition: winuser.h:1621
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_INITDIALOG
Definition: winuser.h:1739
#define IDOK
Definition: winuser.h:830
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

◆ WinMain()

int WINAPI WinMain ( HINSTANCE  hThisInstance,
HINSTANCE  hPrevInstance,
LPSTR  lpszArgument,
int  nCmdShow 
)

Definition at line 130 of file main.c.

134{
136
137 icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
140
141 return DialogBox(hThisInstance,
143 NULL,
144 DlgProc);
145}
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
DLGPROC DlgProc
Definition: desk.c:122
#define IDD_IMGLST
Definition: resource.h:1
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define ICC_COOL_CLASSES
Definition: commctrl.h:69
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define DialogBox
Definition: winuser.h:5761