24#define WIN32_NO_STATUS
36#include <wine/unicode.h>
64 ACTCTXW
ActCtx = {
sizeof(ACTCTX), ACTCTX_FLAG_RESOURCE_NAME_VALID};
83 WARN(
"Cannot allocate memory for applet path\n");
90 WARN(
"Cannot expand applet path\n");
100 ActCtx.lpSource = fileBuffer;
102 applet->hActCtx = CreateActCtx(&
ActCtx);
115 WARN(
"Init of applet has failed\n");
119 WARN(
"No subprogram in applet\n");
127 for (
i = 0;
i < applet->
count;
i++) {
130 applet->
info[
i].helpfile[0] = 0;
169 applet->
info[
i].data = newinfo.lData;
171 if (!newinfo.hIcon)
WARN(
"couldn't get icon for applet %u\n",
i);
172 applet->
info[
i].icon = newinfo.hIcon;
176 memcpy(applet->
info[
i].name, newinfo.szName,
sizeof(newinfo.szName));
178 memcpy(applet->
info[
i].info, newinfo.szInfo,
sizeof(newinfo.szInfo));
179 memcpy(applet->
info[
i].helpfile, newinfo.szHelpFile,
sizeof(newinfo.szHelpFile));
191 applet->
info[
i].helpfile,
192 sizeof(applet->
info[
i].helpfile) /
sizeof(
WCHAR));
217#define IDC_LISTVIEW 1000
218#define IDC_STATUSBAR 1001
221#define LISTVIEW_DEFSTYLE (WS_CHILD | WS_VISIBLE | WS_TABSTOP |\
222 LVS_SORTASCENDING | LVS_AUTOARRANGE | LVS_SINGLESEL)
227 WCHAR empty_string[] = {0};
237 0, 0,
ws.right -
ws.left,
ws.bottom -
ws.top -
260 lvc.
cx = (
ws.right -
ws.left) / 3;
263 if (ListView_InsertColumnW(panel->
hWndListView, 0, &lvc) == -1)
268 lvc.
cx = ((
ws.right -
ws.left) / 3) * 2;
272 if (ListView_InsertColumnW(panel->
hWndListView, 1, &lvc) == -1)
281 HMENU hMenu, hSubMenu;
285 int menucount,
index;
319 for (
i = 0;
i < applet->
count;
i++) {
326 item->applet = applet;
333 mii.
wID = IDM_CPANEL_APPLET_BASE + menucount;
344 lvItem.
iItem = menucount;
374 HMENU hMenu, hSubMenu;
390 for (
i = IDM_CPANEL_APPLET_BASE;
i <= IDM_CPANEL_APPLET_BASE + panel->
total_subprogs;
i++)
404 HMENU hMenu, hSubMenu;
418 HMENU hMenu, hSubMenu;
451 lvItem.
iItem = selitem;
455 return (
CPlItem *) lvItem.lParam;
463 WCHAR verbOpen[] = {
'c',
'p',
'l',
'o',
'p',
'e',
'n',0};
497 case IDM_CPANEL_EXIT:
501 case IDM_CPANEL_ABOUT:
532 if ((
LOWORD(lParam1) >= IDM_CPANEL_APPLET_BASE) &&
581 if ((
LOWORD(lParam1) >= IDM_CPANEL_APPLET_BASE) &&
590 else if ((
HIWORD(lParam1) == 0xFFFF) && (lParam2 == 0))
645 const WCHAR className[] = {
'S',
'h',
'e',
'l',
'l',
'_',
'C',
'o',
'n',
't',
'r',
'o',
646 'l',
'_',
'W',
'n',
'd',
'C',
'l',
'a',
's',
's',0};
671 if (!panel->
hWnd)
return;
705 static const WCHAR wszRegPath[] =
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls";
739 L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}",
750typedef struct tagAppDlgFindData
780 if (sAppletNo !=
pData->sAppletNo)
790 pData->hDlgResult = hDialog;
852 NULL, CLSCTX_INPROC_SERVER,
856 if (ITaskbarList_HrInit(pTaskbar) ==
S_OK)
858 ITaskbarList_ActivateTab(pTaskbar, applet->
hWnd);
860 ITaskbarList_Release(pTaskbar);
896 if (ch ==
'"') quoted = !quoted;
897 if (!quoted && (ch ==
' ' || ch ==
',' || ch ==
'\0')) {
902 }
else if (*beg ==
'\0') {
908 if (ch ==
'\0')
break;
910 if (ch ==
' ')
while (
end[1] ==
' ')
end++;
918 if (extraPmtsBuf !=
NULL)
920 beg =
end = extraPmtsBuf;
925 if (ch ==
'"') quoted = !quoted;
926 if (!quoted && (ch ==
' ' || ch ==
',' || ch ==
'\0')) {
933 if (ch ==
'\0')
break;
935 if (ch ==
' ')
while (
end[1] ==
' ')
end++;
943 if (extraPmts ==
NULL)
944 extraPmts = extraPmtsBuf;
948 if ((extraPmts) && (*extraPmts ==
'@') && (
sp == -1)) {
959 while ((++
sp) != applet->
count) {
968 WARN(
"Out of bounds (%u >= %u), setting to 0\n",
sp, applet->
count);
998 if (wszDialogBoxName !=
NULL)
1004 for (
i = 0;
i < nLen;
i++)
1006 if (quoted && wszCmd[
i] !=
L'"')
1015 pchFirstComma = &wszCmd[
i];
1016 else if (!pchSecondComma)
1017 pchSecondComma = &wszCmd[
i];
1020 pchLastUnquotedSpace = &wszCmd[
i];
1031 if (pchLastUnquotedSpace)
1035 while (pchLastUnquotedSpace[nSpaces] ==
L' ')
1039 StringCchCopyW(wszDialogBoxName, nLen + 1, pchLastUnquotedSpace + nSpaces);
1056 if (!pchSecondComma)
1057 pchSecondComma = wszCmd + nLen;
1063 pchSecondComma - pchFirstComma - 1);
1065 if (pchSecondComma != wszCmd + nLen)
1067 extraPmts = pchSecondComma + 1;
1075 while ((
ptr =
StrChrW(wszDialogBoxName,
'"')))
1078 if (wszDialogBoxName[0] ==
L'@')
1080 sp =
_wtoi(wszDialogBoxName + 1);
1093 AppDlgFindData findData;
1098 while ((++
sp) != applet->
count)
1107 if (
sp >= applet->
count && wszDialogBoxName[0] ==
L'\0')
1114 if (sp < applet->
count)
1128 findData.szAppFile = applet->
cmd;
1130 findData.aCPLName = aCPLName;
1131 findData.aCPLFlags = aCPLFlags;
1132 findData.hRunDLL = applet->
hWnd;
1133 findData.hDlgResult =
NULL;
1137 if (findData.hDlgResult)
1145 Control_ShowAppletInTaskbar(applet,
sp);
1147 if (extraPmts[0] ==
L'\0' ||
1177 TRACE(
"(%p, %p, %s, 0x%08x)\n",
1181 memset(&panel, 0,
sizeof(panel));
1235 FIXME(
"proc %lx hwnd %p inst %p cmdline %s cmdshow %d\n",
1254 FIXME(
"(%p, %p, %08x, %08x, %08x, %08x): stub.\n", hMod, pFunc, dw3, dw4, dw5, dw6);
#define shell32_hInstance
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
VOID WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
static void list_remove(struct list_entry *entry)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
#define UlongToHandle(ul)
#define RegCloseKey(hKey)
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
HWND WINAPI CreateStatusWindowW(LONG style, LPCWSTR text, HWND parent, UINT wid)
LONG(APIENTRY * APPLET_PROC)(HWND, UINT, LPARAM, LPARAM)
struct tagNEWCPLINFOA NEWCPLINFOA
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
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)
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define HeapFree(x, y, z)
#define MultiByteToWideChar
BOOL WINAPI DeactivateActCtx(IN DWORD dwFlags, IN ULONG_PTR ulCookie)
BOOL WINAPI ActivateActCtx(IN HANDLE hActCtx, OUT PULONG_PTR ulCookie)
ATOM WINAPI GlobalFindAtomW(LPCWSTR lpString)
UINT WINAPI GlobalGetAtomNameW(ATOM nAtom, LPWSTR lpBuffer, int nSize)
ATOM WINAPI GlobalDeleteAtom(ATOM nAtom)
ATOM WINAPI GlobalAddAtomW(LPCWSTR lpString)
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI FindClose(HANDLE hFindFile)
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
CPlApplet * Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel *panel)
DWORD WINAPI CallCPLEntry16(HMODULE hMod, FARPROC pFunc, DWORD dw3, DWORD dw4, DWORD dw5, DWORD dw6)
HRESULT WINAPI Control_FillCache_RunDLLA(HWND hWnd, HANDLE hModule, DWORD w, DWORD x)
void Control_UnloadApplet(CPlApplet *applet)
static CPlItem * Control_GetCPlItem_From_ListView(CPanel *panel)
static void Control_DoInterface(CPanel *panel, HWND hWnd, HINSTANCE hInst)
static BOOL Control_CreateListView(CPanel *panel)
static void Control_StartApplet(HWND hWnd, CPlItem *item)
static void Control_RegisterRegistryApplets(HWND hWnd, CPanel *panel, HKEY hkey_root, LPCWSTR szRepPath)
static CPlItem * Control_GetCPlItem_From_MenuID(HWND hWnd, UINT id)
void WINAPI Control_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow)
static void Control_DoWindow(CPanel *panel, HWND hWnd, HINSTANCE hInst)
#define LISTVIEW_DEFSTYLE
static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg, WPARAM lParam1, LPARAM lParam2)
static void Control_WndProc_Create(HWND hWnd, const CREATESTRUCTW *cs)
HRESULT WINAPI Control_FillCache_RunDLLW(HWND hWnd, HANDLE hModule, DWORD w, DWORD x)
static void Control_FreeCPlItems(HWND hWnd, CPanel *panel)
static void Control_DoLaunch(CPanel *panel, HWND hWnd, LPCWSTR wszCmd)
static void Control_UpdateListViewStyle(CPanel *panel, UINT style, UINT id)
BOOL WINAPI PathIsFileSpecW(LPCWSTR lpszPath)
int WINAPI StrCmpIW(LPCWSTR lpszStr, LPCWSTR lpszComp)
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLenum GLuint GLenum GLsizei const GLchar * buf
GLubyte GLubyte GLubyte GLubyte w
GLfloat GLfloat GLfloat GLfloat h
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
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
_In_ PCWSTR _Out_ PVOID * ActCtx
const char * appName(const char *argv0)
#define DECLARE_HANDLE(name)
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
unsigned __int3264 UINT_PTR
#define WS_OVERLAPPEDWINDOW
static const WCHAR szName[]
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define ImageList_AddIcon(himl, hicon)
#define ICC_LISTVIEW_CLASSES
static unsigned __int64 next
#define ListView_InsertItemW(hwnd, pitem)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
#define FCIDM_SHVIEW_LISTVIEW
#define FCIDM_SHVIEW_BIGICON
#define FCIDM_SHVIEW_SMALLICON
#define FCIDM_SHVIEW_REPORTVIEW
#define IDI_SHELL_CONTROL_PANEL
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
STRSAFEAPI StringCchCopyNW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, size_t cchToCopy)
HIMAGELIST hImageListLarge
HIMAGELIST hImageListSmall
struct applet_info info[1]
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
TW_UINT32 TW_UINT16 TW_UINT16 MSG
#define FIELD_OFFSET(t, f)
HWND WINAPI GetShellWindow(VOID)
LRESULT(CALLBACK * FARPROC16)()
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER
BOOL WINAPI IsWindow(_In_opt_ HWND)
BOOL WINAPI SetMenu(_In_ HWND, _In_opt_ HMENU)
#define GetWindowLongPtrW
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
HWND WINAPI GetLastActivePopup(_In_ HWND)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
BOOL WINAPI DrawMenuBar(_In_ HWND)
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 SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
struct tagNMHDR * LPNMHDR
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
HWND WINAPI GetParent(_In_ HWND)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define MAKEINTRESOURCEW(i)
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define SetWindowLongPtrW
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
int WINAPI GetSystemMetrics(_In_ int)
#define SW_SHOWMINNOACTIVE
BOOL WINAPI BringWindowToTop(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HMENU WINAPI GetMenu(_In_ HWND)
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
struct tagMENUITEMINFOW MENUITEMINFOW
HDWP WINAPI BeginDeferWindowPos(_In_ int)