ReactOS  0.4.13-dev-39-g8b6696f
progman.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <wingdi.h>
#include <winuser.h>
#include <shellapi.h>
#include <commctrl.h>
#include <richedit.h>
#include <windowsx.h>
#include <strsafe.h>
#include "resource.h"
Include dependency graph for progman.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _PROGRAM
 
struct  _PROGGROUP
 
struct  _GLOBALS
 

Macros

#define WIN32_NO_STATUS
 
#define MAX_STRING_LEN   255
 
#define MAX_PATHNAME_LEN   1024
 
#define MAX_LANGUAGE_NUMBER   (PM_LAST_LANGUAGE - PM_FIRST_LANGUAGE)
 
#define DEFAULTICON   OIC_WINLOGO
 
#define DEF_GROUP_WIN_XPOS   100
 
#define DEF_GROUP_WIN_YPOS   100
 
#define DEF_GROUP_WIN_WIDTH   300
 
#define DEF_GROUP_WIN_HEIGHT   200
 
#define EnableDlgItem(hDlg, nID, bEnable)   EnableWindow(GetDlgItem((hDlg), (nID)), (bEnable))
 
#define STRING_MAIN_WIN_CLASS_NAME   L"PMMain"
 
#define STRING_GROUP_WIN_CLASS_NAME   L"PMGroup"
 

Typedefs

typedef struct _PROGRAM PROGRAM
 
typedef struct _PROGRAMPPROGRAM
 
typedef struct _PROGGROUP PROGGROUP
 
typedef struct _PROGGROUPPPROGGROUP
 
typedef enum _GROUPFORMAT GROUPFORMAT
 
typedef struct _GLOBALS GLOBALS
 
typedef struct _GLOBALSPGLOBALS
 

Enumerations

enum  _GROUPFORMAT { Win_311 = 0x0, NT_Ansi = 0x1, NT_Unicode = 0x2 }
 

Functions

PVOID Alloc (IN DWORD dwFlags, IN SIZE_T dwBytes)
 
BOOL Free (IN PVOID lpMem)
 
PVOID ReAlloc (IN DWORD dwFlags, IN PVOID lpMem, IN SIZE_T dwBytes)
 
PVOID AppendToBuffer (IN PVOID pBuffer, IN PSIZE_T pdwBufferSize, IN PVOID pData, IN SIZE_T dwDataSize)
 
INT MAIN_MessageBoxIDS (UINT ids_text, UINT ids_title, WORD type)
 
INT MAIN_MessageBoxIDS_s (UINT ids_text, LPCWSTR str, UINT ids_title, WORD type)
 
VOID MAIN_ReplaceString (LPWSTR *string, LPWSTR replace)
 
DWORD GRPFILE_ReadGroupFile (LPCWSTR lpszPath, BOOL bIsCommonGroup)
 
BOOL GRPFILE_WriteGroupFile (PROGGROUP *hGroup)
 
ATOM GROUP_RegisterGroupWinClass (VOID)
 
PROGGROUPGROUP_AddGroup (GROUPFORMAT format, BOOL bIsCommonGroup, LPCWSTR lpszName, LPCWSTR lpszGrpFile, INT left, INT top, INT right, INT bottom, INT xMin, INT yMin, INT nCmdShow, WORD cxIcon, WORD cyIcon, BOOL bOverwriteFileOk, BOOL bSuppressShowWindow)
 
VOID GROUP_NewGroup (GROUPFORMAT format, BOOL bIsCommonGroup)
 
VOID GROUP_ModifyGroup (PROGGROUP *hGroup)
 
VOID GROUP_DeleteGroup (PROGGROUP *hGroup)
 
VOID GROUP_ShowGroupWindow (PROGGROUP *hGroup)
 
PROGGROUPGROUP_ActiveGroup (VOID)
 
PROGRAMPROGRAM_AddProgram (PROGGROUP *hGroup, HICON hIcon, LPCWSTR lpszName, INT x, INT y, LPCWSTR lpszCmdLine, LPCWSTR lpszIconFile, INT nIconIndex, LPCWSTR lpszWorkDir, INT nHotKey, INT nCmdShow, BOOL bNewVDM)
 
VOID PROGRAM_NewProgram (PROGGROUP *hGroup)
 
VOID PROGRAM_ModifyProgram (PROGRAM *hProgram)
 
VOID PROGRAM_CopyMoveProgram (PROGRAM *hProgram, BOOL bMove)
 
VOID PROGRAM_DeleteProgram (PROGRAM *hProgram, BOOL bUpdateGrpFile)
 
VOID PROGRAM_ExecuteProgram (PROGRAM *hProgram)
 
PROGRAMPROGRAM_ActiveProgram (PROGGROUP *hGroup)
 
BOOL DIALOG_New (INT nDefault, PINT pnResult)
 
PROGGROUPDIALOG_CopyMove (PROGRAM *hProgram, BOOL bMove)
 
BOOL DIALOG_Delete (UINT ids_text_s, LPCWSTR lpszName)
 
BOOL DIALOG_GroupAttributes (GROUPFORMAT format, LPWSTR lpszTitle, LPWSTR lpszGrpFile, INT nSize)
 
BOOL DIALOG_ProgramAttributes (LPWSTR lpszTitle, LPWSTR lpszCmdLine, LPWSTR lpszWorkDir, LPWSTR lpszIconFile, HICON *lphIcon, INT *lpnIconIndex, INT *lpnHotKey, INT *lpnCmdShow, BOOL *lpbNewVDM, INT nSize)
 
VOID DIALOG_Execute (VOID)
 
VOID STRING_LoadStrings (VOID)
 
VOID STRING_LoadMenus (VOID)
 

Variables

GLOBALS Globals
 
WCHAR szTitle [256]
 

Macro Definition Documentation

◆ DEF_GROUP_WIN_HEIGHT

#define DEF_GROUP_WIN_HEIGHT   200

Definition at line 65 of file progman.h.

◆ DEF_GROUP_WIN_WIDTH

#define DEF_GROUP_WIN_WIDTH   300

Definition at line 64 of file progman.h.

◆ DEF_GROUP_WIN_XPOS

#define DEF_GROUP_WIN_XPOS   100

Definition at line 62 of file progman.h.

◆ DEF_GROUP_WIN_YPOS

#define DEF_GROUP_WIN_YPOS   100

Definition at line 63 of file progman.h.

◆ DEFAULTICON

#define DEFAULTICON   OIC_WINLOGO

Definition at line 60 of file progman.h.

◆ EnableDlgItem

#define EnableDlgItem (   hDlg,
  nID,
  bEnable 
)    EnableWindow(GetDlgItem((hDlg), (nID)), (bEnable))

Definition at line 71 of file progman.h.

◆ MAX_LANGUAGE_NUMBER

#define MAX_LANGUAGE_NUMBER   (PM_LAST_LANGUAGE - PM_FIRST_LANGUAGE)

Definition at line 55 of file progman.h.

◆ MAX_PATHNAME_LEN

#define MAX_PATHNAME_LEN   1024

Definition at line 54 of file progman.h.

◆ MAX_STRING_LEN

#define MAX_STRING_LEN   255

Definition at line 53 of file progman.h.

◆ STRING_GROUP_WIN_CLASS_NAME

#define STRING_GROUP_WIN_CLASS_NAME   L"PMGroup"

Definition at line 252 of file progman.h.

◆ STRING_MAIN_WIN_CLASS_NAME

#define STRING_MAIN_WIN_CLASS_NAME   L"PMMain"

Definition at line 251 of file progman.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 38 of file progman.h.

Typedef Documentation

◆ GLOBALS

◆ GROUPFORMAT

◆ PGLOBALS

◆ PPROGGROUP

Definition at line 79 of file progman.h.

◆ PPROGRAM

Definition at line 78 of file progman.h.

◆ PROGGROUP

Definition at line 79 of file progman.h.

◆ PROGRAM

Definition at line 78 of file progman.h.

Enumeration Type Documentation

◆ _GROUPFORMAT

Enumerator
Win_311 
NT_Ansi 
NT_Unicode 

Definition at line 105 of file progman.h.

106 {
107  Win_311 = 0x0,
108  NT_Ansi = 0x1, // 0x02
109  NT_Unicode = 0x2, // 0x03
110 } GROUPFORMAT;
enum _GROUPFORMAT GROUPFORMAT

Function Documentation

◆ Alloc()

PVOID Alloc ( IN DWORD  dwFlags,
IN SIZE_T  dwBytes 
)

Definition at line 63 of file main.c.

65 {
66  return HeapAlloc(GetProcessHeap(), dwFlags, dwBytes);
67 }
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

Referenced by AppendToBuffer(), COMBOEX_Create(), COMBOEX_DrawItem(), COMBOEX_GetText(), COMBOEX_InsertItemA(), COMBOEX_InsertItemW(), COMBOEX_NotifyItem(), COMBOEX_SetItemA(), COMBOEX_SetItemW(), CompareFileName(), create_taskdialog_template(), CreatePropertySheetPageA(), CreatePropertySheetPageW(), DATETIME_Create(), DATETIME_SetFormatA(), DPA_CreateEx(), DrawStatusTextA(), DSA_Create(), Ext2MapExtent(), GetUserAndDomainName(), GROUP_AddGroup(), heap_strdupAtoW(), heap_strdupW(), InitFunctionPtrs(), LISTVIEW_EndEditLabelT(), LISTVIEW_InsertColumnT(), LISTVIEW_InsertItemT(), LISTVIEW_NCCreate(), load_string(), MAIN_LoadSettings(), MAIN_ReplaceString(), MAIN_SetMainWindowTitle(), MakeDragList(), NATIVEFONT_Create(), notify_dispinfoT(), PROGRAM_AddProgram(), PropertySheetA(), PropertySheetW(), PROPSHEET_CollectSheetInfoA(), PROPSHEET_CreateDialog(), PROPSHEET_CreatePage(), PROPSHEET_DialogProc(), PROPSHEET_InsertPage(), PROPSHEET_RemovePage(), PROPSHEET_SetTitleW(), ranges_add(), ranges_clone(), ranges_create(), ranges_del(), REBAR_InsertBandT(), REBAR_NCCreate(), set_sub_item(), SetWindowSubclass(), STATUSBAR_SetParts(), STATUSBAR_SetTextT(), STATUSBAR_WMCreate(), STATUSBAR_WMSetText(), SYSLINK_AppendDocItem(), SYSLINK_ParseText(), SYSLINK_SetItem(), SysLinkWindowProc(), TAB_Create(), TAB_InsertItemT(), taskdialog_add_buttons(), taskdialog_add_control(), textdupTtoW(), TOOLBAR_Cust_AddButton(), TOOLBAR_CustomizeDialogProc(), TOOLBAR_DeleteButton(), TOOLBAR_InsertImageList(), TOOLBAR_NCCreate(), TOOLBAR_Restore(), TOOLBAR_Save(), TOOLBAR_SaveRestoreA(), TOOLBAR_TTGetDispInfo(), TOOLTIPS_AddToolT(), TOOLTIPS_Create(), TOOLTIPS_DelToolT(), TOOLTIPS_SetTitleT(), TOOLTIPS_SetToolInfoT(), TOOLTIPS_UpdateTipTextT(), TRACKBAR_Create(), UDFBuildLongAllocDescs(), UDFBuildShortAllocDescs(), and ValidateEditContents().

◆ AppendToBuffer()

PVOID AppendToBuffer ( IN PVOID  pBuffer,
IN PSIZE_T  pdwBufferSize,
IN PVOID  pData,
IN SIZE_T  dwDataSize 
)

Definition at line 84 of file main.c.

88 {
89  PVOID pTmp;
90  SIZE_T dwBufferSize;
91 
92  dwBufferSize = dwDataSize + *pdwBufferSize;
93 
94  if (pBuffer)
95  pTmp = ReAlloc(0, pBuffer, dwBufferSize);
96  else
97  pTmp = Alloc(0, dwBufferSize);
98 
99  if (!pTmp)
100  return NULL;
101 
102  memcpy((PVOID)((ULONG_PTR)pTmp + *pdwBufferSize), pData, dwDataSize);
103  *pdwBufferSize = dwBufferSize;
104 
105  return pTmp;
106 }
uint32_t ULONG_PTR
Definition: typedefs.h:63
smooth NULL
Definition: ftsmooth.c:416
PVOID pBuffer
PVOID ReAlloc(IN DWORD dwFlags, IN PVOID lpMem, IN SIZE_T dwBytes)
Definition: main.c:76
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
ULONG_PTR SIZE_T
Definition: typedefs.h:78
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827

◆ DIALOG_CopyMove()

PROGGROUP* DIALOG_CopyMove ( PROGRAM hProgram,
BOOL  bMove 
)

Definition at line 343 of file dialog.c.

344 {
345  COPY_MOVE_CONTEXT CopyMove;
346  INT_PTR ret;
347 
348  CopyMove.bMove = bMove;
349  CopyMove.Program = hProgram;
350  CopyMove.hToGroup = NULL;
352 
353  return (ret == IDOK ? CopyMove.hToGroup : NULL);
354 }
PROGGROUP * hToGroup
Definition: dialog.c:258
#define IDOK
Definition: winuser.h:824
static INT_PTR CALLBACK DIALOG_COPY_MOVE_DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:265
int32_t INT_PTR
Definition: typedefs.h:62
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
PROGRAM * Program
Definition: dialog.c:257
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define IDD_COPY_MOVE
Definition: resource.h:108
int ret
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HINSTANCE hInstance
Definition: precomp.h:43
INT_PTR WINAPI DialogBoxParamW(HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
Definition: dialog.c:1858

Referenced by PROGRAM_CopyMoveProgram().

◆ DIALOG_Delete()

BOOL DIALOG_Delete ( UINT  ids_text_s,
LPCWSTR  lpszName 
)

Definition at line 361 of file dialog.c.

362 {
363  return (MAIN_MessageBoxIDS_s(ids_text_s, lpszName, IDS_DELETE, MB_YESNO | MB_DEFBUTTON2) == IDYES);
364 }
#define IDYES
Definition: winuser.h:829
#define MB_YESNO
Definition: winuser.h:811
INT MAIN_MessageBoxIDS_s(UINT ids_text, LPCWSTR str, UINT ids_title, WORD type)
Definition: main.c:1174
#define MB_DEFBUTTON2
Definition: winuser.h:793
#define IDS_DELETE
Definition: resource.h:40

Referenced by MAIN_MenuCommand().

◆ DIALOG_Execute()

VOID DIALOG_Execute ( VOID  )

Definition at line 1021 of file dialog.c.

1022 {
1023  EXECUTE_CONTEXT ExecuteContext;
1024  LONG lRet;
1025  DWORD dwSize;
1026  DWORD dwType;
1027 
1028  ExecuteContext.hKeyPMRecentFilesList = NULL;
1029  ExecuteContext.bCheckBinaryType = TRUE;
1030 
1031  lRet = RegCreateKeyExW(Globals.hKeyProgMan,
1032  L"Recent File List",
1033  0,
1034  NULL,
1035  0,
1036  KEY_READ | KEY_WRITE,
1037  NULL,
1038  &ExecuteContext.hKeyPMRecentFilesList,
1039  NULL);
1040  if (lRet == ERROR_SUCCESS)
1041  {
1042  dwSize = sizeof(ExecuteContext.dwMaxFiles);
1043  lRet = RegQueryValueExW(ExecuteContext.hKeyPMRecentFilesList,
1044  L"Max Files",
1045  NULL,
1046  &dwType,
1047  (LPBYTE)&ExecuteContext.dwMaxFiles,
1048  &dwSize);
1049  if (lRet != ERROR_SUCCESS || dwType != REG_DWORD)
1050  {
1051  ExecuteContext.dwMaxFiles = 4;
1052  dwSize = sizeof(ExecuteContext.dwMaxFiles);
1053  lRet = RegSetValueExW(ExecuteContext.hKeyPMRecentFilesList,
1054  L"Max Files",
1055  0,
1056  REG_DWORD,
1057  (LPBYTE)&ExecuteContext.dwMaxFiles,
1058  sizeof(ExecuteContext.dwMaxFiles));
1059  }
1060 
1061  dwSize = sizeof(ExecuteContext.bCheckBinaryType);
1062  lRet = RegQueryValueExW(Globals.hKeyPMSettings,
1063  L"CheckBinaryType",
1064  NULL,
1065  &dwType,
1066  (LPBYTE)&ExecuteContext.bCheckBinaryType,
1067  &dwSize);
1068  if (lRet != ERROR_SUCCESS || dwType != REG_DWORD)
1069  {
1070  ExecuteContext.bCheckBinaryType = TRUE;
1071  }
1072  }
1073 
1075 
1076  if (ExecuteContext.hKeyPMRecentFilesList)
1077  RegCloseKey(ExecuteContext.hKeyPMRecentFilesList);
1078 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1094
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
long LONG
Definition: pedump.c:60
#define IDD_EXECUTE
Definition: resource.h:112
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define KEY_WRITE
Definition: nt_native.h:1031
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4917
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
BOOL bCheckBinaryType
Definition: dialog.c:919
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
static INT_PTR CALLBACK DIALOG_EXECUTE_DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:925
DWORD dwMaxFiles
Definition: dialog.c:918
HKEY hKeyPMRecentFilesList
Definition: dialog.c:917
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HINSTANCE hInstance
Definition: precomp.h:43
#define REG_DWORD
Definition: sdbapi.c:596
INT_PTR WINAPI DialogBoxParamW(HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
Definition: dialog.c:1858
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by MAIN_MenuCommand().

◆ DIALOG_GroupAttributes()

BOOL DIALOG_GroupAttributes ( GROUPFORMAT  format,
LPWSTR  lpszTitle,
LPWSTR  lpszGrpFile,
INT  nSize 
)

Definition at line 484 of file dialog.c.

485 {
486  INT_PTR ret;
487  GROUP_ATTRIBUTES_CONTEXT GroupAttributes;
488 
489  GroupAttributes.format = format;
490  GroupAttributes.nSize = nSize;
491  GroupAttributes.lpszTitle = lpszTitle;
492  GroupAttributes.lpszGrpFile = lpszGrpFile;
493 
495 
496  return (ret == IDOK);
497 }
#define IDD_GROUP
Definition: resource.h:109
#define IDOK
Definition: winuser.h:824
*nSize LPSTR _Inout_ LPDWORD nSize
Definition: winbase.h:2024
int32_t INT_PTR
Definition: typedefs.h:62
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
GROUPFORMAT format
Definition: dialog.c:405
LONG_PTR LPARAM
Definition: windef.h:208
int ret
static INT_PTR CALLBACK DIALOG_GROUP_DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:414
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HINSTANCE hInstance
Definition: precomp.h:43
INT_PTR WINAPI DialogBoxParamW(HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
Definition: dialog.c:1858

Referenced by GROUP_ModifyGroup(), and GROUP_NewGroup().

◆ DIALOG_New()

BOOL DIALOG_New ( INT  nDefault,
PINT  pnResult 
)

Definition at line 233 of file dialog.c.

234 {
235  INT_PTR ret;
236  NEW_ITEM_CONTEXT NewItem;
237 
238  *pnResult = 0;
239 
240  NewItem.nDefault = nDefault;
241  NewItem.nResult = 0;
243  if (ret == IDOK)
244  *pnResult = NewItem.nResult;
245 
246  return (ret == IDOK);
247 }
static INT_PTR CALLBACK DIALOG_NEW_DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:149
#define IDOK
Definition: winuser.h:824
int32_t INT_PTR
Definition: typedefs.h:62
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
LONG_PTR LPARAM
Definition: windef.h:208
#define IDD_NEW
Definition: resource.h:107
int ret
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HINSTANCE hInstance
Definition: precomp.h:43
INT_PTR WINAPI DialogBoxParamW(HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
Definition: dialog.c:1858

Referenced by MAIN_MenuCommand().

◆ DIALOG_ProgramAttributes()

BOOL DIALOG_ProgramAttributes ( LPWSTR  lpszTitle,
LPWSTR  lpszCmdLine,
LPWSTR  lpszWorkDir,
LPWSTR  lpszIconFile,
HICON lphIcon,
INT lpnIconIndex,
INT lpnHotKey,
INT lpnCmdShow,
BOOL lpbNewVDM,
INT  nSize 
)

Definition at line 864 of file dialog.c.

866 {
867  INT_PTR ret;
868  WCHAR szTmpIconFile[MAX_PATHNAME_LEN];
869  PROGRAM_ATTRIBUTES_CONTEXT ProgramAttributes;
870  DWORD dwSize;
871  DWORD dwType;
872 
873  ProgramAttributes.nSize = nSize;
874  ProgramAttributes.lpszTitle = lpszTitle;
875  ProgramAttributes.lpszCmdLine = lpszCmdLine;
876  ProgramAttributes.lpszWorkDir = lpszWorkDir;
877  ProgramAttributes.lpszIconFile = lpszIconFile;
878  ProgramAttributes.lpnCmdShow = lpnCmdShow;
879  ProgramAttributes.lpnHotKey = lpnHotKey;
880  ProgramAttributes.lpbNewVDM = lpbNewVDM;
881  ProgramAttributes.lphIcon = lphIcon;
882  ProgramAttributes.lpnIconIndex = lpnIconIndex;
883 
884  dwSize = sizeof(ProgramAttributes.bCheckBinaryType);
885  if (RegQueryValueExW(Globals.hKeyPMSettings,
886  L"CheckBinaryType",
887  0,
888  &dwType,
889  (LPBYTE)&ProgramAttributes.bCheckBinaryType,
890  &dwSize) != ERROR_SUCCESS
891  || dwType != REG_DWORD)
892  {
893  ProgramAttributes.bCheckBinaryType = TRUE;
894  }
895 
896 #if 0
897  ProgramAttributes.hTmpIcon = NULL;
898 #else
899  ProgramAttributes.hTmpIcon = *lphIcon;
900 #endif
901  ProgramAttributes.nTmpIconIndex = *lpnIconIndex;
902  ProgramAttributes.lpszTmpIconFile = szTmpIconFile;
903  wcsncpy(szTmpIconFile, lpszIconFile, ARRAYSIZE(szTmpIconFile));
904 
906  return (ret == IDOK);
907 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define ERROR_SUCCESS
Definition: deptool.c:10
*nSize LPSTR _Inout_ LPDWORD nSize
Definition: winbase.h:2024
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
int32_t INT_PTR
Definition: typedefs.h:62
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define MAX_PATHNAME_LEN
Definition: progman.h:54
static INT_PTR CALLBACK DIALOG_PROGRAM_DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:723
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static const WCHAR L[]
Definition: oid.c:1250
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HINSTANCE hInstance
Definition: precomp.h:43
#define REG_DWORD
Definition: sdbapi.c:596
INT_PTR WINAPI DialogBoxParamW(HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
Definition: dialog.c:1858
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define IDD_PROGRAM
Definition: resource.h:110

Referenced by PROGRAM_ModifyProgram(), and PROGRAM_NewProgram().

◆ Free()

BOOL Free ( IN PVOID  lpMem)

Definition at line 70 of file main.c.

71 {
72  return HeapFree(GetProcessHeap(), 0, lpMem);
73 }
#define GetProcessHeap()
Definition: compat.h:395
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by GetUserAndDomainName(), MAIN_LoadSettings(), and MAIN_SetMainWindowTitle().

◆ GROUP_ActiveGroup()

PROGGROUP* GROUP_ActiveGroup ( VOID  )

Definition at line 671 of file group.c.

672 {
673  return Globals.hActiveGroup;
674 }
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13

Referenced by DIALOG_NEW_DlgProc(), MAIN_MainWndProc(), and MAIN_MenuCommand().

◆ GROUP_AddGroup()

PROGGROUP* GROUP_AddGroup ( GROUPFORMAT  format,
BOOL  bIsCommonGroup,
LPCWSTR  lpszName,
LPCWSTR  lpszGrpFile,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  xMin,
INT  yMin,
INT  nCmdShow,
WORD  cxIcon,
WORD  cyIcon,
BOOL  bOverwriteFileOk,
BOOL  bSuppressShowWindow 
)

Definition at line 435 of file group.c.

440 {
441  PROGGROUP* hGroup;
442  PROGGROUP* hPrior;
443  PROGGROUP** p;
444  LPWSTR hName;
445  LPWSTR hGrpFile;
446  LPCWSTR GroupFileName;
447  INT skip;
448  INT width;
449  INT height;
450  INT seqnum;
452  WINDOWPLACEMENT WndPl;
453 
454  WndPl.length = sizeof(WndPl);
455 
456  // FIXME: Use system default position in case we don't place the window at a given (x,y) coordinate.
457 
458  if (bIsCommonGroup)
459  {
460  if (swscanf(lpszGrpFile,
461  L"%d %d %d %d %d %d %d %n",
462  &WndPl.rcNormalPosition.left,
463  &WndPl.rcNormalPosition.top,
464  &WndPl.rcNormalPosition.right,
465  &WndPl.rcNormalPosition.bottom,
466  &WndPl.ptMinPosition.x,
467  &WndPl.ptMinPosition.y,
468  &WndPl.showCmd,
469  &skip) == 7)
470  {
471  WndPl.flags = WPF_SETMINPOSITION;
474  GroupFileName = &lpszGrpFile[skip];
475  }
476  else
477  {
478 #if 0 // FIXME!
481  WndPl.rcNormalPosition.right = 0;
482  WndPl.rcNormalPosition.bottom = 0;
485  WndPl.showCmd = SW_SHOWNORMAL;
486  GroupFileName = lpszGrpFile;
487 #else
488  WndPl.flags = WPF_SETMINPOSITION;
489  WndPl.ptMinPosition.x = xMin;
490  WndPl.ptMinPosition.y = yMin;
491  WndPl.rcNormalPosition.left = left;
492  WndPl.rcNormalPosition.top = top;
493  WndPl.rcNormalPosition.right = right;
495  width = right - left;
496  height = bottom - top;
497  WndPl.showCmd = nCmdShow;
498  GroupFileName = lpszGrpFile;
499 #endif
500  }
501  }
502  else
503  {
504  WndPl.flags = WPF_SETMINPOSITION;
505  WndPl.ptMinPosition.x = xMin;
506  WndPl.ptMinPosition.y = yMin;
507  WndPl.rcNormalPosition.left = left;
508  WndPl.rcNormalPosition.top = top;
509  WndPl.rcNormalPosition.right = right;
511  width = right - left;
512  height = bottom - top;
513  WndPl.showCmd = nCmdShow;
514  GroupFileName = lpszGrpFile;
515  }
516 
517  hGroup = Alloc(HEAP_ZERO_MEMORY, sizeof(*hGroup));
518  hName = Alloc(HEAP_ZERO_MEMORY, (wcslen(lpszName) + 1) * sizeof(WCHAR));
519  hGrpFile = Alloc(HEAP_ZERO_MEMORY, (wcslen(GroupFileName) + 1) * sizeof(WCHAR));
520  if (!hGroup || !hName || !hGrpFile)
521  {
523  if (hGroup) Free(hGroup);
524  if (hName) Free(hName);
525  if (hGrpFile) Free(hGrpFile);
526  return NULL;
527  }
528  memcpy(hName , lpszName , (wcslen(lpszName) + 1) * sizeof(WCHAR));
529  memcpy(hGrpFile, GroupFileName, (wcslen(GroupFileName) + 1) * sizeof(WCHAR));
530 
531  Globals.hActiveGroup = hGroup;
532 
533  seqnum = 1;
534  hPrior = NULL;
535  for (p = &Globals.hGroups; *p; p = &hPrior->hNext)
536  {
537  hPrior = *p;
538  if (hPrior->seqnum >= seqnum)
539  seqnum = hPrior->seqnum + 1;
540  }
541  *p = hGroup;
542 
543  hGroup->hPrior = hPrior;
544  hGroup->hNext = NULL;
545  hGroup->format = format;
546  hGroup->bIsCommonGroup = bIsCommonGroup;
547  hGroup->hName = hName;
548  hGroup->hGrpFile = hGrpFile;
549  hGroup->bOverwriteFileOk = bOverwriteFileOk;
550  hGroup->seqnum = seqnum;
551  hGroup->nCmdShow = nCmdShow;
552 #if 0
553  hGroup->x = x;
554  hGroup->y = y;
555  hGroup->width = width;
556  hGroup->height = height;
557 #endif
558  hGroup->iconx = cxIcon;
559  hGroup->icony = cyIcon;
560  hGroup->hPrograms = NULL;
561  hGroup->hActiveProgram = NULL;
562  hGroup->TagsSize = 0;
563  hGroup->Tags = NULL;
564 
566  mcs.szTitle = lpszName;
567  mcs.hOwner = NULL;
568  mcs.x = WndPl.rcNormalPosition.left;
569  mcs.y = WndPl.rcNormalPosition.top;
570  mcs.cx = width;
571  mcs.cy = height;
572  mcs.style = 0;
573  mcs.lParam = (LPARAM)hGroup;
574 
575  hGroup->hWnd = (HWND)SendMessageW(Globals.hMDIWnd, WM_MDICREATE, 0, (LPARAM)&mcs);
576 
577  SetWindowPlacement(hGroup->hWnd, &WndPl);
578 
579 #if 1
580  if (!bSuppressShowWindow) /* FIXME shouldn't be necessary */
581 #endif
582  UpdateWindow(hGroup->hWnd);
583 
584  return hGroup;
585 }
GLint GLint GLsizei width
Definition: gl.h:1546
long y
Definition: polytest.cpp:48
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
long x
Definition: polytest.cpp:48
INT seqnum
Definition: progman.h:130
INT icony
Definition: progman.h:137
INT height
Definition: progman.h:135
PROGGROUP * hPrior
Definition: progman.h:114
INT iconx
Definition: progman.h:136
BOOL WINAPI UpdateWindow(_In_ HWND)
LONG top
Definition: windef.h:292
HANDLE HWND
Definition: compat.h:13
HWND hWnd
Definition: progman.h:116
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define IDS_OUT_OF_MEMORY
Definition: resource.h:63
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
LPWSTR hGrpFile
Definition: progman.h:129
BOOL WINAPI SetWindowPlacement(_In_ HWND hWnd, _In_ const WINDOWPLACEMENT *)
int32_t INT
Definition: typedefs.h:56
GROUPFORMAT format
Definition: progman.h:125
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:656
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
SIZE_T TagsSize
Definition: progman.h:142
LPWSTR hName
Definition: progman.h:138
#define CW_USEDEFAULT
Definition: winuser.h:225
PROGGROUP * hNext
Definition: progman.h:115
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
GLint GLint bottom
Definition: glext.h:7726
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define WPF_SETMINPOSITION
Definition: winuser.h:2487
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
static const WCHAR L[]
Definition: oid.c:1250
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
INT width
Definition: progman.h:134
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
POINT ptMinPosition
Definition: winuser.h:3235
#define SW_SHOWNORMAL
Definition: winuser.h:764
PROGRAM * hActiveProgram
Definition: progman.h:140
#define STRING_GROUP_WIN_CLASS_NAME
Definition: progman.h:252
INT nCmdShow
Definition: progman.h:131
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define skip(...)
Definition: CString.cpp:57
#define MB_OK
Definition: winuser.h:784
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define WM_MDICREATE
Definition: winuser.h:1788
RECT rcNormalPosition
Definition: winuser.h:3237
#define IDS_ERROR
Definition: resource.h:18
static struct myctx * mcs
Definition: adnstest.c:53
BOOL bIsCommonGroup
Definition: progman.h:126
LONG bottom
Definition: windef.h:294
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
PVOID Tags
Definition: progman.h:143
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOL bOverwriteFileOk
Definition: progman.h:128
PROGRAM * hPrograms
Definition: progman.h:139
_Check_return_ _CRTIMP int __cdecl swscanf(_In_z_ const wchar_t *_Src, _In_z_ _Scanf_format_string_ const wchar_t *_Format,...)
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
INT MAIN_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type)
Definition: main.c:1159

Referenced by GROUP_NewGroup().

◆ GROUP_DeleteGroup()

VOID GROUP_DeleteGroup ( PROGGROUP hGroup)

Definition at line 627 of file group.c.

628 {
629  if (Globals.hActiveGroup == hGroup)
630  Globals.hActiveGroup = NULL;
631 
632  if (hGroup->hPrior)
633  hGroup->hPrior->hNext = hGroup->hNext;
634  else
635  Globals.hGroups = hGroup->hNext;
636 
637  if (hGroup->hNext)
638  hGroup->hNext->hPrior = hGroup->hPrior;
639 
640  while (hGroup->hPrograms)
642 
643  /* FIXME Update progman.ini */
644 
645  SendMessageW(Globals.hMDIWnd, WM_MDIDESTROY, (WPARAM)hGroup->hWnd, 0);
646 
647  if (hGroup->Tags)
648  Free(hGroup->Tags);
649  Free(hGroup->hName);
650  Free(hGroup->hGrpFile);
651  Free(hGroup);
652 }
PROGGROUP * hPrior
Definition: progman.h:114
HWND hWnd
Definition: progman.h:116
UINT_PTR WPARAM
Definition: windef.h:207
LPWSTR hGrpFile
Definition: progman.h:129
VOID PROGRAM_DeleteProgram(PROGRAM *hProgram, BOOL bUpdateGrpFile)
Definition: program.c:289
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:656
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
LPWSTR hName
Definition: progman.h:138
PROGGROUP * hNext
Definition: progman.h:115
smooth NULL
Definition: ftsmooth.c:416
#define WM_MDIDESTROY
Definition: winuser.h:1789
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
PVOID Tags
Definition: progman.h:143
PROGRAM * hPrograms
Definition: progman.h:139

Referenced by MAIN_MenuCommand().

◆ GROUP_ModifyGroup()

VOID GROUP_ModifyGroup ( PROGGROUP hGroup)

Definition at line 596 of file group.c.

597 {
598  WCHAR Dest[MAX_PATHNAME_LEN]; // szName
599  WCHAR szGrpFile[MAX_PATHNAME_LEN]; // szFile
600 
601  wcsncpy(Dest, hGroup->hName, ARRAYSIZE(Dest));
602  wcsncpy(szGrpFile, hGroup->hGrpFile, ARRAYSIZE(szGrpFile));
603 
604  if (!DIALOG_GroupAttributes(hGroup->format, Dest, szGrpFile, MAX_PATHNAME_LEN))
605  return;
606 
607  if (wcscmp(szGrpFile, hGroup->hGrpFile))
608  hGroup->bOverwriteFileOk = FALSE;
609 
610  MAIN_ReplaceString(&hGroup->hName, Dest);
611  MAIN_ReplaceString(&hGroup->hGrpFile, szGrpFile);
612 
613  GRPFILE_WriteGroupFile(hGroup);
614 
615  /* FIXME Delete old GrpFile if GrpFile changed */
616 
617  /* FIXME Update progman.ini */
618 
619  SetWindowTextW(hGroup->hWnd, Dest);
620 }
BOOL DIALOG_GroupAttributes(GROUPFORMAT format, LPWSTR lpszTitle, LPWSTR lpszGrpFile, INT nSize)
Definition: dialog.c:484
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
HWND hWnd
Definition: progman.h:116
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
LPWSTR hGrpFile
Definition: progman.h:129
GROUPFORMAT format
Definition: progman.h:125
LPWSTR hName
Definition: progman.h:138
BOOL GRPFILE_WriteGroupFile(PROGGROUP *hGroup)
Definition: grpfile.c:358
#define MAX_PATHNAME_LEN
Definition: progman.h:54
__wchar_t WCHAR
Definition: xmlstorage.h:180
VOID MAIN_ReplaceString(LPWSTR *string, LPWSTR replace)
Definition: main.c:1192
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
BOOL bOverwriteFileOk
Definition: progman.h:128

Referenced by MAIN_MenuCommand().

◆ GROUP_NewGroup()

VOID GROUP_NewGroup ( GROUPFORMAT  format,
BOOL  bIsCommonGroup 
)

Definition at line 392 of file group.c.

393 {
394  HANDLE hFile;
395  WCHAR szGrpFile[MAX_PATHNAME_LEN] = L"";
397 
398  // ZeroMemory(szTitle, sizeof(szTitle));
399  // ZeroMemory(szGrpFile, sizeof(szGrpFile));
400 
402  return;
403 
404  /*
405  * Just check whether the group file does exist. If it does, close the handle, because GRPFILE_ReadGroupFile will
406  * reopen the file for loading. If it doesn't exist, we create a new one.
407  */
410  {
411  /* File doesn't exist */
412  PROGGROUP* hGroup = GROUP_AddGroup(format, bIsCommonGroup, szTitle, szGrpFile,
415  0, 0, SW_SHOWNORMAL, 0, 0, FALSE, FALSE);
416  if (hGroup)
417  GRPFILE_WriteGroupFile(hGroup);
418  }
419  else
420  {
421  /* File exist */
423  GRPFILE_ReadGroupFile(szGrpFile, bIsCommonGroup);
424  }
425 
426  /* FIXME Update progman.ini */
427 }
#define DEF_GROUP_WIN_XPOS
Definition: progman.h:62
BOOL DIALOG_GroupAttributes(GROUPFORMAT format, LPWSTR lpszTitle, LPWSTR lpszGrpFile, INT nSize)
Definition: dialog.c:484
#define CloseHandle
Definition: compat.h:398
#define DEF_GROUP_WIN_YPOS
Definition: progman.h:63
DWORD GRPFILE_ReadGroupFile(LPCWSTR lpszPath, BOOL bIsCommonGroup)
Definition: grpfile.c:65
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define FILE_SHARE_READ
Definition: compat.h:125
PROGGROUP * GROUP_AddGroup(GROUPFORMAT format, BOOL bIsCommonGroup, LPCWSTR lpszName, LPCWSTR lpszGrpFile, INT left, INT top, INT right, INT bottom, INT xMin, INT yMin, INT nCmdShow, WORD cxIcon, WORD cyIcon, BOOL bOverwriteFileOk, BOOL bSuppressShowWindow)
Definition: group.c:435
BOOL GRPFILE_WriteGroupFile(PROGGROUP *hGroup)
Definition: grpfile.c:358
smooth NULL
Definition: ftsmooth.c:416
#define MAX_PATHNAME_LEN
Definition: progman.h:54
#define OPEN_EXISTING
Definition: compat.h:426
#define DEF_GROUP_WIN_HEIGHT
Definition: progman.h:65
__wchar_t WCHAR
Definition: xmlstorage.h:180
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:36
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
static const WCHAR L[]
Definition: oid.c:1250
#define GENERIC_READ
Definition: compat.h:124
_In_ HANDLE hFile
Definition: mswsock.h:90
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define CreateFileW
Definition: compat.h:400
#define DEF_GROUP_WIN_WIDTH
Definition: progman.h:64

Referenced by MAIN_MenuCommand().

◆ GROUP_RegisterGroupWinClass()

ATOM GROUP_RegisterGroupWinClass ( VOID  )

Definition at line 369 of file group.c.

370 {
371  WNDCLASSW wndClass;
372 
373  wndClass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
374  wndClass.lpfnWndProc = GROUP_GroupWndProc;
375  wndClass.cbClsExtra = 0;
376  wndClass.cbWndExtra = sizeof(LONG_PTR);
377  wndClass.hInstance = Globals.hInstance;
380  wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
381  wndClass.lpszMenuName = NULL;
383 
384  return RegisterClassW(&wndClass);
385 }
#define LONG_PTR
Definition: treelist.c:79
UINT style
Definition: winuser.h:3129
LPCWSTR lpszMenuName
Definition: winuser.h:3137
static LRESULT CALLBACK GROUP_GroupWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: group.c:117
#define CS_HREDRAW
Definition: winuser.h:648
int cbClsExtra
Definition: winuser.h:3131
#define COLOR_WINDOW
Definition: winuser.h:908
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
WNDPROC lpfnWndProc
Definition: winuser.h:3130
smooth NULL
Definition: ftsmooth.c:416
LPCWSTR lpszClassName
Definition: winuser.h:3138
#define CS_VREDRAW
Definition: winuser.h:653
int cbWndExtra
Definition: winuser.h:3132
HICON hIcon
Definition: winuser.h:3134
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define CS_DBLCLKS
Definition: winuser.h:646
HCURSOR hCursor
Definition: winuser.h:3135
#define STRING_GROUP_WIN_CLASS_NAME
Definition: progman.h:252
HBRUSH hbrBackground
Definition: winuser.h:3136
HINSTANCE hInstance
Definition: winuser.h:3133
#define IDI_GROUP_ICON
Definition: resource.h:43
#define IDC_ARROW
Definition: winuser.h:682
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HINSTANCE hInstance
Definition: precomp.h:43

Referenced by wWinMain().

◆ GROUP_ShowGroupWindow()

VOID GROUP_ShowGroupWindow ( PROGGROUP hGroup)

Definition at line 660 of file group.c.

661 {
662  ShowWindow(hGroup->hWnd, hGroup->nCmdShow);
663  UpdateWindow(hGroup->hWnd);
664 }
BOOL WINAPI UpdateWindow(_In_ HWND)
HWND hWnd
Definition: progman.h:116
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
INT nCmdShow
Definition: progman.h:131

◆ GRPFILE_ReadGroupFile()

DWORD GRPFILE_ReadGroupFile ( LPCWSTR  lpszPath,
BOOL  bIsCommonGroup 
)

Definition at line 65 of file grpfile.c.

66 {
67 #if 0
68  CHAR szPath_gr[MAX_PATHNAME_LEN];
69  BOOL bFileNameModified = FALSE;
71  HLOCAL hBuffer, hGroup;
72  INT size;
73 
74  /* if `.gr' file exists use that */
75  GRPFILE_ModifyFileName(szPath_gr, lpszPath, MAX_PATHNAME_LEN, TRUE);
76  if (OpenFile(szPath_gr, &dummy, OF_EXIST) != HFILE_ERROR)
77  {
78  lpszPath = szPath_gr;
79  bFileNameModified = TRUE;
80  }
81 
82  /* Read the whole file into a buffer */
83  if (!GRPFILE_ReadFileToBuffer(lpszPath, &hBuffer, &size))
84  {
86  return(0);
87  }
88 
89  /* Interpret buffer */
90  hGroup = GRPFILE_ScanGroup(LocalLock(hBuffer), size,
91  lpszPath, bFileNameModified);
92  if (!hGroup)
94 
95  LocalFree(hBuffer);
96 
97  return(hGroup);
98 
99 #else
100  return ERROR_SUCCESS;
101 #endif
102 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
char CHAR
Definition: xmlstorage.h:175
#define IDS_GRPFILE_READ_ERROR_s
Definition: resource.h:62
int32_t INT
Definition: typedefs.h:56
#define HFILE_ERROR
Definition: winbase.h:111
#define MB_YESNO
Definition: winuser.h:811
unsigned int BOOL
Definition: ntddk_ex.h:94
#define MAX_PATHNAME_LEN
Definition: progman.h:54
HFILE WINAPI OpenFile(LPCSTR lpFileName, LPOFSTRUCT lpReOpenBuff, UINT uStyle)
Definition: create.c:368
GLsizeiptr size
Definition: glext.h:5919
#define OF_EXIST
Definition: winbase.h:127
INT MAIN_MessageBoxIDS_s(UINT ids_text, LPCWSTR str, UINT ids_title, WORD type)
Definition: main.c:1174
unsigned char dummy
Definition: maze.c:118
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
LPVOID NTAPI LocalLock(HLOCAL hMem)
Definition: heapmem.c:1599
#define IDS_ERROR
Definition: resource.h:18

Referenced by GROUP_NewGroup().

◆ GRPFILE_WriteGroupFile()

BOOL GRPFILE_WriteGroupFile ( PROGGROUP hGroup)

Definition at line 358 of file grpfile.c.

359 {
360 #if 0
362  PROGGROUP *group = LocalLock(hGroup);
363  OFSTRUCT dummy;
364  HFILE file;
365  BOOL ret;
366 
367  GRPFILE_ModifyFileName(szPath, LocalLock(group->hGrpFile),
369  group->bFileNameModified);
370 
371  /* Try not to overwrite original files */
372 
373  /* group->bOverwriteFileOk == TRUE only if a file has the modified format */
374  if (!group->bOverwriteFileOk &&
376  {
377  /* Original file exists, try `.gr' extension */
378  GRPFILE_ModifyFileName(szPath, LocalLock(group->hGrpFile),
381  {
382  /* File exists. Do not overwrite */
384  IDS_INFO, MB_OK);
385  return FALSE;
386  }
387  /* Inform about the modified file name */
388  if (IDCANCEL ==
391  return FALSE;
392  }
393 
394  {
395  /* Warn about the (possible) incompatibility */
396  CHAR msg[MAX_PATHNAME_LEN + 200];
397  wsprintfA(msg,
398  "Group files written by this DRAFT Program Manager "
399  "possibly cannot be read by the Microsoft Program Manager!!\n"
400  "Are you sure to write %s?", szPath);
401  if (IDOK != MessageBoxA(Globals.hMainWnd, msg, "WARNING",
402  MB_OKCANCEL | MB_DEFBUTTON2)) return FALSE;
403  }
404 
405  /* Open file */
406  file = _lcreat(szPath, 0);
407  if (file != HFILE_ERROR)
408  {
409  ret = GRPFILE_DoWriteGroupFile(file, group);
410  _lclose(file);
411  }
412  else ret = FALSE;
413 
414  if (!ret)
416 
417  return(ret);
418 
419 #else
420  return TRUE;
421 #endif
422 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
HFILE WINAPI _lcreat(LPCSTR lpPathName, int iAttribute)
Definition: lfile.c:116
char CHAR
Definition: xmlstorage.h:175
#define IDS_SAVE_GROUP_AS_s
Definition: resource.h:67
#define IDS_FILE_WRITE_ERROR_s
Definition: resource.h:61
int WINAPI _lclose(HFILE hFile)
Definition: lfile.c:138
int WINAPI MessageBoxA(_In_opt_ HWND, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_ UINT)
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
#define HFILE_ERROR
Definition: winbase.h:111
unsigned int BOOL
Definition: ntddk_ex.h:94
#define MB_OKCANCEL
Definition: winuser.h:798
#define MAX_PATHNAME_LEN
Definition: progman.h:54
HFILE WINAPI OpenFile(LPCSTR lpFileName, LPOFSTRUCT lpReOpenBuff, UINT uStyle)
Definition: create.c:368
GLboolean GLuint group
Definition: glext.h:11120
const char file[]
Definition: icontest.c:11
#define IDS_FILE_NOT_OVERWRITTEN_s
Definition: resource.h:66
#define MB_ICONINFORMATION
Definition: winuser.h:796
int ret
#define OF_EXIST
Definition: winbase.h:127
int WINAPIV wsprintfA(_Out_ LPSTR, _In_ _Printf_format_string_ LPCSTR,...)
INT MAIN_MessageBoxIDS_s(UINT ids_text, LPCWSTR str, UINT ids_title, WORD type)
Definition: main.c:1174
LPCWSTR szPath
Definition: env.c:35
unsigned char dummy
Definition: maze.c:118
LPVOID NTAPI LocalLock(HLOCAL hMem)
Definition: heapmem.c:1599
#define MB_OK
Definition: winuser.h:784
#define msg(x)
Definition: auth_time.c:54
#define MB_DEFBUTTON2
Definition: winuser.h:793
#define IDS_ERROR
Definition: resource.h:18
#define IDS_INFO
Definition: resource.h:53
#define IDCANCEL
Definition: winuser.h:825
int HFILE
Definition: windef.h:283
Definition: fci.c:126

Referenced by GROUP_ModifyGroup(), GROUP_NewGroup(), PROGRAM_CopyMoveProgram(), PROGRAM_DeleteProgram(), PROGRAM_ModifyProgram(), and PROGRAM_NewProgram().

◆ MAIN_MessageBoxIDS()

INT MAIN_MessageBoxIDS ( UINT  ids_text,
UINT  ids_title,
WORD  type 
)

Definition at line 1159 of file main.c.

1160 {
1163 
1164  LoadStringW(Globals.hInstance, ids_text , text , ARRAYSIZE(text));
1166 
1168 }
NOTEPAD_GLOBALS Globals
Definition: main.c:29
const WCHAR * text
Definition: package.c:1827
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HINSTANCE hInstance
Definition: main.h:55
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_STRING_LEN
Definition: main.c:75
HWND hMainWnd
Definition: main.h:56
static char title[]
Definition: ps.c:92

Referenced by DIALOG_COPY_MOVE_DlgProc(), DIALOG_EXECUTE_DlgProc(), DIALOG_GROUP_DlgProc(), DIALOG_NEW_DlgProc(), DIALOG_PROGRAM_DlgProc(), DIALOG_SYMBOL_DlgProc(), GROUP_AddGroup(), MAIN_MenuCommand(), MAIN_ReplaceString(), and PROGRAM_AddProgram().

◆ MAIN_MessageBoxIDS_s()

INT MAIN_MessageBoxIDS_s ( UINT  ids_text,
LPCWSTR  str,
UINT  ids_title,
WORD  type 
)

Definition at line 1174 of file main.c.

1175 {
1179 
1180  LoadStringW(Globals.hInstance, ids_text , text , ARRAYSIZE(text));
1182  wsprintfW(newtext, text, str);
1183 
1184  return MessageBoxW(Globals.hMainWnd, newtext, title, type);
1185 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
NOTEPAD_GLOBALS Globals
Definition: main.c:29
const WCHAR * text
Definition: package.c:1827
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HINSTANCE hInstance
Definition: main.h:55
const WCHAR * str
#define MAX_PATHNAME_LEN
Definition: progman.h:54
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_STRING_LEN
Definition: main.c:75
HWND hMainWnd
Definition: main.h:56
static char title[]
Definition: ps.c:92

Referenced by DIALOG_Delete(), GRPFILE_ReadGroupFile(), and GRPFILE_WriteGroupFile().

◆ MAIN_ReplaceString()

VOID MAIN_ReplaceString ( LPWSTR string,
LPWSTR  replace 
)

Definition at line 1192 of file main.c.

1193 {
1194  LPWSTR newstring;
1195 
1196  newstring = Alloc(HEAP_ZERO_MEMORY, (wcslen(replace) + 1) * sizeof(WCHAR));
1197  if (newstring)
1198  {
1199  wcscpy(newstring, replace);
1200  *string = newstring;
1201  }
1202  else
1203  {
1205  }
1206 }
#define IDS_OUT_OF_MEMORY
Definition: resource.h:63
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
Definition: replace.c:47
__wchar_t WCHAR
Definition: xmlstorage.h:180
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define MB_OK
Definition: winuser.h:784
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define IDS_ERROR
Definition: resource.h:18
WCHAR * LPWSTR
Definition: xmlstorage.h:184
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
INT MAIN_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type)
Definition: main.c:1159

Referenced by GROUP_ModifyGroup(), and PROGRAM_ModifyProgram().

◆ PROGRAM_ActiveProgram()

PROGRAM* PROGRAM_ActiveProgram ( PROGGROUP hGroup)

Definition at line 331 of file program.c.

332 {
333  if (!hGroup) return NULL;
334  if (IsIconic(hGroup->hWnd)) return NULL;
335  return hGroup->hActiveProgram;
336 }
HWND hWnd
Definition: progman.h:116
BOOL WINAPI IsIconic(_In_ HWND)
smooth NULL
Definition: ftsmooth.c:416
PROGRAM * hActiveProgram
Definition: progman.h:140

Referenced by MAIN_MainWndProc(), and MAIN_MenuCommand().

◆ PROGRAM_AddProgram()

PROGRAM* PROGRAM_AddProgram ( PROGGROUP hGroup,
HICON  hIcon,
LPCWSTR  lpszName,
INT  x,
INT  y,
LPCWSTR  lpszCmdLine,
LPCWSTR  lpszIconFile,
INT  nIconIndex,
LPCWSTR  lpszWorkDir,
INT  nHotKey,
INT  nCmdShow,
BOOL  bNewVDM 
)

Definition at line 157 of file program.c.

160 {
161  PROGRAM* hProgram;
162  PROGRAM* hPrior;
163  PROGRAM** p;
164  LPWSTR hCmdLine;
165  LPWSTR hIconFile;
166  LPWSTR hName;
167  LPWSTR hWorkDir;
168  LVITEMW lvItem;
169  INT iItem;
170 
171  hProgram = Alloc(HEAP_ZERO_MEMORY, sizeof(*hProgram));
172  hName = Alloc(HEAP_ZERO_MEMORY, (wcslen(lpszName) + 1) * sizeof(WCHAR));
173  hCmdLine = Alloc(HEAP_ZERO_MEMORY, (wcslen(lpszCmdLine) + 1) * sizeof(WCHAR));
174  hIconFile = Alloc(HEAP_ZERO_MEMORY, (wcslen(lpszIconFile) + 1) * sizeof(WCHAR));
175  hWorkDir = Alloc(HEAP_ZERO_MEMORY, (wcslen(lpszWorkDir) + 1) * sizeof(WCHAR));
176  if (!hProgram || !hName || !hCmdLine || !hIconFile || !hWorkDir)
177  {
179  if (hProgram) Free(hProgram);
180  if (hName) Free(hName);
181  if (hCmdLine) Free(hCmdLine);
182  if (hIconFile) Free(hIconFile);
183  if (hWorkDir) Free(hWorkDir);
184  return NULL;
185  }
186  memcpy(hName , lpszName , (wcslen(lpszName) + 1) * sizeof(WCHAR));
187  memcpy(hCmdLine , lpszCmdLine , (wcslen(lpszCmdLine) + 1) * sizeof(WCHAR));
188  memcpy(hIconFile, lpszIconFile, (wcslen(lpszIconFile) + 1) * sizeof(WCHAR));
189  memcpy(hWorkDir , lpszWorkDir , (wcslen(lpszWorkDir) + 1) * sizeof(WCHAR));
190 
191  hGroup->hActiveProgram = hProgram;
192 
193  hPrior = NULL;
194  for (p = &hGroup->hPrograms; *p; p = &hPrior->hNext)
195  hPrior = *p;
196  *p = hProgram;
197 
198  hProgram->hGroup = hGroup;
199  hProgram->hPrior = hPrior;
200  hProgram->hNext = NULL;
201  hProgram->hName = hName;
202  hProgram->hCmdLine = hCmdLine;
203  hProgram->hIconFile = hIconFile;
204  hProgram->nIconIndex = nIconIndex;
205  hProgram->hWorkDir = hWorkDir;
206  hProgram->hIcon = hIcon;
207  hProgram->nCmdShow = nCmdShow;
208  hProgram->nHotKey = nHotKey;
209  hProgram->bNewVDM = bNewVDM;
210  hProgram->TagsSize = 0;
211  hProgram->Tags = NULL;
212 
213  ZeroMemory(&lvItem, sizeof(lvItem));
214  lvItem.mask = LVIF_PARAM | LVIF_IMAGE | LVIF_TEXT;
215  lvItem.pszText = (LPWSTR)lpszName;
216  lvItem.lParam = (LPARAM)hProgram;
217  lvItem.iImage = ImageList_ReplaceIcon(hGroup->hListLarge, -1, hIcon);
219 
220  lvItem.iItem = SendMessageA(hGroup->hListView, LVM_GETITEMCOUNT, 0, 0);
221  iItem = SendMessageW(hGroup->hListView, LVM_INSERTITEMW, 0, (LPARAM)&lvItem);
222  hProgram->iItem = iItem;
223  if (x != -1 && y != -1)
225 
226  return hProgram;
227 }
INT WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, INT nIndex, HICON hIcon)
Definition: imagelist.c:2677
int iImage
Definition: commctrl.h:2339
PROGRAM * hNext
Definition: progman.h:85
SIZE_T TagsSize
Definition: progman.h:101
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
LPWSTR hIconFile
Definition: progman.h:95
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MAKELPARAM(l, h)
Definition: winuser.h:3915
#define ZeroMemory
Definition: winbase.h:1635
PVOID Tags
Definition: progman.h:102
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define IDS_OUT_OF_MEMORY
Definition: resource.h:63
int32_t INT
Definition: typedefs.h:56
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:656
#define LVIF_TEXT
Definition: commctrl.h:2281
LPWSTR hCmdLine
Definition: progman.h:94
LPARAM lParam
Definition: commctrl.h:2340
#define LVM_GETITEMCOUNT
Definition: commctrl.h:2278
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
INT iItem
Definition: progman.h:88
LPWSTR hWorkDir
Definition: progman.h:96
#define LVM_SETITEMPOSITION
Definition: commctrl.h:2452
__wchar_t WCHAR
Definition: xmlstorage.h:180
INT nCmdShow
Definition: progman.h:98
LPWSTR pszText
Definition: commctrl.h:2337
#define LVIF_IMAGE
Definition: commctrl.h:2282
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
UINT mask
Definition: commctrl.h:2332
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
INT nHotKey
Definition: progman.h:97
#define LVM_INSERTITEMW
Definition: commctrl.h:2376
PROGRAM * hActiveProgram
Definition: progman.h:140
HWND hListView
Definition: progman.h:118
HICON hIcon
Definition: msconfig.c:44
LPWSTR hName
Definition: progman.h:93
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MB_OK
Definition: winuser.h:784
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define IDS_ERROR
Definition: resource.h:18
PROGGROUP * hGroup
Definition: progman.h:83
#define LVIF_PARAM
Definition: commctrl.h:2283
HIMAGELIST hListLarge
Definition: progman.h:119
HICON hIcon
Definition: progman.h:92
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
INT nIconIndex
Definition: progman.h:91
PROGRAM * hPrograms
Definition: progman.h:139
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
PROGRAM * hPrior
Definition: progman.h:84
BOOL bNewVDM
Definition: progman.h:99
INT MAIN_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type)
Definition: main.c:1159

Referenced by PROGRAM_CopyMoveProgram(), and PROGRAM_NewProgram().

◆ PROGRAM_CopyMoveProgram()

VOID PROGRAM_CopyMoveProgram ( PROGRAM hProgram,
BOOL  bMove 
)

Definition at line 236 of file program.c.

237 {
238  PROGGROUP* hGroup;
239 
240  hGroup = DIALOG_CopyMove(hProgram, bMove);
241  if (!hGroup)
242  return;
243 
244  /* FIXME: shouldn't be necessary */
245  OpenIcon(hGroup->hWnd);
246 
247  if (!PROGRAM_AddProgram(hGroup,
248  hProgram->hIcon,
249  hProgram->hName,
250  hProgram->x,
251  hProgram->y,
252  hProgram->hCmdLine,
253  hProgram->hIconFile,
254  hProgram->nIconIndex,
255  hProgram->hWorkDir,
256  hProgram->nHotKey,
257  hProgram->nCmdShow,
258  hProgram->bNewVDM))
259  {
260  return;
261  }
262 
263  GRPFILE_WriteGroupFile(hGroup);
264 
265  if (bMove)
266  PROGRAM_DeleteProgram(hProgram, TRUE);
267 }
#define TRUE
Definition: types.h:120
LPWSTR hIconFile
Definition: progman.h:95
HWND hWnd
Definition: progman.h:116
LPWSTR hCmdLine
Definition: progman.h:94
BOOL GRPFILE_WriteGroupFile(PROGGROUP *hGroup)
Definition: grpfile.c:358
LPWSTR hWorkDir
Definition: progman.h:96
INT nCmdShow
Definition: progman.h:98
BOOL WINAPI OpenIcon(_In_ HWND)
INT y
Definition: progman.h:90
VOID PROGRAM_DeleteProgram(PROGRAM *hProgram, BOOL bUpdateGrpFile)
Definition: program.c:289
INT nHotKey
Definition: progman.h:97
LPWSTR hName
Definition: progman.h:93
PROGRAM * PROGRAM_AddProgram(PROGGROUP *hGroup, HICON hIcon, LPCWSTR lpszName, INT x, INT y, LPCWSTR lpszCmdLine, LPCWSTR lpszIconFile, INT nIconIndex, LPCWSTR lpszWorkDir, INT nHotKey, INT nCmdShow, BOOL bNewVDM)
Definition: program.c:157
HICON hIcon
Definition: progman.h:92
INT x
Definition: progman.h:89
INT nIconIndex
Definition: progman.h:91
BOOL bNewVDM
Definition: progman.h:99
PROGGROUP * DIALOG_CopyMove(PROGRAM *hProgram, BOOL bMove)
Definition: dialog.c:343

Referenced by MAIN_MenuCommand().

◆ PROGRAM_DeleteProgram()

VOID PROGRAM_DeleteProgram ( PROGRAM hProgram,
BOOL  bUpdateGrpFile 
)

Definition at line 289 of file program.c.

290 {
291  PROGGROUP* group;
292 
293  group = hProgram->hGroup;
294  if (hProgram->hGroup->hActiveProgram == hProgram)
296 
297  SendMessageA(group->hListView, LVM_DELETEITEM, hProgram->iItem, 0);
298 
299  if (hProgram->hPrior)
300  hProgram->hPrior->hNext = hProgram->hNext;
301  else
302  hProgram->hGroup->hPrograms = hProgram->hNext;
303 
304  if (hProgram->hNext)
305  hProgram->hNext->hPrior = hProgram->hPrior;
306 
307  if (bUpdateGrpFile)
308  GRPFILE_WriteGroupFile(hProgram->hGroup);
309 
310 #if 0
311  DestroyWindow(program->hWnd);
312  if (program->hIcon)
313  DestroyIcon(program->hIcon);
314 #endif
315 
316  if (hProgram->Tags)
317  Free(hProgram->Tags);
318  Free(hProgram->hName);
319  Free(hProgram->hCmdLine);
320  Free(hProgram->hIconFile);
321  Free(hProgram->hWorkDir);
322  Free(hProgram);
323 }
PROGRAM * hNext
Definition: progman.h:85
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
LPWSTR hIconFile
Definition: progman.h:95
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
PVOID Tags
Definition: progman.h:102
#define LVM_DELETEITEM
Definition: commctrl.h:2382
BOOL WINAPI DestroyWindow(_In_ HWND)
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:656
LPWSTR hCmdLine
Definition: progman.h:94
BOOL GRPFILE_WriteGroupFile(PROGGROUP *hGroup)
Definition: grpfile.c:358
smooth NULL
Definition: ftsmooth.c:416
INT iItem
Definition: progman.h:88
GLboolean GLuint group
Definition: glext.h:11120
LPWSTR hWorkDir
Definition: progman.h:96
PROGRAM * hActiveProgram
Definition: progman.h:140
GLuint program
Definition: glext.h:6723
LPWSTR hName
Definition: progman.h:93
PROGGROUP * hGroup
Definition: progman.h:83
PROGRAM * hPrograms
Definition: progman.h:139
PROGRAM * hPrior
Definition: progman.h:84

Referenced by GROUP_DeleteGroup(), MAIN_MenuCommand(), and PROGRAM_CopyMoveProgram().

◆ PROGRAM_ExecuteProgram()

VOID PROGRAM_ExecuteProgram ( PROGRAM hProgram)

Definition at line 274 of file program.c.

275 {
276  // TODO: Use a (private?) shell API with which one can use hProgram->bNewVDM
277 
278  ShellExecuteW(NULL, NULL, hProgram->hCmdLine, NULL, hProgram->hWorkDir, hProgram->nCmdShow);
279 
280  if (Globals.bMinOnRun)
282 }
BOOL WINAPI CloseWindow(_In_ HWND)
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
LPWSTR hCmdLine
Definition: progman.h:94
smooth NULL
Definition: ftsmooth.c:416
LPWSTR hWorkDir
Definition: progman.h:96
INT nCmdShow
Definition: progman.h:98
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2236

Referenced by GROUP_GroupWndProc(), MAIN_AutoStart(), and MAIN_MenuCommand().

◆ PROGRAM_ModifyProgram()

VOID PROGRAM_ModifyProgram ( PROGRAM hProgram)

Definition at line 116 of file program.c.

117 {
118  LVITEMW lvItem;
120  WCHAR szWorkDir[MAX_PATHNAME_LEN];
121  WCHAR szCmdLine[MAX_PATHNAME_LEN];
122  WCHAR szIconFile[MAX_PATHNAME_LEN];
123 
124  lstrcpynW(szName , hProgram->hName , ARRAYSIZE(szName));
125  lstrcpynW(szCmdLine , hProgram->hCmdLine , ARRAYSIZE(szCmdLine));
126  lstrcpynW(szIconFile, hProgram->hIconFile, ARRAYSIZE(szIconFile));
127  lstrcpynW(szWorkDir , hProgram->hWorkDir , ARRAYSIZE(szWorkDir));
128 
129  if (!DIALOG_ProgramAttributes(szName, szCmdLine, szWorkDir, szIconFile,
130  &hProgram->hIcon, &hProgram->nIconIndex,
131  &hProgram->nHotKey, &hProgram->nCmdShow,
132  &hProgram->bNewVDM, MAX_PATHNAME_LEN))
133  {
134  return;
135  }
136 
137  MAIN_ReplaceString(&hProgram->hName , szName);
138  MAIN_ReplaceString(&hProgram->hCmdLine , szCmdLine);
139  MAIN_ReplaceString(&hProgram->hIconFile, szIconFile);
140  MAIN_ReplaceString(&hProgram->hWorkDir , szWorkDir);
141 
142  ZeroMemory(&lvItem, sizeof(lvItem));
143  lvItem.mask = LVIF_TEXT;
144  lvItem.iSubItem = 0;
145  lvItem.pszText = szName;
146  SendMessageW(hProgram->hGroup->hListView, LVM_SETITEMTEXTW, hProgram->iItem, (LPARAM)&lvItem);
147 
148  GRPFILE_WriteGroupFile(hProgram->hGroup);
149 }
LPWSTR hIconFile
Definition: progman.h:95
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define ZeroMemory
Definition: winbase.h:1635
#define lstrcpynW
Definition: compat.h:397
#define LVIF_TEXT
Definition: commctrl.h:2281
LPWSTR hCmdLine
Definition: progman.h:94
int iSubItem
Definition: commctrl.h:2334
BOOL GRPFILE_WriteGroupFile(PROGGROUP *hGroup)
Definition: grpfile.c:358
LONG_PTR LPARAM
Definition: windef.h:208
INT iItem
Definition: progman.h:88
#define MAX_PATHNAME_LEN
Definition: progman.h:54
LPWSTR hWorkDir
Definition: progman.h:96
__wchar_t WCHAR
Definition: xmlstorage.h:180
INT nCmdShow
Definition: progman.h:98
LPWSTR pszText
Definition: commctrl.h:2337
UINT mask
Definition: commctrl.h:2332
INT nHotKey
Definition: progman.h:97
VOID MAIN_ReplaceString(LPWSTR *string, LPWSTR replace)
Definition: main.c:1192
#define LVM_SETITEMTEXTW
Definition: commctrl.h:2659
HWND hListView
Definition: progman.h:118
LPWSTR hName
Definition: progman.h:93
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
PROGGROUP * hGroup
Definition: progman.h:83
static const WCHAR szName[]
Definition: msipriv.h:1194
HICON hIcon
Definition: progman.h:92
BOOL DIALOG_ProgramAttributes(LPWSTR lpszTitle, LPWSTR lpszCmdLine, LPWSTR lpszWorkDir, LPWSTR lpszIconFile, HICON *lphIcon, INT *lpnIconIndex, INT *lpnHotKey, INT *lpnCmdShow, BOOL *lpbNewVDM, INT nSize)
Definition: dialog.c:864
INT nIconIndex
Definition: progman.h:91
BOOL bNewVDM
Definition: progman.h:99

Referenced by MAIN_MenuCommand().

◆ PROGRAM_NewProgram()

VOID PROGRAM_NewProgram ( PROGGROUP hGroup)

Definition at line 80 of file program.c.

81 {
82  HICON hIcon = NULL;
83  INT nIconIndex = 0;
84  INT nHotKey = 0;
85  INT nCmdShow = SW_SHOWNORMAL;
86  BOOL bNewVDM = FALSE;
88  WCHAR szCmdLine[MAX_PATHNAME_LEN] = L"";
89  WCHAR szIconFile[MAX_PATHNAME_LEN] = L"";
90  WCHAR szWorkDir[MAX_PATHNAME_LEN] = L"";
91 
92  if (!DIALOG_ProgramAttributes(szTitle, szCmdLine, szWorkDir, szIconFile,
93  &hIcon, &nIconIndex, &nHotKey, &nCmdShow, &bNewVDM,
95  {
96  return;
97  }
98 
99  if (!hIcon)
101 
102  if (!PROGRAM_AddProgram(hGroup, hIcon, szTitle, -1, -1, szCmdLine, szIconFile,
103  nIconIndex, szWorkDir, nHotKey, nCmdShow, bNewVDM))
104  {
105  return;
106  }
107 
108  GRPFILE_WriteGroupFile(hGroup);
109 }
static HICON
Definition: imagelist.c:84
int32_t INT
Definition: typedefs.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL GRPFILE_WriteGroupFile(PROGGROUP *hGroup)
Definition: grpfile.c:358
smooth NULL
Definition: ftsmooth.c:416
#define MAX_PATHNAME_LEN
Definition: progman.h:54
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define IDI_WINLOGO
Definition: winuser.h:704
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:36
static const WCHAR L[]
Definition: oid.c:1250
#define SW_SHOWNORMAL
Definition: winuser.h:764
HICON hIcon
Definition: msconfig.c:44
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
PROGRAM * PROGRAM_AddProgram(PROGGROUP *hGroup, HICON hIcon, LPCWSTR lpszName, INT x, INT y, LPCWSTR lpszCmdLine, LPCWSTR lpszIconFile, INT nIconIndex, LPCWSTR lpszWorkDir, INT nHotKey, INT nCmdShow, BOOL bNewVDM)
Definition: program.c:157
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
BOOL DIALOG_ProgramAttributes(LPWSTR lpszTitle, LPWSTR lpszCmdLine, LPWSTR lpszWorkDir, LPWSTR lpszIconFile, HICON *lphIcon, INT *lpnIconIndex, INT *lpnHotKey, INT *lpnCmdShow, BOOL *lpbNewVDM, INT nSize)
Definition: dialog.c:864

Referenced by MAIN_MenuCommand().

◆ ReAlloc()

PVOID ReAlloc ( IN DWORD  dwFlags,
IN PVOID  lpMem,
IN SIZE_T  dwBytes 
)

Definition at line 76 of file main.c.

79 {
80  return HeapReAlloc(GetProcessHeap(), dwFlags, lpMem, dwBytes);
81 }
#define GetProcessHeap()
Definition: compat.h:395
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define HeapReAlloc
Definition: compat.h:393

Referenced by AppendToBuffer(), DSA_DeleteItem(), DSA_InsertItem(), DSA_SetItem(), InitFunctionPtrs(), Str_SetPtrA(), Str_SetPtrW(), SYSLINK_Render(), TOOLBAR_AddBitmap(), TOOLBAR_AddStringA(), TOOLBAR_AddStringW(), TOOLBAR_InternalInsertButtonsT(), TRACKBAR_RecalculateTics(), and TRACKBAR_SetTic().

◆ STRING_LoadMenus()

VOID STRING_LoadMenus ( VOID  )

Definition at line 41 of file string.c.

42 {
44 
45  /* Create the menu */
47  Globals.hFileMenu = GetSubMenu(hMainMenu, 0);
48  Globals.hOptionMenu = GetSubMenu(hMainMenu, 1);
49  Globals.hWindowsMenu = GetSubMenu(hMainMenu, 2);
50  Globals.hLanguageMenu = GetSubMenu(hMainMenu, 3);
51 
52  if (Globals.hMDIWnd)
53  SendMessageW(Globals.hMDIWnd, WM_MDISETMENU, (WPARAM)hMainMenu, (LPARAM)Globals.hWindowsMenu);
54  else
56 
57  /* Destroy the old menu */
58  if (Globals.hMainMenu)
59  DestroyMenu(Globals.hMainMenu);
60  Globals.hMainMenu = hMainMenu;
61 }
#define MAIN_MENU
Definition: resources.h:12
UINT_PTR WPARAM
Definition: windef.h:207
#define WM_MDISETMENU
Definition: winuser.h:1798
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
HMENU hMainMenu
Definition: mplay32.c:25
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI SetMenu(_In_ HWND, _In_opt_ HMENU)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
BOOL WINAPI DestroyMenu(_In_ HMENU)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HINSTANCE hInstance
Definition: precomp.h:43
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

Referenced by wWinMain().

◆ STRING_LoadStrings()

VOID STRING_LoadStrings ( VOID  )

Definition at line 36 of file string.c.

37 {
39 }
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
WCHAR szTitle[256]
Definition: string.c:34
#define IDS_PROGRAM_MANAGER
Definition: resource.h:50
HINSTANCE hInstance
Definition: precomp.h:43

Referenced by wWinMain().

Variable Documentation

◆ Globals

GLOBALS Globals

Definition at line 13 of file clipbrd.c.

◆ szTitle

WCHAR szTitle[256]

Definition at line 36 of file magnifier.c.