24 #define WIN32_NO_STATUS 29 #define NO_SHLWAPI_REG 39 #include "wine/unicode.h" 62 ACTCTXW
ActCtx = {
sizeof(ACTCTX), ACTCTX_FLAG_RESOURCE_NAME_VALID};
81 WARN(
"Cannot allocate memory for applet path\n");
88 WARN(
"Cannot expand applet path\n");
98 ActCtx.lpSource = fileBuffer;
100 applet->hActCtx = CreateActCtx(&
ActCtx);
113 WARN(
"Init of applet has failed\n");
117 WARN(
"No subprogram in applet\n");
125 for (
i = 0;
i < applet->
count;
i++) {
128 applet->
info[
i].helpfile[0] = 0;
167 applet->
info[
i].data = newinfo.lData;
169 if (!newinfo.hIcon)
WARN(
"couldn't get icon for applet %u\n",
i);
170 applet->
info[
i].icon = newinfo.hIcon;
174 memcpy(applet->
info[
i].name, newinfo.szName,
sizeof(newinfo.szName));
176 memcpy(applet->
info[
i].info, newinfo.szInfo,
sizeof(newinfo.szInfo));
177 memcpy(applet->
info[
i].helpfile, newinfo.szHelpFile,
sizeof(newinfo.szHelpFile));
189 applet->
info[
i].helpfile,
190 sizeof(applet->
info[
i].helpfile) /
sizeof(
WCHAR));
215 #define IDC_LISTVIEW 1000 216 #define IDC_STATUSBAR 1001 218 #define NUM_COLUMNS 2 219 #define LISTVIEW_DEFSTYLE (WS_CHILD | WS_VISIBLE | WS_TABSTOP |\ 220 LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL) 225 WCHAR empty_string[] = {0};
235 0, 0,
ws.right -
ws.left,
ws.bottom -
ws.top -
258 lvc.
cx = (
ws.right -
ws.left) / 3;
261 if (ListView_InsertColumnW(panel->
hWndListView, 0, &lvc) == -1)
266 lvc.
cx = ((
ws.right -
ws.left) / 3) * 2;
270 if (ListView_InsertColumnW(panel->
hWndListView, 1, &lvc) == -1)
279 HMENU hMenu, hSubMenu;
283 int menucount,
index;
317 for (
i = 0;
i < applet->
count;
i++) {
324 item->applet = applet;
331 mii.
wID = IDM_CPANEL_APPLET_BASE + menucount;
342 lvItem.
iItem = menucount;
351 ListView_SetItemTextW(panel->hWndListView, itemidx, 1, applet->
info[
i].info);
360 panel->total_subprogs = menucount;
372 HMENU hMenu, hSubMenu;
388 for (
i = IDM_CPANEL_APPLET_BASE;
i <= IDM_CPANEL_APPLET_BASE + panel->
total_subprogs;
i++)
402 HMENU hMenu, hSubMenu;
416 HMENU hMenu, hSubMenu;
449 lvItem.
iItem = selitem;
453 return (
CPlItem *) lvItem.lParam;
461 WCHAR verbOpen[] = {
'c',
'p',
'l',
'o',
'p',
'e',
'n',0};
495 case IDM_CPANEL_EXIT:
499 case IDM_CPANEL_ABOUT:
530 if ((
LOWORD(lParam1) >= IDM_CPANEL_APPLET_BASE) &&
579 if ((
LOWORD(lParam1) >= IDM_CPANEL_APPLET_BASE) &&
588 else if ((
HIWORD(lParam1) == 0xFFFF) && (lParam2 == 0))
643 const WCHAR className[] = {
'S',
'h',
'e',
'l',
'l',
'_',
'C',
'o',
'n',
't',
'r',
'o',
644 'l',
'_',
'W',
'n',
'd',
'C',
'l',
'a',
's',
's',0};
669 if (!panel->
hWnd)
return;
703 static const WCHAR wszRegPath[] =
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls";
736 L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}",
747 typedef struct tagAppDlgFindData
788 if (sAppletNo ==
pData->sAppletNo)
800 pData->hDlgResult = hDialog;
858 NULL, CLSCTX_INPROC_SERVER,
862 if (ITaskbarList_HrInit(pTaskbar) ==
S_OK)
864 ITaskbarList_ActivateTab(pTaskbar, applet->
hWnd);
866 ITaskbarList_Release(pTaskbar);
901 if (ch ==
'"') quoted = !quoted;
902 if (!quoted && (ch ==
' ' || ch ==
',' || ch ==
'\0')) {
907 }
else if (*beg ==
'\0') {
913 if (ch ==
'\0')
break;
915 if (ch ==
' ')
while (
end[1] ==
' ')
end++;
923 if (extraPmtsBuf !=
NULL)
925 beg =
end = extraPmtsBuf;
930 if (ch ==
'"') quoted = !quoted;
931 if (!quoted && (ch ==
' ' || ch ==
',' || ch ==
'\0')) {
938 if (ch ==
'\0')
break;
940 if (ch ==
' ')
while (
end[1] ==
' ')
end++;
948 if (extraPmts ==
NULL)
949 extraPmts = extraPmtsBuf;
953 if ((extraPmts) && (*extraPmts ==
'@') && (
sp == -1)) {
968 AppDlgFindData findData;
972 while ((++
sp) != applet->
count) {
981 WARN(
"Out of bounds (%u >= %u), setting to 0\n",
sp, applet->
count);
1006 findData.szAppFile = applet->
cmd;
1008 findData.aCPLName = aCPLName;
1009 findData.aCPLFlags = aCPLFlags;
1010 findData.hRunDLL = applet->
hWnd;
1011 findData.hDlgResult =
NULL;
1015 if (findData.hDlgResult)
1023 Control_ShowAppletInTaskbar(applet,
sp);
1054 TRACE(
"(%p, %p, %s, 0x%08x)\n",
1058 memset(&panel, 0,
sizeof(panel));
1112 FIXME(
"proc %lx hwnd %p inst %p cmdline %s cmdshow %d\n",
1131 FIXME(
"(%p, %p, %08x, %08x, %08x, %08x): stub.\n", hMod, pFunc, dw3, dw4, dw5, dw6);
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
BOOL WINAPI ActivateActCtx(IN HANDLE hActCtx, OUT PULONG_PTR ulCookie)
unsigned __int3264 UINT_PTR
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
ATOM WINAPI GlobalDeleteAtom(ATOM nAtom)
static const WCHAR szName[]
#define memmove(s1, s2, n)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
HDWP WINAPI BeginDeferWindowPos(_In_ int)
#define FCIDM_SHVIEW_LISTVIEW
struct applet_info info[1]
GLubyte GLubyte GLubyte GLubyte w
BOOL WINAPI DrawMenuBar(_In_ HWND)
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define IDI_SHELL_CONTROL_PANEL
HIMAGELIST hImageListSmall
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
#define HKEY_CURRENT_USER
LONG(APIENTRY * APPLET_PROC)(HWND, UINT, LPARAM, LPARAM)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
#define SW_SHOWMINNOACTIVE
static void Control_DoInterface(CPanel *panel, HWND hWnd, HINSTANCE hInst)
#define INVALID_HANDLE_VALUE
GLint GLint GLint GLint GLint x
ATOM WINAPI GlobalFindAtomW(LPCWSTR lpString)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define LISTVIEW_DEFSTYLE
static void Control_StartApplet(HWND hWnd, CPlItem *item)
#define GetWindowLongPtrW
static void Control_WndProc_Create(HWND hWnd, const CREATESTRUCTW *cs)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static void Control_RegisterRegistryApplets(HWND hWnd, CPanel *panel, HKEY hkey_root, LPCWSTR szRepPath)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
struct tagNMHDR * LPNMHDR
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLfloat GLfloat GLfloat GLfloat h
HWND WINAPI GetLastActivePopup(_In_ HWND)
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
GLenum GLuint GLenum GLsizei const GLchar * buf
HRESULT WINAPI Control_FillCache_RunDLLA(HWND hWnd, HANDLE hModule, DWORD w, DWORD x)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
BOOL WINAPI DeactivateActCtx(IN DWORD dwFlags, IN ULONG_PTR ulCookie)
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch)
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
static void Control_FreeCPlItems(HWND hWnd, CPanel *panel)
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
static struct _test_info info[]
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
VOID WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
HWND WINAPI CreateStatusWindowW(LONG style, LPCWSTR text, HWND parent, UINT wid)
BOOL WINAPI PathIsFileSpecW(LPCWSTR lpszPath)
BOOL WINAPI BringWindowToTop(_In_ HWND)
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
HRESULT WINAPI Control_FillCache_RunDLLW(HWND hWnd, HANDLE hModule, DWORD w, DWORD x)
static BOOL Control_CreateListView(CPanel *panel)
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
UINT WINAPI GlobalGetAtomNameW(ATOM nAtom, LPWSTR lpBuffer, int nSize)
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
static const WCHAR szClassName[]
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
BOOL WINAPI SetMenu(_In_ HWND, _In_opt_ HMENU)
#define FCIDM_SHVIEW_REPORTVIEW
#define UlongToHandle(ul)
int WINAPI GetSystemMetrics(_In_ int)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
unsigned __int3264 UINT_PTR
void Control_UnloadApplet(CPlApplet *applet)
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
_In_ PCWSTR _Out_ PVOID * ActCtx
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
WINE_DEFAULT_DEBUG_CHANNEL(shlctrl)
static CPlItem * Control_GetCPlItem_From_ListView(CPanel *panel)
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
static void Control_DoLaunch(CPanel *panel, HWND hWnd, LPCWSTR wszCmd)
struct tagNEWCPLINFOA NEWCPLINFOA
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
#define memcpy(s1, s2, n)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define FCIDM_SHVIEW_BIGICON
LRESULT(CALLBACK * FARPROC16)()
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg, WPARAM lParam1, LPARAM lParam2)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
HWND WINAPI GetParent(_In_ HWND)
#define ICC_LISTVIEW_CLASSES
#define shell32_hInstance
DWORD WINAPI CallCPLEntry16(HMODULE hMod, FARPROC pFunc, DWORD dw3, DWORD dw4, DWORD dw5, DWORD dw6)
static unsigned __int64 next
static void Control_UpdateListViewStyle(CPanel *panel, UINT style, UINT id)
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
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
static CPlItem * Control_GetCPlItem_From_MenuID(HWND hWnd, UINT id)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HIMAGELIST hImageListLarge
#define FIELD_OFFSET(t, f)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
CPlApplet * Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel *panel)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
ATOM WINAPI GlobalAddAtomW(LPCWSTR lpString)
static void Control_DoWindow(CPanel *panel, HWND hWnd, HINSTANCE hInst)
#define MultiByteToWideChar
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
#define DECLARE_HANDLE(name)
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define WS_OVERLAPPEDWINDOW
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
const char * appName(const char *argv0)
#define GetProcAddress(x, y)
#define SetWindowLongPtrW
#define MAKEINTRESOURCEW(i)
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
HMENU WINAPI GetMenu(_In_ HWND)
#define ListView_InsertItemW(hwnd, pitem)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
#define FCIDM_SHVIEW_SMALLICON
struct tagMENUITEMINFOW MENUITEMINFOW
#define HeapFree(x, y, z)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define RegCloseKey(hKey)
int WINAPI StrCmpIW(LPCWSTR lpszStr, LPCWSTR lpszComp)
WINE_UNICODE_INLINE int atoiW(const WCHAR *str)
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
#define HKEY_LOCAL_MACHINE
void WINAPI Control_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow)
BOOL WINAPI FindClose(HANDLE hFindFile)