ReactOS 0.4.15-dev-8207-gd73a838
appview.cpp File Reference
#include "rapps.h"
#include "appview.h"
#include "gui.h"
#include <windowsx.h>
Include dependency graph for appview.cpp:

Go to the source code of this file.

Classes

struct  CAsyncLoadIcon
 

Functions

int ScrnshotDownloadCallback (pASYNCINET AsyncInet, ASYNC_EVENT Event, WPARAM wParam, LPARAM lParam, VOID *Extension)
 
static DWORD CALLBACK AsyncLoadIconProc (LPVOID Param)
 

Variables

HICON g_hDefaultPackageIcon = NULL
 
static int g_DefaultPackageIconILIdx = I_IMAGENONE
 
struct CAsyncLoadIcong_AsyncIconTasks = NULL
 
static UINT g_AsyncIconTaskId = 0
 

Function Documentation

◆ AsyncLoadIconProc()

static DWORD CALLBACK AsyncLoadIconProc ( LPVOID  Param)
static

Definition at line 991 of file appview.cpp.

992{
993 for (CAsyncLoadIcon *task = (CAsyncLoadIcon*)Param, *old; task; old->Free())
994 {
995 if (task->TaskId == g_AsyncIconTaskId)
996 {
997 HICON hIcon;
998 if (!task->Parse)
999 hIcon = (HICON)LoadImageW(NULL, task->Location, IMAGE_ICON, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE);
1000 else if (!ExtractIconExW(task->Location, PathParseIconLocationW(task->Location), &hIcon, NULL, 1))
1001 hIcon = NULL;
1002
1003 if (hIcon)
1004 {
1005 SendMessageW(task->hAppsList, WM_RAPPSLIST_ASYNCICON, (WPARAM)hIcon, (LPARAM)task);
1007 }
1008 }
1009 old = task;
1010 task = task->pNext;
1011 }
1012 return 0;
1013}
static UINT g_AsyncIconTaskId
Definition: appview.cpp:988
#define WM_RAPPSLIST_ASYNCICON
Definition: appview.h:42
#define NULL
Definition: types.h:112
int WINAPI PathParseIconLocationW(LPWSTR lpszPath)
Definition: path.c:1092
UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, INT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons)
Definition: iconcache.cpp:849
static HICON
Definition: imagelist.c:84
HICON hIcon
Definition: msconfig.c:44
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define LR_LOADFROMFILE
Definition: winuser.h:1092
#define IMAGE_ICON
Definition: winuser.h:212
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2234
#define LR_DEFAULTSIZE
Definition: winuser.h:1094
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2084

Referenced by CAsyncLoadIcon::StartTasks().

◆ ScrnshotDownloadCallback()

int ScrnshotDownloadCallback ( pASYNCINET  AsyncInet,
ASYNC_EVENT  Event,
WPARAM  wParam,
LPARAM  lParam,
VOID Extension 
)

Definition at line 288 of file appview.cpp.

289{
291 switch (Event)
292 {
293 case ASYNCINET_DATA:
296 break;
301 break;
306 break;
307 case ASYNCINET_ERROR:
310 break;
311 default:
313 break;
314 }
315 return 0;
316}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
#define WM_RAPPS_DOWNLOAD_COMPLETE
Definition: appview.h:39
@ ASYNCINET_ERROR
Definition: asyncinet.h:15
@ ASYNCINET_COMPLETE
Definition: asyncinet.h:9
@ ASYNCINET_CANCELLED
Definition: asyncinet.h:12
@ ASYNCINET_DATA
Definition: asyncinet.h:7
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define ERROR_SUCCESS
Definition: deptool.c:10
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
unsigned long DWORD
Definition: ntddk_ex.h:95
_Inout_opt_ PUNICODE_STRING Extension
Definition: fltkernel.h:1092
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
Definition: wdfiotarget.h:960
CONST void * LPCVOID
Definition: windef.h:191
#define ERROR_CANCELLED
Definition: winerror.h:726
#define SendMessage
Definition: winuser.h:5852

Referenced by CAppScrnshotPreview::DisplayImage().

Variable Documentation

◆ g_AsyncIconTaskId

UINT g_AsyncIconTaskId = 0
static

◆ g_AsyncIconTasks

◆ g_DefaultPackageIconILIdx

int g_DefaultPackageIconILIdx = I_IMAGENONE
static

Definition at line 17 of file appview.cpp.

Referenced by CAppsListView::AddApplication(), and CAppsListView::SetDisplayAppType().

◆ g_hDefaultPackageIcon