Release 960324

Sun Mar 24 13:13:11 1996  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [include/win.h] [windows/*.c]
	Replaced next, parent, child and owner handles by pointers in WND
	structure. This should improve performance, and should be
	reasonably safe since Microsoft did the same in Win95.

	* [include/wintypes.h] [*/*]
	Redefined HANDLE to be UINT instead of a pointer for Winelib. This
	allows removing a lot of unnecessary casts and NPFMTs.

	* [windows/caret.c]
	Create the caret brush upon CreateCaret(); use the bitmap
	dimensions for the caret.
	Fixed CARET_DisplayCaret() to use PatBlt().

Fri Mar 22 16:00:00 1996  Anand Kumria <akumria@ozemail.com.au>

	* [misc/winsocket.c]
	More sanity checks, fixup some erroneous return codes.

	* [documentation/winsock]
	Description of how compatible the winsock is currently.

Fri Mar 22 13:05:34 1996  Ulrich Schmid  <uschmid@mail.hh.provi.de>

	* [library/winmain.c]
	Set `lpszCmdParam' by concatenating arguments.

	* [loader/module.c]
	WinExec: accept Unix commands, use Wine emulator.

Mon Mar 18 12:16:27 1996  Martin von Loewis <loewis@informatik.hu-berlin.de>

	* [if1632/kernel32.spec][win32/thread.c][include/kernel32.h]
	DeleteCriticalSection, EnterCriticalSection,
 	InitializeCriticalSection, LeaveCriticalSection, TlsAlloc,
 	TlsFree, TlsGetValue, TlsSetValue: new functions.
	CRITICAL_SECTION: new structure.

	* [if1632/kernel32.spec][win32/code_page.c]
	WideCharToMultiByte: new function.

	* [if1632/kernel32.spec][win32/file.c]
	GetFileAttributesA: new function.

	* [if1632/kernel32.spec][misc/main.c]
	GetEnvironmentStringsW, FreeEnvironmentStringsA,
 	FreeEnvironmentStringsW: new functions.
	
	* [if1632/user.spec][win32/cursoricon32.c][win32/Makefile.in]
	cursoricon32.c: new file.
	LoadCursorA, LoadCursorW: modified implementation from LoadCursor
 	to WIN32_*.
	LoadIconA, LoadIconW: modified implementation from LoadIconA32
	to WIN32_*.

	* [include/struct32.h]
	pragma pack inserted.
	CURSORICON32 structures added.

	* [include/winnls.h]
	Constants CP_* and WC_* added.

	* [loader/pe_image.c]
	PE_LoadModule: call PE_InitDLL with hModule rather than wpnt.

Sun Mar 17 16:59:12 1996  Albrecht Kleine  <kleine@ak.sax.de>

	* [misc/commdlg.c]
	Introduced hook function handling in file dialog.
	Removed an unnecessary ShowWindow call in FILEDLG_WMCommand().

Thu Mar 14 10:50:00 1996  Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>

	* [if1632/gdi32.spec]
	Added GetNearestColor.

	* [if1632/kernel32.spec]
	Added GlobalAddAtomA.

	* [win32/param32.c]
	Added stackframe.h to includes.
	WIN32_GlobalAddAtomA() - new function.
diff --git a/programs/progman/ChangeLog b/programs/progman/ChangeLog
index 7a14e2d..c5a2349 100644
--- a/programs/progman/ChangeLog
+++ b/programs/progman/ChangeLog
@@ -1,3 +1,14 @@
+Fri Mar 15 20:56:31 1996  Ulrich Schmid  <uschmid@mail.hh.provi.de>
+
+	* [main.c]
+ 	`Arrange icons' in group windows
+
+	* [program.c]
+	No sysmenu for program windows
+
+	* [string.c]
+	Update sysmenu after language change
+
 Wed Feb 28 19:21:55 1996  Ulrich Schmid  <uschmid@mail.hh.provi.de>
 
 	* [progman.h] [main.c] [group.c] [program.c] [dialog.c]
diff --git a/programs/progman/Makefile.in b/programs/progman/Makefile.in
index 32f4a44..241c566 100644
--- a/programs/progman/Makefile.in
+++ b/programs/progman/Makefile.in
@@ -12,8 +12,7 @@
 	grpfile.o \
 	license.o \
 	main.o \
-	program.o \
-	winexec.o
+	program.o
 
 STRINGOBJS = \
 	accel.o \
@@ -29,7 +28,7 @@
 @MAKE_RULES@
 
 # Some strings need addresses >= 0x10000
-progman: $(MOSTOBJS) $(STRINGOBJS)
+progman: $(MOSTOBJS) $(STRINGOBJS) $(WINELIB)
 	$(CC) -o progman $(MOSTOBJS) $(LDOPTIONS) $(ALL_LIBS) $(STRINGOBJS)
 
 clean::
diff --git a/programs/progman/main.c b/programs/progman/main.c
index 6775121..4d3cd13 100644
--- a/programs/progman/main.c
+++ b/programs/progman/main.c
@@ -320,7 +320,10 @@
 
       /* Menu Windows */
     case PM_ARRANGE:
-      SendMessage(Globals.hMDIWnd, WM_MDIICONARRANGE, 0, 0);
+      if (hActiveGroupWnd && !IsIconic(hActiveGroupWnd))
+	ArrangeIconicWindows(hActiveGroupWnd);
+      else
+	SendMessage(Globals.hMDIWnd, WM_MDIICONARRANGE, 0, 0);
       break;
 
       /* Menu Language */
diff --git a/programs/progman/progman.h b/programs/progman/progman.h
index 5d72ed9..875598b 100644
--- a/programs/progman/progman.h
+++ b/programs/progman/progman.h
@@ -11,14 +11,6 @@
 
 #include "windows.h"
 
-/* FIXME should use WinExec from -lwine */
-#ifdef WINELIB
-#define WinExec ProgmanWinExec
-#define WinHelp ProgmanWinHelp
-HANDLE  ProgmanWinExec(LPSTR,WORD);
-BOOL    ProgmanWinHelp(HWND,LPSTR,WORD,DWORD);
-#endif
-
 #define MAX_PATHNAME_LEN 1024
 
 /* Fallback icon */
diff --git a/programs/progman/program.c b/programs/progman/program.c
index adf30ed..d9e4b4a 100644
--- a/programs/progman/program.c
+++ b/programs/progman/program.c
@@ -198,7 +198,7 @@
 
   program->hWnd =
     CreateWindow (STRING_PROGRAM_WIN_CLASS_NAME, (LPSTR)lpszName,
-		  WS_CHILD | WS_OVERLAPPEDWINDOW,
+		  WS_CHILD | WS_CAPTION,
 		  x, y, CW_USEDEFAULT, CW_USEDEFAULT,
 		  group->hWnd, 0, Globals.hInstance, 0);
 
diff --git a/programs/progman/string.c b/programs/progman/string.c
index a040855..be7ae15 100644
--- a/programs/progman/string.c
+++ b/programs/progman/string.c
@@ -5,6 +5,9 @@
  */
 
 #include <windows.h>
+#ifdef WINELIB
+#include <options.h>
+#endif
 #include "progman.h"
 
 /* Class names */
@@ -33,6 +36,9 @@
 
 VOID STRING_SelectLanguage(LPCSTR lang)
 {
+  HMENU  hMainMenu;
+  HLOCAL hGroup;
+
   /* Change string table */
   Globals.StringTable = StringTableEn;
   if (!lstrcmp(lang, "De")) Globals.StringTable = StringTableDe;
@@ -51,28 +57,23 @@
   lstrcpyn(STRING_SYMBOL_Xx  + sizeof(STRING_SYMBOL_Xx)  - 3, lang, 3);
   lstrcpyn(STRING_EXECUTE_Xx + sizeof(STRING_EXECUTE_Xx) - 3, lang, 3);
 
-  /* Destroy old menu */
-  if (Globals.hMainMenu)
+  /* Create menu */
+  hMainMenu = LoadMenu(Globals.hInstance, STRING_MAIN_Xx);
+  if (hMainMenu)
   {
-    SendMessage(Globals.hMDIWnd, WM_MDISETMENU, (WPARAM) NULL, (LPARAM) NULL);
-#if 0 /* FIXME when MDISetMenu is complete */
-    DestroyMenu(Globals.hMainMenu);
-#endif
-  }
-
-  /* Create new menu */
-  Globals.hMainMenu = LoadMenu(Globals.hInstance, STRING_MAIN_Xx);
-  if (Globals.hMainMenu)
-  {
-    Globals.hFileMenu    = GetSubMenu(Globals.hMainMenu, 0);
-    Globals.hOptionMenu  = GetSubMenu(Globals.hMainMenu, 1);
-    Globals.hWindowsMenu = GetSubMenu(Globals.hMainMenu, 2);
+    Globals.hFileMenu    = GetSubMenu(hMainMenu, 0);
+    Globals.hOptionMenu  = GetSubMenu(hMainMenu, 1);
+    Globals.hWindowsMenu = GetSubMenu(hMainMenu, 2);
 
     if (Globals.hMDIWnd)
       SendMessage(Globals.hMDIWnd, WM_MDISETMENU,
-		  (WPARAM) Globals.hMainMenu,
+		  (WPARAM) hMainMenu,
 		  (LPARAM) Globals.hWindowsMenu);
-    else SetMenu(Globals.hMainWnd, Globals.hMainMenu);
+    else SetMenu(Globals.hMainWnd, hMainMenu);
+
+    /* Destroy old menu */
+    if (Globals.hMainMenu) DestroyMenu(Globals.hMainMenu);
+    Globals.hMainMenu = hMainMenu;
   }
   /* Unsupported language */
   else if(lstrcmp(lang, "En")) STRING_SelectLanguage("En");
@@ -85,6 +86,17 @@
   /* have to be last because of
    * the possible recursion */
   Globals.lpszLanguage = lang;
+#ifdef WINELIB
+  if (!lstrcmp(lang, "De")) Options.language = LANG_De;
+  if (!lstrcmp(lang, "En")) Options.language = LANG_En;
+  GetSystemMenu(Globals.hMainWnd, TRUE);
+  for (hGroup = GROUP_FirstGroup(); hGroup;
+       hGroup = GROUP_NextGroup(hGroup))
+    {
+      GROUP *group = LocalLock(hGroup);
+      GetSystemMenu(group->hWnd, TRUE);
+    }
+#endif
 }
 
 /* Local Variables:    */
diff --git a/programs/progman/winexec.c b/programs/progman/winexec.c
deleted file mode 100644
index 722576c..0000000
--- a/programs/progman/winexec.c
+++ /dev/null
@@ -1,91 +0,0 @@
-#ifdef WINELIB
-#include <unistd.h>
-#include <string.h>
-#include "windows.h"
-#include "winbase.h"
-#include "options.h"
-#include "dos_fs.h"
-#include "debug.h"
-#include "progman.h"
-
-#define MAX_CMDLINE_SIZE 256
-
-/* FIXME should use WinExec from -lwine */
-
-HANDLE ProgmanWinExec( LPSTR lpCmdLine, WORD nCmdShow )
-{
-  char  wine[MAX_CMDLINE_SIZE];
-  char  filename[MAX_CMDLINE_SIZE], *p;
-  char  cmdline[MAX_CMDLINE_SIZE];
-  const char *argv[10], **argptr;
-  const char *unixfilename;
-  int   simplename = 1;
-
-  if (fork()) return(INVALID_HANDLE_VALUE);
-
-  strncpy( filename, lpCmdLine, MAX_CMDLINE_SIZE );
-  filename[MAX_CMDLINE_SIZE-1] = '\0';
-  for (p = filename; *p && (*p != ' ') && (*p != '\t'); p++)
-    if ((*p == ':') || (*p == ':') || (*p == '/')) simplename = 0;
-  if (*p)
-    {
-      strncpy( cmdline, p + 1, 128 );
-      cmdline[127] = '\0';
-    }
-  else cmdline[0] = '\0';
-  *p = '\0';
-
-  if (simplename) unixfilename = filename;
-  else unixfilename = DOSFS_GetUnixFileName(filename, 0);
-
-  argptr = argv;
-  *argptr++ = unixfilename;
-  if (nCmdShow == SW_SHOWMINIMIZED) *argptr++ = "-iconic";
-  if (cmdline[0]) *argptr++ = cmdline;
-  *argptr++ = 0;
-  execvp(argv[0], (char**)argv);
-
-  PROFILE_GetWineIniString("progman", "wine", "wine", 
-			   wine, sizeof(wine));
-  argptr = argv;
-  *argptr++ = wine;
-  *argptr++ = "-language";
-  *argptr++ = Globals.lpszLanguage;
-  if (nCmdShow == SW_SHOWMINIMIZED) *argptr++ = "-iconic";
-  *argptr++ = lpCmdLine;
-  *argptr++ = 0;
-  execvp(argv[0] , (char**)argv);
-
-  printf("Cannot exec `%s %s %s%s %s'\n",
-	 wine, "-language", Globals.lpszLanguage,
-	 nCmdShow == SW_SHOWMINIMIZED ? " -iconic" : "",
-	 lpCmdLine);
-  exit(1);
-}
-
-BOOL ProgmanWinHelp(HWND hWnd, LPSTR lpHelpFile, WORD wCommand, DWORD dwData)
-{
-  char	str[256];
-  dprintf_exec(stddeb,"WinHelp(%s, %u, %lu)\n", 
-	       lpHelpFile, wCommand, dwData);
-  switch(wCommand) {
-  case 0:
-  case HELP_HELPONHELP:
-    GetWindowsDirectory(str, sizeof(str));
-    strcat(str, "\\winhelp.exe winhelp.hlp");
-    dprintf_exec(stddeb,"'%s'\n", str);
-    break;
-  case HELP_INDEX:
-    GetWindowsDirectory(str, sizeof(str));
-    strcat(str, "\\winhelp.exe ");
-    strcat(str, lpHelpFile);
-    dprintf_exec(stddeb,"'%s'\n", str);
-    break;
-  default:
-    return FALSE;
-  }
-  WinExec(str, SW_SHOWNORMAL);
-  return(TRUE);
-}
-
-#endif