[PROGMAN] Properly import from Wine Staging 1.9.4. This fixes PCH usage, marks ReactO...
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 5 Mar 2016 08:45:08 +0000 (08:45 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 5 Mar 2016 08:45:08 +0000 (08:45 +0000)
svn path=/trunk/; revision=70922

reactos/base/shell/progman/dialog.c
reactos/base/shell/progman/group.c
reactos/base/shell/progman/grpfile.c
reactos/base/shell/progman/main.c
reactos/base/shell/progman/progman.h
reactos/base/shell/progman/progman.rc
reactos/base/shell/progman/program.c
reactos/base/shell/progman/string.c
reactos/media/doc/README.WINE

index 14c1fb7..3a2f5cf 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "progman.h"
 
 
 #include "progman.h"
 
+#include <commdlg.h>
+
 /***********************************************************************
  *
  *           DIALOG_Browse
 /***********************************************************************
  *
  *           DIALOG_Browse
index 7232e0a..107da45 100644 (file)
@@ -58,8 +58,8 @@ ATOM GROUP_RegisterGroupWinClass(void)
   class.cbClsExtra    = 0;
   class.cbWndExtra    = sizeof(LONG_PTR);
   class.hInstance     = Globals.hInstance;
   class.cbClsExtra    = 0;
   class.cbWndExtra    = sizeof(LONG_PTR);
   class.hInstance     = Globals.hInstance;
-  class.hIcon         = LoadIconW(0, (LPWSTR)IDI_WINLOGO);
-  class.hCursor       = LoadCursorW(0, (LPWSTR)IDC_ARROW);
+  class.hIcon         = LoadIconW (0, (LPWSTR)IDI_WINLOGO);
+  class.hCursor       = LoadCursorW (0, (LPWSTR)IDC_ARROW);
   class.hbrBackground = GetStockObject (WHITE_BRUSH);
   class.lpszMenuName  = 0;
   class.lpszClassName = STRING_GROUP_WIN_CLASS_NAME;
   class.hbrBackground = GetStockObject (WHITE_BRUSH);
   class.lpszMenuName  = 0;
   class.lpszClassName = STRING_GROUP_WIN_CLASS_NAME;
@@ -170,7 +170,11 @@ HLOCAL GROUP_AddGroup(LPCSTR lpszName, LPCSTR lpszGrpFile, INT nCmdShow,
   cs.style   = 0;
   cs.lParam  = 0;
 
   cs.style   = 0;
   cs.lParam  = 0;
 
+#ifdef __REACTOS__
   group->hWnd = (HWND)SendMessageW(Globals.hMDIWnd, WM_MDICREATE, 0, (LPARAM)&cs);
   group->hWnd = (HWND)SendMessageW(Globals.hMDIWnd, WM_MDICREATE, 0, (LPARAM)&cs);
+#else
+  group->hWnd = (HWND)SendMessageA(Globals.hMDIWnd, WM_MDICREATE, 0, (LPARAM)&cs);
+#endif
   SetWindowTextA( group->hWnd, lpszName );
   SetWindowLongPtrW(group->hWnd, 0, (LONG_PTR) hGroup);
 
   SetWindowTextA( group->hWnd, lpszName );
   SetWindowLongPtrW(group->hWnd, 0, (LONG_PTR) hGroup);
 
index dc024a9..ae91c22 100644 (file)
@@ -20,7 +20,6 @@
  */
 
 #include "progman.h"
  */
 
 #include "progman.h"
-// #include <mmsystem.h>
 
 #define MALLOCHUNK 1000
 
 
 #define MALLOCHUNK 1000
 
@@ -277,7 +276,11 @@ static HLOCAL GRPFILE_ScanProgram(LPCSTR buffer, INT size,
   if (iconANDbits_ptr + iconANDsize > buffer + size ||
       iconXORbits_ptr + iconXORsize > buffer + size) return(0);
 
   if (iconANDbits_ptr + iconANDsize > buffer + size ||
       iconXORbits_ptr + iconXORsize > buffer + size) return(0);
 
-  hIcon = CreateIcon( Globals.hInstance, width, height, planes, bpp, (PBYTE)iconANDbits_ptr, (PBYTE)iconXORbits_ptr );
+#ifdef __REACTOS__
+  hIcon = CreateIcon(Globals.hInstance, width, height, planes, bpp, (PBYTE)iconANDbits_ptr, (PBYTE)iconXORbits_ptr);
+#else
+  hIcon = CreateIcon( Globals.hInstance, width, height, planes, bpp, iconANDbits_ptr, iconXORbits_ptr );
+#endif
 
   lpszName        = buffer + GET_USHORT(program_ptr, 18);
   lpszCmdLine     = buffer + GET_USHORT(program_ptr, 20);
 
   lpszName        = buffer + GET_USHORT(program_ptr, 18);
   lpszCmdLine     = buffer + GET_USHORT(program_ptr, 20);
@@ -508,7 +511,11 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group)
   HLOCAL hProgram;
   INT    NumProg, Title, Progs, Icons, Extension;
   INT    CurrProg, CurrIcon, nCmdShow, ptr, seqnum;
   HLOCAL hProgram;
   INT    NumProg, Title, Progs, Icons, Extension;
   INT    CurrProg, CurrIcon, nCmdShow, ptr, seqnum;
-  UINT   sizeAnd, sizeXor;
+#ifdef __REACTOS__
+  UINT sizeAnd, sizeXor;
+#else
+  DWORD  sizeAnd, sizeXor;
+#endif
   BOOL   need_extension;
   LPCSTR lpszTitle = LocalLock(group->hName);
 
   BOOL   need_extension;
   LPCSTR lpszTitle = LocalLock(group->hName);
 
index ab9e91a..a918ea3 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-// #define OEMRESOURCE
 #include "progman.h"
 
 #include "progman.h"
 
+#include <shellapi.h>
+
 GLOBALS Globals;
 
 static VOID MAIN_CreateGroups(void);
 GLOBALS Globals;
 
 static VOID MAIN_CreateGroups(void);
@@ -38,11 +39,18 @@ static VOID MAIN_AutoStart(void);
  *           WinMain
  */
 
  *           WinMain
  */
 
-int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
+#ifdef __REACTOS__
+int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
+#else
+int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
+#endif
 {
   MSG      msg;
 
   Globals.lpszIniFile         = "progman.ini";
 {
   MSG      msg;
 
   Globals.lpszIniFile         = "progman.ini";
+#ifndef __REACTOS__
+  Globals.lpszIcoFile         = "progman.ico";
+#endif
 
   Globals.hInstance           = hInstance;
   Globals.hGroups             = 0;
 
   Globals.hInstance           = hInstance;
   Globals.hGroups             = 0;
@@ -57,9 +65,15 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
     GetPrivateProfileIntA("Settings", "SaveSettings", 0, Globals.lpszIniFile);
 
   /* Load default icons */
     GetPrivateProfileIntA("Settings", "SaveSettings", 0, Globals.lpszIniFile);
 
   /* Load default icons */
-  Globals.hMainIcon    = LoadIconW(Globals.hInstance, MAKEINTRESOURCEW(IDI_APPICON));
-  Globals.hGroupIcon   = Globals.hMainIcon; // ExtractIconA(Globals.hInstance, Globals.lpszIcoFile, 0);
-  Globals.hDefaultIcon = Globals.hMainIcon; // ExtractIconA(Globals.hInstance, Globals.lpszIcoFile, 0);
+#ifdef __REACTOS__
+  Globals.hMainIcon = LoadIconW(Globals.hInstance, MAKEINTRESOURCEW(IDI_APPICON));
+  Globals.hGroupIcon = Globals.hMainIcon;
+  Globals.hDefaultIcon = Globals.hMainIcon;
+#else
+  Globals.hMainIcon    = ExtractIconA(Globals.hInstance, Globals.lpszIcoFile, 0);
+  Globals.hGroupIcon   = ExtractIconA(Globals.hInstance, Globals.lpszIcoFile, 0);
+  Globals.hDefaultIcon = ExtractIconA(Globals.hInstance, Globals.lpszIcoFile, 0);
+#endif
   if (!Globals.hMainIcon)    Globals.hMainIcon = LoadIconW(0, (LPWSTR)DEFAULTICON);
   if (!Globals.hGroupIcon)   Globals.hGroupIcon = LoadIconW(0, (LPWSTR)DEFAULTICON);
   if (!Globals.hDefaultIcon) Globals.hDefaultIcon = LoadIconW(0, (LPWSTR)DEFAULTICON);
   if (!Globals.hMainIcon)    Globals.hMainIcon = LoadIconW(0, (LPWSTR)DEFAULTICON);
   if (!Globals.hGroupIcon)   Globals.hGroupIcon = LoadIconW(0, (LPWSTR)DEFAULTICON);
   if (!Globals.hDefaultIcon) Globals.hDefaultIcon = LoadIconW(0, (LPWSTR)DEFAULTICON);
@@ -310,12 +324,17 @@ static VOID MAIN_MenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
       break;
 
     case PM_ABOUT_WINE:
       break;
 
     case PM_ABOUT_WINE:
+#ifdef __REACTOS__
     {
         WCHAR szTitle[MAX_STRING_LEN];
         LoadStringW(Globals.hInstance, IDS_PROGRAM_MANAGER, szTitle, ARRAYSIZE(szTitle));
         ShellAboutW(hWnd, szTitle, NULL, NULL);
         break;
     }
     {
         WCHAR szTitle[MAX_STRING_LEN];
         LoadStringW(Globals.hInstance, IDS_PROGRAM_MANAGER, szTitle, ARRAYSIZE(szTitle));
         ShellAboutW(hWnd, szTitle, NULL, NULL);
         break;
     }
+#else
+      ShellAboutA(hWnd, "WINE", "Program Manager", 0);
+      break;
+#endif
 
     default:
        MAIN_MessageBoxIDS(IDS_NOT_IMPLEMENTED, IDS_ERROR, MB_OK);
 
     default:
        MAIN_MessageBoxIDS(IDS_NOT_IMPLEMENTED, IDS_ERROR, MB_OK);
@@ -338,7 +357,7 @@ static ATOM MAIN_RegisterMainWinClass(void)
   class.cbWndExtra    = 0;
   class.hInstance     = Globals.hInstance;
   class.hIcon         = Globals.hMainIcon;
   class.cbWndExtra    = 0;
   class.hInstance     = Globals.hInstance;
   class.hIcon         = Globals.hMainIcon;
-  class.hCursor       = LoadCursorW(0, (LPWSTR)IDC_ARROW);
+  class.hCursor       = LoadCursorW (0, (LPWSTR)IDC_ARROW);
   class.hbrBackground = GetStockObject (NULL_BRUSH);
   class.lpszMenuName  = 0;
   class.lpszClassName = STRING_MAIN_WIN_CLASS_NAME;
   class.hbrBackground = GetStockObject (NULL_BRUSH);
   class.lpszMenuName  = 0;
   class.lpszClassName = STRING_MAIN_WIN_CLASS_NAME;
index c753c1f..3ab198a 100644 (file)
 #define PROGMAN_H
 
 #include <stdio.h>
 #define PROGMAN_H
 
 #include <stdio.h>
-#include <string.h>
 
 
-#define WIN32_LEAN_AND_MEAN
-
-#include <windows.h>
+#define WIN32_NO_STATUS
 #include <windef.h>
 #include <windef.h>
-#include <commdlg.h>
-#include <shellapi.h>
-
+#include <winbase.h>
+#include <wingdi.h>
+#include <winuser.h>
 
 #define MAX_STRING_LEN      255
 #define MAX_PATHNAME_LEN    1024
 #define MAX_LANGUAGE_NUMBER (PM_LAST_LANGUAGE - PM_FIRST_LANGUAGE)
 
 
 #define MAX_STRING_LEN      255
 #define MAX_PATHNAME_LEN    1024
 #define MAX_LANGUAGE_NUMBER (PM_LAST_LANGUAGE - PM_FIRST_LANGUAGE)
 
-
 #include "resource.h"
 
 /* Fallback icon */
 #include "resource.h"
 
 /* Fallback icon */
@@ -138,6 +134,9 @@ typedef struct
   HMENU   hWindowsMenu;
   HMENU   hLanguageMenu;
   LPCSTR  lpszIniFile;
   HMENU   hWindowsMenu;
   HMENU   hLanguageMenu;
   LPCSTR  lpszIniFile;
+#ifndef __REACTOS__
+  LPCSTR  lpszIcoFile;
+#endif
   BOOL    bAutoArrange;
   BOOL    bSaveSettings;
   BOOL    bMinOnRun;
   BOOL    bAutoArrange;
   BOOL    bSaveSettings;
   BOOL    bMinOnRun;
@@ -206,3 +205,7 @@ extern WCHAR STRING_GROUP_WIN_CLASS_NAME[];
 extern WCHAR STRING_PROGRAM_WIN_CLASS_NAME[];
 
 #endif /* PROGMAN_H */
 extern WCHAR STRING_PROGRAM_WIN_CLASS_NAME[];
 
 #endif /* PROGMAN_H */
+
+/* Local Variables:    */
+/* c-file-style: "GNU" */
+/* End:                */
index 66b60ea..ca6987f 100644 (file)
 
 #include <windef.h>
 #include <winuser.h>
 
 #include <windef.h>
 #include <winuser.h>
-// #include <commctrl.h>
 
 #include "resource.h"
 
 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 
 
 #include "resource.h"
 
 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 
-#define REACTOS_STR_FILE_DESCRIPTION    "ReactOS Program Manager"
-#define REACTOS_STR_INTERNAL_NAME       "progman"
-#define REACTOS_STR_ORIGINAL_FILENAME   "progman.exe"
+#define REACTOS_STR_FILE_DESCRIPTION  "ReactOS Program Manager"
+#define REACTOS_STR_INTERNAL_NAME     "progman"
+#define REACTOS_STR_ORIGINAL_FILENAME "progman.exe"
 #include <reactos/version.rc>
 
 IDI_APPICON ICON "res/progman.ico"
 
 #include <reactos/version.rc>
 
 IDI_APPICON ICON "res/progman.ico"
 
-
-
-
-
 LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
 
 MAIN_MENU MENU
 LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
 
 MAIN_MENU MENU
@@ -188,7 +183,11 @@ LTEXT         "&Working directory:",    PM_DIRECTORY_TXT,     5, 40,  75, 10
 EDITTEXT                                   PM_DIRECTORY,         95, 40,  90, 15, WS_TABSTOP
 LTEXT         "&Key combination:",      PM_HOT_KEY_TXT,       5, 55,  75, 10
 EDITTEXT                                   PM_HOT_KEY,           95, 55,  90, 15, WS_TABSTOP
 EDITTEXT                                   PM_DIRECTORY,         95, 40,  90, 15, WS_TABSTOP
 LTEXT         "&Key combination:",      PM_HOT_KEY_TXT,       5, 55,  75, 10
 EDITTEXT                                   PM_HOT_KEY,           95, 55,  90, 15, WS_TABSTOP
+#ifdef __REACTOS__
 ICON          "",                          PM_ICON,              20, 70, 20, 20
 ICON          "",                          PM_ICON,              20, 70, 20, 20
+#else
+ICON          "",                          PM_ICON,              20, 70
+#endif
 CHECKBOX      "&Minimize at launch",       PM_SYMBOL,            95, 75,  90, 10, WS_TABSTOP
 DEFPUSHBUTTON "OK",                   IDOK,                200,  5,  70, 15, WS_TABSTOP
 PUSHBUTTON    "Cancel",               IDCANCEL,            200, 25,  70, 15, WS_TABSTOP
 CHECKBOX      "&Minimize at launch",       PM_SYMBOL,            95, 75,  90, 10, WS_TABSTOP
 DEFPUSHBUTTON "OK",                   IDOK,                200,  5,  70, 15, WS_TABSTOP
 PUSHBUTTON    "Cancel",               IDCANCEL,            200, 25,  70, 15, WS_TABSTOP
index fbeaab4..5a4220a 100644 (file)
@@ -77,7 +77,7 @@ ATOM PROGRAM_RegisterProgramWinClass(void)
   class.cbWndExtra    = sizeof(LONG_PTR);
   class.hInstance     = Globals.hInstance;
   class.hIcon         = 0;
   class.cbWndExtra    = sizeof(LONG_PTR);
   class.hInstance     = Globals.hInstance;
   class.hIcon         = 0;
-  class.hCursor       = LoadCursorW(0, (LPWSTR)IDC_ARROW);
+  class.hCursor       = LoadCursorW (0, (LPWSTR)IDC_ARROW);
   class.hbrBackground = GetStockObject (WHITE_BRUSH);
   class.lpszMenuName  = 0;
   class.lpszClassName = STRING_PROGRAM_WIN_CLASS_NAME;
   class.hbrBackground = GetStockObject (WHITE_BRUSH);
   class.lpszMenuName  = 0;
   class.lpszClassName = STRING_PROGRAM_WIN_CLASS_NAME;
index 22499e3..b60bf72 100644 (file)
@@ -30,31 +30,36 @@ WCHAR STRING_PROGRAM_WIN_CLASS_NAME[] = {'P','M','P','r','o','g','r','a','m',0};
 
 VOID STRING_LoadMenus(VOID)
 {
 
 VOID STRING_LoadMenus(VOID)
 {
-    WCHAR caption[MAX_STRING_LEN];
-    HMENU hMainMenu;
-
-    /* Set frame caption */
-    LoadStringW(Globals.hInstance, IDS_PROGRAM_MANAGER, caption, sizeof(caption));
-    SetWindowTextW(Globals.hMainWnd, caption);
-
-    /* Create menu */
-    hMainMenu = LoadMenuW(Globals.hInstance, MAKEINTRESOURCEW(MAIN_MENU));
-    Globals.hFileMenu     = GetSubMenu(hMainMenu, 0);
-    Globals.hOptionMenu   = GetSubMenu(hMainMenu, 1);
-    Globals.hWindowsMenu  = GetSubMenu(hMainMenu, 2);
-    Globals.hLanguageMenu = GetSubMenu(hMainMenu, 3);
-
-    if (Globals.hMDIWnd)
-    {
-        SendMessageW(Globals.hMDIWnd, WM_MDISETMENU,
-                     (WPARAM)hMainMenu, (LPARAM)Globals.hWindowsMenu);
-    }
-    else
-    {
-        SetMenu(Globals.hMainWnd, hMainMenu);
-    }
-
-    /* Destroy old menu */
-    if (Globals.hMainMenu) DestroyMenu(Globals.hMainMenu);
-    Globals.hMainMenu = hMainMenu;
+#ifdef __REACTOS__
+  WCHAR caption[MAX_STRING_LEN];
+#else
+  CHAR   caption[MAX_STRING_LEN];
+#endif
+  HMENU  hMainMenu;
+
+  /* Set frame caption */
+#ifdef __REACTOS__
+  LoadStringW(Globals.hInstance, IDS_PROGRAM_MANAGER, caption, sizeof(caption));
+  SetWindowTextW(Globals.hMainWnd, caption);
+#else
+  LoadStringA(Globals.hInstance, IDS_PROGRAM_MANAGER, caption, sizeof(caption));
+  SetWindowTextA(Globals.hMainWnd, caption);
+#endif
+
+  /* Create menu */
+  hMainMenu = LoadMenuW(Globals.hInstance, MAKEINTRESOURCEW(MAIN_MENU));
+  Globals.hFileMenu     = GetSubMenu(hMainMenu, 0);
+  Globals.hOptionMenu   = GetSubMenu(hMainMenu, 1);
+  Globals.hWindowsMenu  = GetSubMenu(hMainMenu, 2);
+  Globals.hLanguageMenu = GetSubMenu(hMainMenu, 3);
+
+  if (Globals.hMDIWnd)
+    SendMessageW(Globals.hMDIWnd, WM_MDISETMENU,
+               (WPARAM) hMainMenu,
+               (LPARAM) Globals.hWindowsMenu);
+  else SetMenu(Globals.hMainWnd, hMainMenu);
+
+  /* Destroy old menu */
+  if (Globals.hMainMenu) DestroyMenu(Globals.hMainMenu);
+  Globals.hMainMenu = hMainMenu;
 }
 }
index 2da3487..da71da3 100644 (file)
@@ -242,6 +242,7 @@ reactos/base/applications/regedit           # Out of sync
 reactos/base/applications/winhlp32          # Synced to WineStaging-1.9.4
 reactos/base/applications/wordpad           # Synced to WineStaging-1.7.55
 reactos/base/services/rpcss                 # Synced to WineStaging-1.7.55
 reactos/base/applications/winhlp32          # Synced to WineStaging-1.9.4
 reactos/base/applications/wordpad           # Synced to WineStaging-1.7.55
 reactos/base/services/rpcss                 # Synced to WineStaging-1.7.55
+reactos/base/shell/progman                  # Synced to WineStaging-1.9.4
 reactos/base/system/expand                  # Synced to WineStaging-1.7.55
 reactos/base/system/msiexec                 # Synced to WineStaging-1.9.4
 reactos/modules/rosapps/winfile             # Autosync
 reactos/base/system/expand                  # Synced to WineStaging-1.7.55
 reactos/base/system/msiexec                 # Synced to WineStaging-1.9.4
 reactos/modules/rosapps/winfile             # Autosync