ReactOS  0.4.15-dev-1384-g878186b
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)
 
BOOL 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 
25  hLV = GetDlgItem(hwnd, IDC_LSTVIEW);
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,
56  LVSIL_SMALL);
57 
59  }
60  else if (uID == IDC_DEVICE)
61  {
64 
66 
69  LVSIL_SMALL);
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 IDC_DEVICE
Definition: resource.h:8
INT WINAPI ImageList_GetImageCount(HIMAGELIST himl)
Definition: imagelist.c:2063
#define IDC_LSTVIEW
Definition: resource.h:2
#define LV_ITEM
Definition: commctrl.h:2333
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define LVSIL_SMALL
Definition: commctrl.h:2295
#define LoadLibrary
Definition: winbase.h:3702
#define TRUE
Definition: types.h:120
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2404
BOOL WINAPI SetupDiGetClassImageList(OUT PSP_CLASSIMAGELIST_DATA ClassImageListData)
Definition: devclass.c:441
int32_t INT
Definition: typedefs.h:58
#define _itot
Definition: tchar.h:608
#define LVIF_TEXT
Definition: commctrl.h:2305
#define FALSE
Definition: types.h:117
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2300
BOOL(WINAPI * SH_GIL_PROC)(HIMAGELIST *phLarge, HIMAGELIST *phSmall)
Definition: main.c:7
const char * LPCSTR
Definition: xmlstorage.h:183
BOOL WINAPI FileIconInit(BOOL bFullInit)
Definition: shellord.c:1705
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
#define FreeLibrary(x)
Definition: compat.h:607
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define LVIF_IMAGE
Definition: commctrl.h:2306
#define IDC_SYSTEM
Definition: resource.h:270
BOOL WINAPI Shell_GetImageLists(HIMAGELIST *lpBigList, HIMAGELIST *lpSmallList)
Definition: iconcache.cpp:706
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
#define NULL
Definition: types.h:112
BOOL(WINAPI * FII_PROC)(BOOL fFullInit)
Definition: main.c:8
#define GetProcAddress(x, y)
Definition: compat.h:612
struct _SP_CLASSIMAGELIST_DATA SP_CLASSIMAGELIST_DATA
static HMODULE hShell32
Definition: string.c:34
SP_CLASSIMAGELIST_DATA ImageListData
Definition: hdwwiz.c:34
#define ListView_DeleteAllItems(hwnd)
Definition: commctrl.h:2410

Referenced by DlgProc().

◆ DlgProc()

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

Definition at line 93 of file main.c.

97 {
98  switch (message)
99  {
100  case WM_INITDIALOG:
102  return TRUE;
103 
104  case WM_CLOSE:
105  EndDialog(hwnd, 0);
106  return TRUE;
107 
108  case WM_COMMAND:
109  {
110  switch(LOWORD(wParam))
111  {
112  case IDOK:
113  EndDialog(hwnd, 0);
114  return TRUE;
115 
116  case IDC_SYSTEM:
118  return TRUE;
119 
120  case IDC_DEVICE:
122  return TRUE;
123  }
124  }
125  }
126 
127  return FALSE;
128 }
#define IDC_DEVICE
Definition: resource.h:8
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: tftpd.h:59
#define IDOK
Definition: winuser.h:824
#define TRUE
Definition: types.h:120
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
BOOL DisplayImageList(HWND hwnd, UINT uID)
Definition: main.c:15
#define FALSE
Definition: types.h:117
#define WM_CLOSE
Definition: winuser.h:1603
#define IDC_SYSTEM
Definition: resource.h:270
#define WM_COMMAND
Definition: winuser.h:1722
#define WM_INITDIALOG
Definition: winuser.h:1721
#define LOWORD(l)
Definition: pedump.c:82

Referenced by InitPropSheetPage(), and WinMain().

◆ WinMain()

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

Definition at line 131 of file main.c.

135 {
137 
138  icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
140  InitCommonControlsEx(&icex);
141 
142  return DialogBox(hThisInstance,
144  NULL,
145  (DLGPROC)DlgProc);
146 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define DialogBox
Definition: winuser.h:5736
#define ICC_COOL_CLASSES
Definition: commctrl.h:69
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#define IDD_IMGLST
Definition: resource.h:1
BOOL CALLBACK DlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: main.c:93
INT_PTR(CALLBACK * DLGPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2871
#define NULL
Definition: types.h:112