Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
/*
|
1998-10-18 16:11:42 +02:00
|
|
|
* Notepad
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
*
|
2000-07-23 16:22:47 +02:00
|
|
|
* Copyright 2000 Mike McCormack <Mike_McCormack@looksmart.com.au>
|
1998-10-18 16:11:42 +02:00
|
|
|
* Copyright 1997,98 Marcel Baur <mbaur@g26.ethz.ch>
|
2002-03-20 23:55:46 +01:00
|
|
|
* Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
|
2002-07-08 21:41:09 +02:00
|
|
|
* Copyright 2002 Andriy Palamarchuk
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2000-07-23 16:22:47 +02:00
|
|
|
*
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
*/
|
|
|
|
|
2012-01-23 12:16:36 +01:00
|
|
|
#include <stdio.h>
|
2002-07-08 21:41:09 +02:00
|
|
|
#include <windows.h>
|
2012-01-23 12:16:36 +01:00
|
|
|
#include <commdlg.h>
|
|
|
|
#include <shellapi.h>
|
2006-10-22 18:58:12 +02:00
|
|
|
#include <shlwapi.h>
|
1999-02-14 12:28:37 +01:00
|
|
|
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
#include "main.h"
|
1998-02-15 20:40:49 +01:00
|
|
|
#include "dialog.h"
|
2002-07-08 21:41:09 +02:00
|
|
|
#include "notepad_res.h"
|
2000-03-19 22:49:49 +01:00
|
|
|
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
NOTEPAD_GLOBALS Globals;
|
2003-07-21 22:05:33 +02:00
|
|
|
static ATOM aFINDMSGSTRING;
|
2006-10-24 12:27:28 +02:00
|
|
|
static RECT main_rect;
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
|
2006-09-16 02:11:47 +02:00
|
|
|
static const WCHAR notepad_reg_key[] = {'S','o','f','t','w','a','r','e','\\',
|
|
|
|
'M','i','c','r','o','s','o','f','t','\\','N','o','t','e','p','a','d','\0'};
|
|
|
|
static const WCHAR value_fWrap[] = {'f','W','r','a','p','\0'};
|
|
|
|
static const WCHAR value_iPointSize[] = {'i','P','o','i','n','t','S','i','z','e','\0'};
|
|
|
|
static const WCHAR value_iWindowPosDX[] = {'i','W','i','n','d','o','w','P','o','s','D','X','\0'};
|
|
|
|
static const WCHAR value_iWindowPosDY[] = {'i','W','i','n','d','o','w','P','o','s','D','Y','\0'};
|
|
|
|
static const WCHAR value_iWindowPosX[] = {'i','W','i','n','d','o','w','P','o','s','X','\0'};
|
|
|
|
static const WCHAR value_iWindowPosY[] = {'i','W','i','n','d','o','w','P','o','s','Y','\0'};
|
|
|
|
static const WCHAR value_lfCharSet[] = {'l','f','C','h','a','r','S','e','t','\0'};
|
|
|
|
static const WCHAR value_lfClipPrecision[] = {'l','f','C','l','i','p','P','r','e','c','i','s','i','o','n','\0'};
|
|
|
|
static const WCHAR value_lfEscapement[] = {'l','f','E','s','c','a','p','e','m','e','n','t','\0'};
|
|
|
|
static const WCHAR value_lfItalic[] = {'l','f','I','t','a','l','i','c','\0'};
|
|
|
|
static const WCHAR value_lfOrientation[] = {'l','f','O','r','i','e','n','t','a','t','i','o','n','\0'};
|
|
|
|
static const WCHAR value_lfOutPrecision[] = {'l','f','O','u','t','P','r','e','c','i','s','i','o','n','\0'};
|
|
|
|
static const WCHAR value_lfPitchAndFamily[] = {'l','f','P','i','t','c','h','A','n','d','F','a','m','i','l','y','\0'};
|
|
|
|
static const WCHAR value_lfQuality[] = {'l','f','Q','u','a','l','i','t','y','\0'};
|
|
|
|
static const WCHAR value_lfStrikeOut[] = {'l','f','S','t','r','i','k','e','O','u','t','\0'};
|
|
|
|
static const WCHAR value_lfUnderline[] = {'l','f','U','n','d','e','r','l','i','n','e','\0'};
|
|
|
|
static const WCHAR value_lfWeight[] = {'l','f','W','e','i','g','h','t','\0'};
|
|
|
|
static const WCHAR value_lfFaceName[] = {'l','f','F','a','c','e','N','a','m','e','\0'};
|
2007-04-01 20:52:08 +02:00
|
|
|
static const WCHAR value_iMarginTop[] = {'i','M','a','r','g','i','n','T','o','p','\0'};
|
|
|
|
static const WCHAR value_iMarginBottom[] = {'i','M','a','r','g','i','n','B','o','t','t','o','m','\0'};
|
|
|
|
static const WCHAR value_iMarginLeft[] = {'i','M','a','r','g','i','n','L','e','f','t','\0'};
|
|
|
|
static const WCHAR value_iMarginRight[] = {'i','M','a','r','g','i','n','R','i','g','h','t','\0'};
|
|
|
|
static const WCHAR value_szHeader[] = {'s','z','H','e','a','d','e','r','\0'};
|
|
|
|
static const WCHAR value_szFooter[] = {'s','z','T','r','a','i','l','e','r','\0'};
|
2006-09-16 02:11:47 +02:00
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
/***********************************************************************
|
|
|
|
*
|
2009-06-30 00:03:53 +02:00
|
|
|
* SetFileNameAndEncoding
|
2000-07-23 16:22:47 +02:00
|
|
|
*
|
2009-06-30 00:03:53 +02:00
|
|
|
* Sets global file name and encoding (which is used to preselect original
|
|
|
|
* encoding in Save As dialog, and when saving without using the Save As
|
|
|
|
* dialog).
|
2000-07-23 16:22:47 +02:00
|
|
|
*/
|
2009-06-30 00:03:53 +02:00
|
|
|
VOID SetFileNameAndEncoding(LPCWSTR szFileName, ENCODING enc)
|
2000-07-23 16:22:47 +02:00
|
|
|
{
|
2009-05-07 22:25:33 +02:00
|
|
|
lstrcpyW(Globals.szFileName, szFileName);
|
2002-11-15 05:13:46 +01:00
|
|
|
Globals.szFileTitle[0] = 0;
|
2018-05-23 00:41:53 +02:00
|
|
|
GetFileTitleW(szFileName, Globals.szFileTitle, ARRAY_SIZE(Globals.szFileTitle));
|
2009-06-30 00:03:53 +02:00
|
|
|
Globals.encFile = enc;
|
2000-07-23 16:22:47 +02:00
|
|
|
}
|
|
|
|
|
2006-09-16 02:11:47 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* get_dpi
|
|
|
|
*
|
|
|
|
* Get the dpi from registry HKCC\Software\Fonts\LogPixels.
|
|
|
|
*/
|
2007-04-06 19:50:37 +02:00
|
|
|
DWORD get_dpi(void)
|
2006-09-16 02:11:47 +02:00
|
|
|
{
|
|
|
|
static const WCHAR dpi_key_name[] = {'S','o','f','t','w','a','r','e','\\','F','o','n','t','s','\0'};
|
|
|
|
static const WCHAR dpi_value_name[] = {'L','o','g','P','i','x','e','l','s','\0'};
|
|
|
|
DWORD dpi = 96;
|
|
|
|
HKEY hkey;
|
|
|
|
|
2009-05-07 22:26:04 +02:00
|
|
|
if (RegOpenKeyW(HKEY_CURRENT_CONFIG, dpi_key_name, &hkey) == ERROR_SUCCESS)
|
2006-09-16 02:11:47 +02:00
|
|
|
{
|
|
|
|
DWORD type, size, new_dpi;
|
|
|
|
|
|
|
|
size = sizeof(new_dpi);
|
2009-05-07 22:26:04 +02:00
|
|
|
if(RegQueryValueExW(hkey, dpi_value_name, NULL, &type, (LPBYTE)&new_dpi, &size) == ERROR_SUCCESS)
|
2006-09-16 02:11:47 +02:00
|
|
|
{
|
|
|
|
if(type == REG_DWORD && new_dpi != 0)
|
|
|
|
dpi = new_dpi;
|
|
|
|
}
|
|
|
|
RegCloseKey(hkey);
|
|
|
|
}
|
|
|
|
return dpi;
|
|
|
|
}
|
|
|
|
|
2005-12-01 12:35:13 +01:00
|
|
|
/***********************************************************************
|
|
|
|
*
|
2006-09-16 02:11:47 +02:00
|
|
|
* NOTEPAD_SaveSettingToRegistry
|
2005-12-01 12:35:13 +01:00
|
|
|
*
|
2008-04-07 13:01:02 +02:00
|
|
|
* Save setting to registry HKCU\Software\Microsoft\Notepad.
|
2005-12-01 12:35:13 +01:00
|
|
|
*/
|
2006-09-16 02:11:47 +02:00
|
|
|
static VOID NOTEPAD_SaveSettingToRegistry(void)
|
2005-12-01 12:35:13 +01:00
|
|
|
{
|
2006-09-16 02:11:47 +02:00
|
|
|
HKEY hkey;
|
|
|
|
DWORD disp;
|
|
|
|
|
2009-05-07 22:26:04 +02:00
|
|
|
if(RegCreateKeyExW(HKEY_CURRENT_USER, notepad_reg_key, 0, NULL,
|
2006-09-16 02:11:47 +02:00
|
|
|
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &disp) == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
DWORD data;
|
2008-10-24 14:10:11 +02:00
|
|
|
WINDOWPLACEMENT wndpl;
|
2006-09-16 02:11:47 +02:00
|
|
|
|
2008-10-24 14:10:11 +02:00
|
|
|
wndpl.length = sizeof(WINDOWPLACEMENT);
|
|
|
|
GetWindowPlacement(Globals.hMainWnd, &wndpl);
|
|
|
|
main_rect = wndpl.rcNormalPosition;
|
2006-10-24 12:27:28 +02:00
|
|
|
|
2009-05-07 22:26:04 +02:00
|
|
|
#define SET_NOTEPAD_REG(hkey, value_name, value_data) do { DWORD data = value_data; RegSetValueExW(hkey, value_name, 0, REG_DWORD, (LPBYTE)&data, sizeof(DWORD)); }while(0)
|
2006-09-16 02:11:47 +02:00
|
|
|
SET_NOTEPAD_REG(hkey, value_fWrap, Globals.bWrapLongLines);
|
2006-10-24 12:27:28 +02:00
|
|
|
SET_NOTEPAD_REG(hkey, value_iWindowPosX, main_rect.left);
|
|
|
|
SET_NOTEPAD_REG(hkey, value_iWindowPosY, main_rect.top);
|
|
|
|
SET_NOTEPAD_REG(hkey, value_iWindowPosDX, main_rect.right - main_rect.left);
|
|
|
|
SET_NOTEPAD_REG(hkey, value_iWindowPosDY, main_rect.bottom - main_rect.top);
|
2006-09-16 02:11:47 +02:00
|
|
|
SET_NOTEPAD_REG(hkey, value_lfCharSet, Globals.lfFont.lfCharSet);
|
|
|
|
SET_NOTEPAD_REG(hkey, value_lfClipPrecision, Globals.lfFont.lfClipPrecision);
|
|
|
|
SET_NOTEPAD_REG(hkey, value_lfEscapement, Globals.lfFont.lfEscapement);
|
|
|
|
SET_NOTEPAD_REG(hkey, value_lfItalic, Globals.lfFont.lfItalic);
|
|
|
|
SET_NOTEPAD_REG(hkey, value_lfOrientation, Globals.lfFont.lfOrientation);
|
|
|
|
SET_NOTEPAD_REG(hkey, value_lfOutPrecision, Globals.lfFont.lfOutPrecision);
|
|
|
|
SET_NOTEPAD_REG(hkey, value_lfPitchAndFamily, Globals.lfFont.lfPitchAndFamily);
|
|
|
|
SET_NOTEPAD_REG(hkey, value_lfQuality, Globals.lfFont.lfQuality);
|
|
|
|
SET_NOTEPAD_REG(hkey, value_lfStrikeOut, Globals.lfFont.lfStrikeOut);
|
|
|
|
SET_NOTEPAD_REG(hkey, value_lfUnderline, Globals.lfFont.lfUnderline);
|
|
|
|
SET_NOTEPAD_REG(hkey, value_lfWeight, Globals.lfFont.lfWeight);
|
2007-04-01 20:52:08 +02:00
|
|
|
SET_NOTEPAD_REG(hkey, value_iMarginTop, Globals.iMarginTop);
|
|
|
|
SET_NOTEPAD_REG(hkey, value_iMarginBottom, Globals.iMarginBottom);
|
|
|
|
SET_NOTEPAD_REG(hkey, value_iMarginLeft, Globals.iMarginLeft);
|
|
|
|
SET_NOTEPAD_REG(hkey, value_iMarginRight, Globals.iMarginRight);
|
2006-09-16 02:11:47 +02:00
|
|
|
#undef SET_NOTEPAD_REG
|
|
|
|
|
2007-04-01 16:23:31 +02:00
|
|
|
/* Store the current value as 10 * twips */
|
|
|
|
data = MulDiv(abs(Globals.lfFont.lfHeight), 720 , get_dpi());
|
2009-05-07 22:26:04 +02:00
|
|
|
RegSetValueExW(hkey, value_iPointSize, 0, REG_DWORD, (LPBYTE)&data, sizeof(DWORD));
|
2006-09-16 02:11:47 +02:00
|
|
|
|
2009-05-07 22:26:04 +02:00
|
|
|
RegSetValueExW(hkey, value_lfFaceName, 0, REG_SZ, (LPBYTE)&Globals.lfFont.lfFaceName,
|
2009-05-07 22:25:33 +02:00
|
|
|
lstrlenW(Globals.lfFont.lfFaceName) * sizeof(Globals.lfFont.lfFaceName[0]));
|
2006-09-16 02:11:47 +02:00
|
|
|
|
2009-05-07 22:26:04 +02:00
|
|
|
RegSetValueExW(hkey, value_szHeader, 0, REG_SZ, (LPBYTE)&Globals.szHeader,
|
2009-05-07 22:25:33 +02:00
|
|
|
lstrlenW(Globals.szHeader) * sizeof(Globals.szHeader[0]));
|
2007-04-01 20:52:08 +02:00
|
|
|
|
2009-05-07 22:26:04 +02:00
|
|
|
RegSetValueExW(hkey, value_szFooter, 0, REG_SZ, (LPBYTE)&Globals.szFooter,
|
2009-05-07 22:25:33 +02:00
|
|
|
lstrlenW(Globals.szFooter) * sizeof(Globals.szFooter[0]));
|
2007-04-01 20:52:08 +02:00
|
|
|
|
2006-09-16 02:11:47 +02:00
|
|
|
RegCloseKey(hkey);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
*
|
|
|
|
* NOTEPAD_LoadSettingFromRegistry
|
|
|
|
*
|
|
|
|
* Load setting from registry HKCU\Software\Microsoft\Notepad.
|
|
|
|
*/
|
|
|
|
static VOID NOTEPAD_LoadSettingFromRegistry(void)
|
|
|
|
{
|
|
|
|
static const WCHAR systemW[] = { 'S','y','s','t','e','m','\0' };
|
|
|
|
HKEY hkey;
|
2006-10-24 12:27:28 +02:00
|
|
|
INT base_length, dx, dy;
|
2006-09-16 02:11:47 +02:00
|
|
|
|
|
|
|
base_length = (GetSystemMetrics(SM_CXSCREEN) > GetSystemMetrics(SM_CYSCREEN))?
|
|
|
|
GetSystemMetrics(SM_CYSCREEN) : GetSystemMetrics(SM_CXSCREEN);
|
|
|
|
|
2006-10-24 12:27:28 +02:00
|
|
|
dx = base_length * .95;
|
|
|
|
dy = dx * 3 / 4;
|
|
|
|
SetRect( &main_rect, 0, 0, dx, dy );
|
2006-09-16 02:11:47 +02:00
|
|
|
|
|
|
|
Globals.bWrapLongLines = TRUE;
|
2007-04-01 20:52:08 +02:00
|
|
|
Globals.iMarginTop = 2500;
|
|
|
|
Globals.iMarginBottom = 2500;
|
|
|
|
Globals.iMarginLeft = 2000;
|
|
|
|
Globals.iMarginRight = 2000;
|
2005-12-01 12:35:13 +01:00
|
|
|
|
2006-09-16 02:11:47 +02:00
|
|
|
Globals.lfFont.lfHeight = -12;
|
|
|
|
Globals.lfFont.lfWidth = 0;
|
|
|
|
Globals.lfFont.lfEscapement = 0;
|
|
|
|
Globals.lfFont.lfOrientation = 0;
|
|
|
|
Globals.lfFont.lfWeight = FW_REGULAR;
|
|
|
|
Globals.lfFont.lfItalic = FALSE;
|
|
|
|
Globals.lfFont.lfUnderline = FALSE;
|
|
|
|
Globals.lfFont.lfStrikeOut = FALSE;
|
|
|
|
Globals.lfFont.lfCharSet = DEFAULT_CHARSET;
|
|
|
|
Globals.lfFont.lfOutPrecision = OUT_DEFAULT_PRECIS;
|
|
|
|
Globals.lfFont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
|
|
|
|
Globals.lfFont.lfQuality = DEFAULT_QUALITY;
|
|
|
|
Globals.lfFont.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
|
2009-05-07 22:25:33 +02:00
|
|
|
lstrcpyW(Globals.lfFont.lfFaceName, systemW);
|
2006-09-16 02:11:47 +02:00
|
|
|
|
2009-05-27 23:49:13 +02:00
|
|
|
LoadStringW(Globals.hInstance, STRING_PAGESETUP_HEADERVALUE,
|
|
|
|
Globals.szHeader, ARRAY_SIZE(Globals.szHeader));
|
|
|
|
LoadStringW(Globals.hInstance, STRING_PAGESETUP_FOOTERVALUE,
|
|
|
|
Globals.szFooter, ARRAY_SIZE(Globals.szFooter));
|
2007-04-01 20:52:08 +02:00
|
|
|
|
2009-05-07 22:26:04 +02:00
|
|
|
if(RegOpenKeyW(HKEY_CURRENT_USER, notepad_reg_key, &hkey) == ERROR_SUCCESS)
|
2006-09-16 02:11:47 +02:00
|
|
|
{
|
2007-04-01 20:52:08 +02:00
|
|
|
WORD data_helper[MAX_PATH];
|
2006-09-16 02:11:47 +02:00
|
|
|
DWORD type, data, size;
|
|
|
|
|
2009-05-07 22:26:04 +02:00
|
|
|
#define QUERY_NOTEPAD_REG(hkey, value_name, ret) do { DWORD type, data; DWORD size = sizeof(DWORD); if(RegQueryValueExW(hkey, value_name, 0, &type, (LPBYTE)&data, &size) == ERROR_SUCCESS) if(type == REG_DWORD) ret = data; } while(0)
|
2006-09-16 02:11:47 +02:00
|
|
|
QUERY_NOTEPAD_REG(hkey, value_fWrap, Globals.bWrapLongLines);
|
2006-10-24 12:27:28 +02:00
|
|
|
QUERY_NOTEPAD_REG(hkey, value_iWindowPosX, main_rect.left);
|
|
|
|
QUERY_NOTEPAD_REG(hkey, value_iWindowPosY, main_rect.top);
|
|
|
|
QUERY_NOTEPAD_REG(hkey, value_iWindowPosDX, dx);
|
|
|
|
QUERY_NOTEPAD_REG(hkey, value_iWindowPosDY, dy);
|
2006-09-16 02:11:47 +02:00
|
|
|
QUERY_NOTEPAD_REG(hkey, value_lfCharSet, Globals.lfFont.lfCharSet);
|
|
|
|
QUERY_NOTEPAD_REG(hkey, value_lfClipPrecision, Globals.lfFont.lfClipPrecision);
|
|
|
|
QUERY_NOTEPAD_REG(hkey, value_lfEscapement, Globals.lfFont.lfEscapement);
|
|
|
|
QUERY_NOTEPAD_REG(hkey, value_lfItalic, Globals.lfFont.lfItalic);
|
|
|
|
QUERY_NOTEPAD_REG(hkey, value_lfOrientation, Globals.lfFont.lfOrientation);
|
|
|
|
QUERY_NOTEPAD_REG(hkey, value_lfOutPrecision, Globals.lfFont.lfOutPrecision);
|
|
|
|
QUERY_NOTEPAD_REG(hkey, value_lfPitchAndFamily, Globals.lfFont.lfPitchAndFamily);
|
|
|
|
QUERY_NOTEPAD_REG(hkey, value_lfQuality, Globals.lfFont.lfQuality);
|
|
|
|
QUERY_NOTEPAD_REG(hkey, value_lfStrikeOut, Globals.lfFont.lfStrikeOut);
|
|
|
|
QUERY_NOTEPAD_REG(hkey, value_lfUnderline, Globals.lfFont.lfUnderline);
|
|
|
|
QUERY_NOTEPAD_REG(hkey, value_lfWeight, Globals.lfFont.lfWeight);
|
2007-04-01 20:52:08 +02:00
|
|
|
QUERY_NOTEPAD_REG(hkey, value_iMarginTop, Globals.iMarginTop);
|
|
|
|
QUERY_NOTEPAD_REG(hkey, value_iMarginBottom, Globals.iMarginBottom);
|
|
|
|
QUERY_NOTEPAD_REG(hkey, value_iMarginLeft, Globals.iMarginLeft);
|
|
|
|
QUERY_NOTEPAD_REG(hkey, value_iMarginRight, Globals.iMarginRight);
|
2006-09-16 02:11:47 +02:00
|
|
|
#undef QUERY_NOTEPAD_REG
|
|
|
|
|
2006-10-24 12:27:28 +02:00
|
|
|
main_rect.right = main_rect.left + dx;
|
|
|
|
main_rect.bottom = main_rect.top + dy;
|
|
|
|
|
2006-09-16 02:11:47 +02:00
|
|
|
size = sizeof(DWORD);
|
2009-05-07 22:26:04 +02:00
|
|
|
if(RegQueryValueExW(hkey, value_iPointSize, 0, &type, (LPBYTE)&data, &size) == ERROR_SUCCESS)
|
2006-09-16 02:11:47 +02:00
|
|
|
if(type == REG_DWORD)
|
2007-04-01 16:23:31 +02:00
|
|
|
/* The value is stored as 10 * twips */
|
|
|
|
Globals.lfFont.lfHeight = -MulDiv(abs(data), get_dpi(), 720);
|
2006-09-16 02:11:47 +02:00
|
|
|
|
|
|
|
size = sizeof(Globals.lfFont.lfFaceName);
|
2009-05-07 22:26:04 +02:00
|
|
|
if(RegQueryValueExW(hkey, value_lfFaceName, 0, &type, (LPBYTE)&data_helper, &size) == ERROR_SUCCESS)
|
2006-09-16 02:11:47 +02:00
|
|
|
if(type == REG_SZ)
|
2009-05-07 22:25:33 +02:00
|
|
|
lstrcpyW(Globals.lfFont.lfFaceName, data_helper);
|
|
|
|
|
2007-04-01 20:52:08 +02:00
|
|
|
size = sizeof(Globals.szHeader);
|
2009-05-07 22:26:04 +02:00
|
|
|
if(RegQueryValueExW(hkey, value_szHeader, 0, &type, (LPBYTE)&data_helper, &size) == ERROR_SUCCESS)
|
2007-04-01 20:52:08 +02:00
|
|
|
if(type == REG_SZ)
|
2009-05-07 22:25:33 +02:00
|
|
|
lstrcpyW(Globals.szHeader, data_helper);
|
2007-04-01 20:52:08 +02:00
|
|
|
|
|
|
|
size = sizeof(Globals.szFooter);
|
2009-05-07 22:26:04 +02:00
|
|
|
if(RegQueryValueExW(hkey, value_szFooter, 0, &type, (LPBYTE)&data_helper, &size) == ERROR_SUCCESS)
|
2007-04-01 20:52:08 +02:00
|
|
|
if(type == REG_SZ)
|
2009-05-07 22:25:33 +02:00
|
|
|
lstrcpyW(Globals.szFooter, data_helper);
|
2006-09-16 02:11:47 +02:00
|
|
|
RegCloseKey(hkey);
|
|
|
|
}
|
2005-12-01 12:35:13 +01:00
|
|
|
}
|
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
/***********************************************************************
|
|
|
|
*
|
|
|
|
* NOTEPAD_MenuCommand
|
|
|
|
*
|
|
|
|
* All handling of main menu events
|
2000-07-23 16:22:47 +02:00
|
|
|
*/
|
2003-07-21 22:05:33 +02:00
|
|
|
static int NOTEPAD_MenuCommand(WPARAM wParam)
|
2000-07-23 16:22:47 +02:00
|
|
|
{
|
2002-07-08 21:41:09 +02:00
|
|
|
switch (wParam)
|
2000-07-23 16:22:47 +02:00
|
|
|
{
|
2002-07-08 21:41:09 +02:00
|
|
|
case CMD_NEW: DIALOG_FileNew(); break;
|
|
|
|
case CMD_OPEN: DIALOG_FileOpen(); break;
|
|
|
|
case CMD_SAVE: DIALOG_FileSave(); break;
|
|
|
|
case CMD_SAVE_AS: DIALOG_FileSaveAs(); break;
|
|
|
|
case CMD_PRINT: DIALOG_FilePrint(); break;
|
|
|
|
case CMD_PAGE_SETUP: DIALOG_FilePageSetup(); break;
|
|
|
|
case CMD_PRINTER_SETUP: DIALOG_FilePrinterSetup();break;
|
|
|
|
case CMD_EXIT: DIALOG_FileExit(); break;
|
|
|
|
|
|
|
|
case CMD_UNDO: DIALOG_EditUndo(); break;
|
|
|
|
case CMD_CUT: DIALOG_EditCut(); break;
|
|
|
|
case CMD_COPY: DIALOG_EditCopy(); break;
|
|
|
|
case CMD_PASTE: DIALOG_EditPaste(); break;
|
|
|
|
case CMD_DELETE: DIALOG_EditDelete(); break;
|
|
|
|
case CMD_SELECT_ALL: DIALOG_EditSelectAll(); break;
|
|
|
|
case CMD_TIME_DATE: DIALOG_EditTimeDate();break;
|
|
|
|
|
|
|
|
case CMD_SEARCH: DIALOG_Search(); break;
|
|
|
|
case CMD_SEARCH_NEXT: DIALOG_SearchNext(); break;
|
2009-04-25 17:53:58 +02:00
|
|
|
case CMD_REPLACE: DIALOG_Replace(); break;
|
2003-01-28 02:10:28 +01:00
|
|
|
|
|
|
|
case CMD_WRAP: DIALOG_EditWrap(); break;
|
|
|
|
case CMD_FONT: DIALOG_SelectFont(); break;
|
2002-07-08 21:41:09 +02:00
|
|
|
|
|
|
|
case CMD_HELP_CONTENTS: DIALOG_HelpContents(); break;
|
2008-03-28 18:53:31 +01:00
|
|
|
case CMD_HELP_ABOUT_NOTEPAD: DIALOG_HelpAboutNotepad(); break;
|
2003-07-21 22:05:33 +02:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2000-07-23 16:22:47 +02:00
|
|
|
}
|
2002-07-08 21:41:09 +02:00
|
|
|
return 0;
|
2000-07-23 16:22:47 +02:00
|
|
|
}
|
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* Data Initialization
|
2000-07-23 16:22:47 +02:00
|
|
|
*/
|
2003-07-21 22:05:33 +02:00
|
|
|
static VOID NOTEPAD_InitData(VOID)
|
2000-07-23 16:22:47 +02:00
|
|
|
{
|
2003-07-21 22:05:33 +02:00
|
|
|
LPWSTR p = Globals.szFilter;
|
|
|
|
static const WCHAR txt_files[] = { '*','.','t','x','t',0 };
|
|
|
|
static const WCHAR all_files[] = { '*','.','*',0 };
|
2002-07-08 21:41:09 +02:00
|
|
|
|
2009-05-18 21:08:20 +02:00
|
|
|
LoadStringW(Globals.hInstance, STRING_TEXT_FILES_TXT, p, MAX_STRING_LEN);
|
2009-05-07 22:25:33 +02:00
|
|
|
p += lstrlenW(p) + 1;
|
|
|
|
lstrcpyW(p, txt_files);
|
|
|
|
p += lstrlenW(p) + 1;
|
2009-05-18 21:08:20 +02:00
|
|
|
LoadStringW(Globals.hInstance, STRING_ALL_FILES, p, MAX_STRING_LEN);
|
2009-05-07 22:25:33 +02:00
|
|
|
p += lstrlenW(p) + 1;
|
|
|
|
lstrcpyW(p, all_files);
|
|
|
|
p += lstrlenW(p) + 1;
|
2002-07-08 21:41:09 +02:00
|
|
|
*p = '\0';
|
2005-12-08 11:57:58 +01:00
|
|
|
Globals.hDevMode = NULL;
|
|
|
|
Globals.hDevNames = NULL;
|
2006-02-28 14:35:40 +01:00
|
|
|
|
|
|
|
CheckMenuItem(GetMenu(Globals.hMainWnd), CMD_WRAP,
|
|
|
|
MF_BYCOMMAND | (Globals.bWrapLongLines ? MF_CHECKED : MF_UNCHECKED));
|
2000-07-23 16:22:47 +02:00
|
|
|
}
|
|
|
|
|
2005-05-13 15:55:32 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* Enable/disable items on the menu based on control state
|
|
|
|
*/
|
|
|
|
static VOID NOTEPAD_InitMenuPopup(HMENU menu, int index)
|
|
|
|
{
|
|
|
|
int enable;
|
|
|
|
|
|
|
|
EnableMenuItem(menu, CMD_UNDO,
|
2009-05-05 12:18:43 +02:00
|
|
|
SendMessageW(Globals.hEdit, EM_CANUNDO, 0, 0) ? MF_ENABLED : MF_GRAYED);
|
2005-05-13 15:55:32 +02:00
|
|
|
EnableMenuItem(menu, CMD_PASTE,
|
|
|
|
IsClipboardFormatAvailable(CF_TEXT) ? MF_ENABLED : MF_GRAYED);
|
2009-05-05 12:18:43 +02:00
|
|
|
enable = SendMessageW(Globals.hEdit, EM_GETSEL, 0, 0);
|
2005-05-13 15:55:32 +02:00
|
|
|
enable = (HIWORD(enable) == LOWORD(enable)) ? MF_GRAYED : MF_ENABLED;
|
|
|
|
EnableMenuItem(menu, CMD_CUT, enable);
|
|
|
|
EnableMenuItem(menu, CMD_COPY, enable);
|
|
|
|
EnableMenuItem(menu, CMD_DELETE, enable);
|
|
|
|
|
|
|
|
EnableMenuItem(menu, CMD_SELECT_ALL,
|
2009-05-18 21:08:20 +02:00
|
|
|
GetWindowTextLengthW(Globals.hEdit) ? MF_ENABLED : MF_GRAYED);
|
2005-05-13 15:55:32 +02:00
|
|
|
}
|
|
|
|
|
2009-05-07 11:08:48 +02:00
|
|
|
static LPWSTR NOTEPAD_StrRStr(LPWSTR pszSource, LPWSTR pszLast, LPWSTR pszSrch)
|
2006-10-22 18:58:12 +02:00
|
|
|
{
|
2009-05-07 22:25:33 +02:00
|
|
|
int len = lstrlenW(pszSrch);
|
2006-10-22 18:58:12 +02:00
|
|
|
pszLast--;
|
|
|
|
while (pszLast >= pszSource)
|
|
|
|
{
|
2009-05-07 22:25:33 +02:00
|
|
|
if (StrCmpNW(pszLast, pszSrch, len) == 0)
|
2006-10-22 18:58:12 +02:00
|
|
|
return pszLast;
|
|
|
|
pszLast--;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* The user activated the Find dialog
|
|
|
|
*/
|
2009-05-07 11:08:48 +02:00
|
|
|
void NOTEPAD_DoFind(FINDREPLACEW *fr)
|
2006-10-22 18:58:12 +02:00
|
|
|
{
|
2009-05-07 11:08:48 +02:00
|
|
|
LPWSTR content;
|
|
|
|
LPWSTR found;
|
2009-05-07 22:25:33 +02:00
|
|
|
int len = lstrlenW(fr->lpstrFindWhat);
|
2006-10-22 18:58:12 +02:00
|
|
|
int fileLen;
|
|
|
|
DWORD pos;
|
2009-05-07 11:08:48 +02:00
|
|
|
|
2009-05-18 21:08:20 +02:00
|
|
|
fileLen = GetWindowTextLengthW(Globals.hEdit) + 1;
|
2009-05-07 11:08:48 +02:00
|
|
|
content = HeapAlloc(GetProcessHeap(), 0, fileLen * sizeof(WCHAR));
|
2006-10-22 18:58:12 +02:00
|
|
|
if (!content) return;
|
2009-05-18 21:08:20 +02:00
|
|
|
GetWindowTextW(Globals.hEdit, content, fileLen);
|
2006-10-22 18:58:12 +02:00
|
|
|
|
2009-05-05 12:18:43 +02:00
|
|
|
SendMessageW(Globals.hEdit, EM_GETSEL, 0, (LPARAM)&pos);
|
2006-10-22 18:58:12 +02:00
|
|
|
switch (fr->Flags & (FR_DOWN|FR_MATCHCASE))
|
|
|
|
{
|
|
|
|
case 0:
|
2009-05-07 22:25:33 +02:00
|
|
|
found = StrRStrIW(content, content+pos-len, fr->lpstrFindWhat);
|
2006-10-22 18:58:12 +02:00
|
|
|
break;
|
|
|
|
case FR_DOWN:
|
2009-05-07 22:25:33 +02:00
|
|
|
found = StrStrIW(content+pos, fr->lpstrFindWhat);
|
2006-10-22 18:58:12 +02:00
|
|
|
break;
|
|
|
|
case FR_MATCHCASE:
|
|
|
|
found = NOTEPAD_StrRStr(content, content+pos-len, fr->lpstrFindWhat);
|
|
|
|
break;
|
|
|
|
case FR_DOWN|FR_MATCHCASE:
|
2009-05-07 22:25:33 +02:00
|
|
|
found = StrStrW(content+pos, fr->lpstrFindWhat);
|
2006-10-22 18:58:12 +02:00
|
|
|
break;
|
|
|
|
default: /* shouldn't happen */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
HeapFree(GetProcessHeap(), 0, content);
|
|
|
|
|
|
|
|
if (found == NULL)
|
|
|
|
{
|
|
|
|
DIALOG_StringMsgBox(Globals.hFindReplaceDlg, STRING_NOTFOUND, fr->lpstrFindWhat,
|
|
|
|
MB_ICONINFORMATION|MB_OK);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-05-05 12:18:43 +02:00
|
|
|
SendMessageW(Globals.hEdit, EM_SETSEL, found - content, found - content + len);
|
2006-10-22 18:58:12 +02:00
|
|
|
}
|
|
|
|
|
2009-05-07 11:08:48 +02:00
|
|
|
static void NOTEPAD_DoReplace(FINDREPLACEW *fr)
|
2009-04-25 17:53:58 +02:00
|
|
|
{
|
2009-05-07 11:08:48 +02:00
|
|
|
LPWSTR content;
|
2009-05-07 22:25:33 +02:00
|
|
|
int len = lstrlenW(fr->lpstrFindWhat);
|
2009-04-25 17:53:58 +02:00
|
|
|
int fileLen;
|
|
|
|
DWORD pos;
|
|
|
|
DWORD pos_start;
|
|
|
|
|
2009-05-18 21:08:20 +02:00
|
|
|
fileLen = GetWindowTextLengthW(Globals.hEdit) + 1;
|
2009-05-07 11:08:48 +02:00
|
|
|
content = HeapAlloc(GetProcessHeap(), 0, fileLen * sizeof(WCHAR));
|
2009-04-25 17:53:58 +02:00
|
|
|
if (!content) return;
|
2009-05-18 21:08:20 +02:00
|
|
|
GetWindowTextW(Globals.hEdit, content, fileLen);
|
2009-04-25 17:53:58 +02:00
|
|
|
|
2009-05-05 12:18:43 +02:00
|
|
|
SendMessageW(Globals.hEdit, EM_GETSEL, (WPARAM)&pos_start, (LPARAM)&pos);
|
2009-04-25 17:53:58 +02:00
|
|
|
switch (fr->Flags & (FR_DOWN|FR_MATCHCASE))
|
|
|
|
{
|
|
|
|
case FR_DOWN:
|
2009-05-07 22:25:33 +02:00
|
|
|
if ( pos-pos_start == len && StrCmpNIW(fr->lpstrFindWhat, content+pos_start, len) == 0)
|
2009-05-05 12:18:43 +02:00
|
|
|
SendMessageW(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)fr->lpstrReplaceWith);
|
2009-04-25 17:53:58 +02:00
|
|
|
break;
|
|
|
|
case FR_DOWN|FR_MATCHCASE:
|
2009-05-07 22:25:33 +02:00
|
|
|
if ( pos-pos_start == len && StrCmpNW(fr->lpstrFindWhat, content+pos_start, len) == 0)
|
2009-05-05 12:18:43 +02:00
|
|
|
SendMessageW(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)fr->lpstrReplaceWith);
|
2009-04-25 17:53:58 +02:00
|
|
|
break;
|
|
|
|
default: /* shouldn't happen */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
HeapFree(GetProcessHeap(), 0, content);
|
|
|
|
|
|
|
|
NOTEPAD_DoFind(fr);
|
|
|
|
}
|
|
|
|
|
2009-05-07 11:08:48 +02:00
|
|
|
static void NOTEPAD_DoReplaceAll(FINDREPLACEW *fr)
|
2009-04-25 17:53:58 +02:00
|
|
|
{
|
2009-05-07 11:08:48 +02:00
|
|
|
LPWSTR content;
|
|
|
|
LPWSTR found;
|
2009-05-07 22:25:33 +02:00
|
|
|
int len = lstrlenW(fr->lpstrFindWhat);
|
2009-04-25 17:53:58 +02:00
|
|
|
int fileLen;
|
|
|
|
DWORD pos;
|
|
|
|
|
2009-05-05 12:18:43 +02:00
|
|
|
SendMessageW(Globals.hEdit, EM_SETSEL, 0, 0);
|
2009-04-25 17:53:58 +02:00
|
|
|
while(TRUE){
|
2009-05-18 21:08:20 +02:00
|
|
|
fileLen = GetWindowTextLengthW(Globals.hEdit) + 1;
|
2009-05-07 11:08:48 +02:00
|
|
|
content = HeapAlloc(GetProcessHeap(), 0, fileLen * sizeof(WCHAR));
|
2009-04-25 17:53:58 +02:00
|
|
|
if (!content) return;
|
2009-05-18 21:08:20 +02:00
|
|
|
GetWindowTextW(Globals.hEdit, content, fileLen);
|
2009-04-25 17:53:58 +02:00
|
|
|
|
2009-05-05 12:18:43 +02:00
|
|
|
SendMessageW(Globals.hEdit, EM_GETSEL, 0, (LPARAM)&pos);
|
2009-04-25 17:53:58 +02:00
|
|
|
switch (fr->Flags & (FR_DOWN|FR_MATCHCASE))
|
|
|
|
{
|
|
|
|
case FR_DOWN:
|
2009-05-07 22:25:33 +02:00
|
|
|
found = StrStrIW(content+pos, fr->lpstrFindWhat);
|
2009-04-25 17:53:58 +02:00
|
|
|
break;
|
|
|
|
case FR_DOWN|FR_MATCHCASE:
|
2009-05-07 22:25:33 +02:00
|
|
|
found = StrStrW(content+pos, fr->lpstrFindWhat);
|
2009-04-25 17:53:58 +02:00
|
|
|
break;
|
|
|
|
default: /* shouldn't happen */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
HeapFree(GetProcessHeap(), 0, content);
|
|
|
|
|
|
|
|
if(found == NULL)
|
|
|
|
{
|
2009-05-05 12:18:43 +02:00
|
|
|
SendMessageW(Globals.hEdit, EM_SETSEL, 0, 0);
|
2009-04-25 17:53:58 +02:00
|
|
|
return;
|
|
|
|
}
|
2009-05-05 12:18:43 +02:00
|
|
|
SendMessageW(Globals.hEdit, EM_SETSEL, found - content, found - content + len);
|
|
|
|
SendMessageW(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)fr->lpstrReplaceWith);
|
2009-04-25 17:53:58 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
/***********************************************************************
|
|
|
|
*
|
|
|
|
* NOTEPAD_WndProc
|
2000-07-23 16:22:47 +02:00
|
|
|
*/
|
2003-07-21 22:05:33 +02:00
|
|
|
static LRESULT WINAPI NOTEPAD_WndProc(HWND hWnd, UINT msg, WPARAM wParam,
|
2002-07-08 21:41:09 +02:00
|
|
|
LPARAM lParam)
|
2000-07-23 16:22:47 +02:00
|
|
|
{
|
2006-10-22 18:58:12 +02:00
|
|
|
if (msg == aFINDMSGSTRING) /* not a constant so can't be used in switch */
|
|
|
|
{
|
2009-05-07 11:08:48 +02:00
|
|
|
FINDREPLACEW *fr = (FINDREPLACEW *)lParam;
|
|
|
|
|
2006-10-22 18:58:12 +02:00
|
|
|
if (fr->Flags & FR_DIALOGTERM)
|
|
|
|
Globals.hFindReplaceDlg = NULL;
|
|
|
|
if (fr->Flags & FR_FINDNEXT)
|
|
|
|
{
|
|
|
|
Globals.lastFind = *fr;
|
|
|
|
NOTEPAD_DoFind(fr);
|
|
|
|
}
|
2009-04-25 17:53:58 +02:00
|
|
|
if (fr->Flags & FR_REPLACE)
|
|
|
|
{
|
|
|
|
Globals.lastFind = *fr;
|
|
|
|
NOTEPAD_DoReplace(fr);
|
|
|
|
}
|
|
|
|
if (fr->Flags & FR_REPLACEALL)
|
|
|
|
{
|
|
|
|
Globals.lastFind = *fr;
|
|
|
|
NOTEPAD_DoReplaceAll(fr);
|
|
|
|
}
|
2006-10-22 18:58:12 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
switch (msg) {
|
2000-07-23 16:22:47 +02:00
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
case WM_CREATE:
|
2000-07-23 16:22:47 +02:00
|
|
|
{
|
2003-07-21 22:05:33 +02:00
|
|
|
static const WCHAR editW[] = { 'e','d','i','t',0 };
|
2006-02-28 14:35:40 +01:00
|
|
|
DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL |
|
2006-10-22 18:58:12 +02:00
|
|
|
ES_AUTOVSCROLL | ES_MULTILINE | ES_NOHIDESEL;
|
2002-07-08 21:41:09 +02:00
|
|
|
RECT rc;
|
|
|
|
GetClientRect(hWnd, &rc);
|
2006-02-28 14:35:40 +01:00
|
|
|
|
|
|
|
if (!Globals.bWrapLongLines) dwStyle |= WS_HSCROLL | ES_AUTOHSCROLL;
|
|
|
|
|
2009-05-18 21:08:20 +02:00
|
|
|
Globals.hEdit = CreateWindowExW(WS_EX_CLIENTEDGE, editW, NULL,
|
|
|
|
dwStyle, 0, 0, rc.right, rc.bottom, hWnd,
|
2002-07-16 03:09:24 +02:00
|
|
|
NULL, Globals.hInstance, NULL);
|
2006-09-16 02:11:47 +02:00
|
|
|
|
2009-05-18 21:08:20 +02:00
|
|
|
Globals.hFont = CreateFontIndirectW(&Globals.lfFont);
|
2009-05-05 12:18:43 +02:00
|
|
|
SendMessageW(Globals.hEdit, WM_SETFONT, (WPARAM)Globals.hFont, FALSE);
|
2010-02-10 11:54:42 +01:00
|
|
|
SendMessageW(Globals.hEdit, EM_LIMITTEXT, 0, 0);
|
2000-07-23 16:22:47 +02:00
|
|
|
break;
|
2002-07-08 21:41:09 +02:00
|
|
|
}
|
2000-07-23 16:22:47 +02:00
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
case WM_COMMAND:
|
2003-01-28 02:10:28 +01:00
|
|
|
NOTEPAD_MenuCommand(LOWORD(wParam));
|
2000-07-23 16:22:47 +02:00
|
|
|
break;
|
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
case WM_DESTROYCLIPBOARD:
|
2009-05-18 21:08:20 +02:00
|
|
|
/*MessageBoxW(Globals.hMainWnd, "Empty clipboard", "Debug", MB_ICONEXCLAMATION);*/
|
2000-07-23 16:22:47 +02:00
|
|
|
break;
|
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
case WM_CLOSE:
|
|
|
|
if (DoCloseFile()) {
|
2002-07-16 03:09:24 +02:00
|
|
|
DestroyWindow(hWnd);
|
2002-07-08 21:41:09 +02:00
|
|
|
}
|
2000-07-23 16:22:47 +02:00
|
|
|
break;
|
|
|
|
|
2004-10-08 22:49:24 +02:00
|
|
|
case WM_QUERYENDSESSION:
|
|
|
|
if (DoCloseFile()) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
case WM_DESTROY:
|
2006-09-16 02:11:47 +02:00
|
|
|
NOTEPAD_SaveSettingToRegistry();
|
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
PostQuitMessage(0);
|
2000-07-23 16:22:47 +02:00
|
|
|
break;
|
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
case WM_SIZE:
|
2002-07-16 03:09:24 +02:00
|
|
|
SetWindowPos(Globals.hEdit, NULL, 0, 0, LOWORD(lParam), HIWORD(lParam),
|
2002-07-08 21:41:09 +02:00
|
|
|
SWP_NOOWNERZORDER | SWP_NOZORDER);
|
|
|
|
break;
|
2000-07-23 16:22:47 +02:00
|
|
|
|
2003-07-21 22:05:33 +02:00
|
|
|
case WM_SETFOCUS:
|
|
|
|
SetFocus(Globals.hEdit);
|
|
|
|
break;
|
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
case WM_DROPFILES:
|
2000-07-23 16:22:47 +02:00
|
|
|
{
|
2003-07-21 22:05:33 +02:00
|
|
|
WCHAR szFileName[MAX_PATH];
|
2002-07-08 21:41:09 +02:00
|
|
|
HANDLE hDrop = (HANDLE) wParam;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2009-05-27 23:48:57 +02:00
|
|
|
DragQueryFileW(hDrop, 0, szFileName, ARRAY_SIZE(szFileName));
|
2002-07-08 21:41:09 +02:00
|
|
|
DragFinish(hDrop);
|
2009-06-30 00:50:39 +02:00
|
|
|
DoOpenFile(szFileName, ENCODING_AUTO);
|
2000-07-23 16:22:47 +02:00
|
|
|
break;
|
|
|
|
}
|
2005-05-13 15:55:32 +02:00
|
|
|
|
|
|
|
case WM_INITMENUPOPUP:
|
|
|
|
NOTEPAD_InitMenuPopup((HMENU)wParam, lParam);
|
|
|
|
break;
|
2000-07-23 16:22:47 +02:00
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
default:
|
2009-05-18 21:08:20 +02:00
|
|
|
return DefWindowProcW(hWnd, msg, wParam, lParam);
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
}
|
2002-07-08 21:41:09 +02:00
|
|
|
return 0;
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
}
|
|
|
|
|
2003-07-21 22:05:33 +02:00
|
|
|
static int AlertFileDoesNotExist(LPCWSTR szFileName)
|
|
|
|
{
|
2002-02-19 19:38:22 +01:00
|
|
|
int nResult;
|
2003-07-21 22:05:33 +02:00
|
|
|
WCHAR szMessage[MAX_STRING_LEN];
|
|
|
|
WCHAR szResource[MAX_STRING_LEN];
|
2002-02-19 19:38:22 +01:00
|
|
|
|
2009-05-27 23:48:57 +02:00
|
|
|
LoadStringW(Globals.hInstance, STRING_DOESNOTEXIST, szResource, ARRAY_SIZE(szResource));
|
2009-05-07 22:25:33 +02:00
|
|
|
wsprintfW(szMessage, szResource, szFileName);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2009-05-27 23:48:57 +02:00
|
|
|
LoadStringW(Globals.hInstance, STRING_ERROR, szResource, ARRAY_SIZE(szResource));
|
2002-02-19 19:38:22 +01:00
|
|
|
|
2009-05-18 21:08:20 +02:00
|
|
|
nResult = MessageBoxW(Globals.hMainWnd, szMessage, szResource,
|
2009-07-07 20:31:48 +02:00
|
|
|
MB_ICONEXCLAMATION | MB_YESNOCANCEL);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2002-02-19 19:38:22 +01:00
|
|
|
return(nResult);
|
|
|
|
}
|
|
|
|
|
2003-07-21 22:05:33 +02:00
|
|
|
static void HandleCommandLine(LPWSTR cmdline)
|
2002-02-19 19:38:22 +01:00
|
|
|
{
|
2017-01-31 04:31:33 +01:00
|
|
|
WCHAR delimiter, *ptr;
|
2014-02-27 15:33:26 +01:00
|
|
|
BOOL opt_print = FALSE;
|
|
|
|
|
2003-07-21 22:05:33 +02:00
|
|
|
/* skip white space */
|
2004-08-30 21:29:13 +02:00
|
|
|
while (*cmdline == ' ') cmdline++;
|
2003-07-21 22:05:33 +02:00
|
|
|
|
|
|
|
/* skip executable name */
|
2004-08-30 21:29:13 +02:00
|
|
|
delimiter = (*cmdline == '"' ? '"' : ' ');
|
2003-07-21 22:05:33 +02:00
|
|
|
|
2005-10-26 12:07:31 +02:00
|
|
|
if (*cmdline == delimiter) cmdline++;
|
|
|
|
|
|
|
|
while (*cmdline && *cmdline != delimiter) cmdline++;
|
|
|
|
|
2003-07-21 22:05:33 +02:00
|
|
|
if (*cmdline == delimiter) cmdline++;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2019-10-21 17:11:08 +02:00
|
|
|
while (*cmdline == ' ') cmdline++;
|
|
|
|
|
2017-01-31 04:31:33 +01:00
|
|
|
ptr = cmdline;
|
|
|
|
while (*ptr == ' ' || *ptr == '-' || *ptr == '/')
|
2002-02-19 19:38:22 +01:00
|
|
|
{
|
2003-07-21 22:05:33 +02:00
|
|
|
WCHAR option;
|
2002-02-19 19:38:22 +01:00
|
|
|
|
2017-01-31 04:31:33 +01:00
|
|
|
if (*ptr++ == ' ') continue;
|
2002-02-19 19:38:22 +01:00
|
|
|
|
2017-01-31 04:31:33 +01:00
|
|
|
option = *ptr;
|
|
|
|
if (option) ptr++;
|
|
|
|
while (*ptr == ' ') ptr++;
|
2002-02-19 19:38:22 +01:00
|
|
|
|
|
|
|
switch(option)
|
|
|
|
{
|
|
|
|
case 'p':
|
2004-08-30 21:29:13 +02:00
|
|
|
case 'P':
|
2017-01-31 04:31:33 +01:00
|
|
|
{
|
|
|
|
if (!opt_print)
|
|
|
|
{
|
|
|
|
opt_print = TRUE;
|
|
|
|
cmdline = ptr;
|
|
|
|
}
|
2004-08-30 21:29:13 +02:00
|
|
|
break;
|
2017-01-31 04:31:33 +01:00
|
|
|
}
|
2002-02-19 19:38:22 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
if (*cmdline)
|
2002-02-19 19:38:22 +01:00
|
|
|
{
|
|
|
|
/* file name is passed in the command line */
|
2003-07-21 22:05:33 +02:00
|
|
|
LPCWSTR file_name;
|
2002-02-19 19:38:22 +01:00
|
|
|
BOOL file_exists;
|
2003-07-21 22:05:33 +02:00
|
|
|
WCHAR buf[MAX_PATH];
|
2002-02-19 19:38:22 +01:00
|
|
|
|
2002-08-15 23:46:15 +02:00
|
|
|
if (cmdline[0] == '"')
|
|
|
|
{
|
2008-06-10 10:20:19 +02:00
|
|
|
WCHAR* wc;
|
2002-08-15 23:46:15 +02:00
|
|
|
cmdline++;
|
2008-06-10 10:20:19 +02:00
|
|
|
wc=cmdline;
|
|
|
|
/* Note: Double-quotes are not allowed in Windows filenames */
|
|
|
|
while (*wc && *wc != '"') wc++;
|
|
|
|
/* On Windows notepad ignores further arguments too */
|
|
|
|
*wc = 0;
|
2002-08-15 23:46:15 +02:00
|
|
|
}
|
2003-07-21 22:05:33 +02:00
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
if (FileExists(cmdline))
|
2002-02-19 19:38:22 +01:00
|
|
|
{
|
|
|
|
file_exists = TRUE;
|
|
|
|
file_name = cmdline;
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
else
|
2002-02-19 19:38:22 +01:00
|
|
|
{
|
2003-07-21 22:05:33 +02:00
|
|
|
static const WCHAR txtW[] = { '.','t','x','t',0 };
|
|
|
|
|
2003-08-18 22:11:29 +02:00
|
|
|
/* try to find file with ".txt" extension */
|
2019-04-01 11:42:31 +02:00
|
|
|
if (wcschr(PathFindFileNameW(cmdline), '.'))
|
2002-02-19 19:38:22 +01:00
|
|
|
{
|
|
|
|
file_exists = FALSE;
|
|
|
|
file_name = cmdline;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-05-07 22:25:33 +02:00
|
|
|
lstrcpynW(buf, cmdline, MAX_PATH - lstrlenW(txtW) - 1);
|
|
|
|
lstrcatW(buf, txtW);
|
2002-02-19 19:38:22 +01:00
|
|
|
file_name = buf;
|
|
|
|
file_exists = FileExists(buf);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (file_exists)
|
|
|
|
{
|
2009-06-30 00:50:39 +02:00
|
|
|
DoOpenFile(file_name, ENCODING_AUTO);
|
2002-02-19 19:38:22 +01:00
|
|
|
InvalidateRect(Globals.hMainWnd, NULL, FALSE);
|
2004-08-30 21:29:13 +02:00
|
|
|
if (opt_print)
|
|
|
|
DIALOG_FilePrint();
|
2002-02-19 19:38:22 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch (AlertFileDoesNotExist(file_name)) {
|
|
|
|
case IDYES:
|
2015-08-25 06:57:58 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
HANDLE file;
|
2009-06-30 00:03:53 +02:00
|
|
|
SetFileNameAndEncoding(file_name, ENCODING_ANSI);
|
2015-08-25 06:57:58 +02:00
|
|
|
|
|
|
|
file = CreateFileW(file_name, GENERIC_WRITE, FILE_SHARE_WRITE,
|
|
|
|
NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
|
|
|
if (file != INVALID_HANDLE_VALUE) CloseHandle(file);
|
|
|
|
|
2009-06-30 22:25:02 +02:00
|
|
|
UpdateWindowCaption();
|
2002-02-19 19:38:22 +01:00
|
|
|
break;
|
2015-08-25 06:57:58 +02:00
|
|
|
}
|
2002-02-19 19:38:22 +01:00
|
|
|
|
|
|
|
case IDNO:
|
|
|
|
break;
|
2009-07-07 20:31:48 +02:00
|
|
|
|
|
|
|
case IDCANCEL:
|
|
|
|
DestroyWindow(Globals.hMainWnd);
|
|
|
|
break;
|
2002-02-19 19:38:22 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
*
|
|
|
|
* WinMain
|
|
|
|
*/
|
2002-07-08 21:41:09 +02:00
|
|
|
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
{
|
2009-05-07 11:08:48 +02:00
|
|
|
MSG msg;
|
|
|
|
HACCEL hAccel;
|
|
|
|
WNDCLASSEXW class;
|
2006-10-24 12:27:28 +02:00
|
|
|
HMONITOR monitor;
|
|
|
|
MONITORINFO info;
|
|
|
|
INT x, y;
|
2006-07-07 00:40:47 +02:00
|
|
|
static const WCHAR className[] = {'N','o','t','e','p','a','d',0};
|
2003-07-21 22:05:33 +02:00
|
|
|
static const WCHAR winName[] = {'N','o','t','e','p','a','d',0};
|
|
|
|
|
2009-05-18 21:08:20 +02:00
|
|
|
aFINDMSGSTRING = RegisterWindowMessageW(FINDMSGSTRINGW);
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
ZeroMemory(&Globals, sizeof(Globals));
|
1998-10-18 16:11:42 +02:00
|
|
|
Globals.hInstance = hInstance;
|
2006-09-16 02:11:47 +02:00
|
|
|
NOTEPAD_LoadSettingFromRegistry();
|
1999-02-14 12:28:37 +01:00
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
ZeroMemory(&class, sizeof(class));
|
|
|
|
class.cbSize = sizeof(class);
|
|
|
|
class.lpfnWndProc = NOTEPAD_WndProc;
|
|
|
|
class.hInstance = Globals.hInstance;
|
2009-05-18 21:07:49 +02:00
|
|
|
class.hIcon = LoadIconW(Globals.hInstance, MAKEINTRESOURCEW(IDI_NOTEPAD));
|
2010-04-19 20:12:34 +02:00
|
|
|
class.hIconSm = LoadImageW(Globals.hInstance, MAKEINTRESOURCEW(IDI_NOTEPAD), IMAGE_ICON,
|
|
|
|
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON),
|
|
|
|
LR_SHARED);
|
2009-05-18 21:07:49 +02:00
|
|
|
class.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW);
|
2005-09-20 14:02:45 +02:00
|
|
|
class.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
|
2009-05-18 21:07:49 +02:00
|
|
|
class.lpszMenuName = MAKEINTRESOURCEW(MAIN_MENU);
|
2002-07-08 21:41:09 +02:00
|
|
|
class.lpszClassName = className;
|
1998-03-29 21:44:57 +02:00
|
|
|
|
2009-05-18 21:08:20 +02:00
|
|
|
if (!RegisterClassExW(&class)) return FALSE;
|
1999-02-14 12:28:37 +01:00
|
|
|
|
|
|
|
/* Setup windows */
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
|
2006-10-24 12:27:28 +02:00
|
|
|
monitor = MonitorFromRect( &main_rect, MONITOR_DEFAULTTOPRIMARY );
|
|
|
|
info.cbSize = sizeof(info);
|
|
|
|
GetMonitorInfoW( monitor, &info );
|
|
|
|
|
|
|
|
x = main_rect.left;
|
|
|
|
y = main_rect.top;
|
|
|
|
if (main_rect.left >= info.rcWork.right ||
|
|
|
|
main_rect.top >= info.rcWork.bottom ||
|
|
|
|
main_rect.right < info.rcWork.left ||
|
|
|
|
main_rect.bottom < info.rcWork.top)
|
|
|
|
x = y = CW_USEDEFAULT;
|
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
Globals.hMainWnd =
|
2009-05-18 21:08:20 +02:00
|
|
|
CreateWindowW(className, winName, WS_OVERLAPPEDWINDOW, x, y,
|
|
|
|
main_rect.right - main_rect.left, main_rect.bottom - main_rect.top,
|
|
|
|
NULL, NULL, Globals.hInstance, NULL);
|
2002-07-16 03:09:24 +02:00
|
|
|
if (!Globals.hMainWnd)
|
|
|
|
{
|
|
|
|
ShowLastError();
|
|
|
|
ExitProcess(1);
|
|
|
|
}
|
1999-02-14 12:28:37 +01:00
|
|
|
|
2002-11-15 05:13:46 +01:00
|
|
|
NOTEPAD_InitData();
|
|
|
|
DIALOG_FileNew();
|
|
|
|
|
2002-07-08 21:41:09 +02:00
|
|
|
ShowWindow(Globals.hMainWnd, show);
|
|
|
|
UpdateWindow(Globals.hMainWnd);
|
1998-10-18 16:11:42 +02:00
|
|
|
DragAcceptFiles(Globals.hMainWnd, TRUE);
|
|
|
|
|
2009-05-18 21:08:20 +02:00
|
|
|
HandleCommandLine(GetCommandLineW());
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2009-05-18 21:07:49 +02:00
|
|
|
hAccel = LoadAcceleratorsW(hInstance, MAKEINTRESOURCEW(ID_ACCEL));
|
2003-01-28 02:10:28 +01:00
|
|
|
|
2009-05-18 21:08:20 +02:00
|
|
|
while (GetMessageW(&msg, 0, 0, 0))
|
2003-01-28 02:10:28 +01:00
|
|
|
{
|
2014-05-21 18:18:03 +02:00
|
|
|
if (!IsDialogMessageW(Globals.hFindReplaceDlg, &msg) && !TranslateAcceleratorW(Globals.hMainWnd, hAccel, &msg))
|
2003-07-21 22:05:33 +02:00
|
|
|
{
|
|
|
|
TranslateMessage(&msg);
|
2009-05-18 21:08:20 +02:00
|
|
|
DispatchMessageW(&msg);
|
2003-07-21 22:05:33 +02:00
|
|
|
}
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
}
|
2002-07-08 21:41:09 +02:00
|
|
|
return msg.wParam;
|
Release 980104
Sat Jan 3 17:15:56 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/db_disasm.c]
Added cpuid and cmpxchg instructions.
* [if1632/builtin.c] [relay32/builtin32.c]
Fixed broken -dll option with Win32 DLLs.
* [include/heap.h]
Added SYSTEM_LOCK/SYSTEM_UNLOCK macros.
* [configure.in] [misc/lstr.c]
Added check for wctype.h.
Commented out --enable-ipc option (IPC code has been broken for a
long time anyway).
* [scheduler/critsection.c] [scheduler/event.c]
[scheduler/mutex.c] [scheduler/semaphore.c]
Implemented Win32 synchronization objects.
* [scheduler/synchro.c]
Implemented WaitForMultipleObjects and related functions.
* [scheduler/thread.c]
If possible, use clone() in CreateThread().
* [scheduler/thread.c] [scheduler/process.c]
Made thread and process waitable objects.
Thread and process id values are now different from the pointers
they represent.
* [win32/k32obj.c]
Moved to scheduler directory.
Added function table for waiting operations on objects.
* [files/file.c] [memory/virtual.c]
Added new K32OBJ function table.
Sun Jan 1 16:48:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed my patch for GetTempFileName16() as needed.
It was ...Name32A() that didn't work properly, not ...Name16().
* [graphics/x11drv/brush.c]
Fixed a BadMatch error.
* [msdos/int21.c]
Fixed INT21_FindNextFCB() to get correct volume labels e.g.
in "file open" dialog.
* [multimedia/joystick.c] [relay32/winmm.spec]
Stub JoyGetPosEx().
* [scheduler/process.c] [relay32/kernel32.spec]
Implemented RegisterServiceProcess().
Wed Dec 31 11:14:43 1997 Lawson Whitney <lawson_whitney@juno.com>
* [if1632/kernel.spec] [if1632/relay.c]
Define CallProcEx32w - Thanks to Marcus Meissner for his excellent
CallProc32W.
* [loader/module.c]
Take a shot at defining FreeLibrary32W.
Sun Dec 28 12:44:04 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [controls/menu.c]
Menu modification from WM_INITMENUPOPUP message fixed.
Menu items now can have different wID and hSubMenu (Win95 behavior).
* [misc/cpu.c]
Improved IsProcessorFeaturePresent.
Sun Dec 28 03:21:08 1997 Ove Kaaven <ovek@main.arcticnet.no>
* [include/winsock.h] [misc/winsock.c]
Fixed WS_SOL_SOCKET for setsockopt(), and made select() return
empty fd_sets if timeout.
* [objects/palette.c]
AnimatePalette() bailed out if entire palette is animated. Fixed.
* [objects/dib.c]
Added some code to SetDIBitsToDevice() and its helpers to fix
some offseting problems.
* [objects/cursoricon.c]
Made CreateCursor32() convert the instance handle properly. Made
DestroyCursor() return correct success status.
Wed Dec 24 17:56:34 1997 Dimitrie O. Paun <dimi@cs.toronto.edu>
* [windows/syscolor.c]
Added definition of GetSysColorPen16/32. This function does not
exist in the Win32 API but is a very close (and natural) relative
to GetSysColorBrush function. Moreover, it is *very* much used
within Wine since there are a lot of places where we need to draw
lines with the standard colors.
* [controls/button.c] [controls/combo.c] [controls/icontitle.c]
[controls/menu.c] [controls/progress.c] [controls/scroll.c]
[controls/updown.c] [graphics/painting.c] [misc/tweak.c]
[windows/defwnd.c] [windows/graphics.c] [windows/nonclient.c]
Replaced references to sysColorObjects with the appropriate
call to GetSysColorBrush32/GetSysColorPen32. There is no need to
expose the implementation of these functions, even within Wine.
This makes the code easier to understand, debug, maintain.
* [controls/uitools.c]
Modified most of the functions in this file to use the now
standard pens (i.e. GetSysColorPen32). These functions made
*heavy* use of standard pens so I expect a lot less
CreatePen/DeleteObject calls can do only good...:)
Plus some minor modifications (*no* functional changes though).
* [controls/updown.c]
Used the new DrawFrameControl32 function to paint the control.
I also deleted UDDOWN_DrawArrow since it was no longer required.
Tue Dec 23 00:03:33 1997 Steinar Hamre <steinarh@stud.fim.ntnu.no>
* [configure.in]
Added check for -lw.
* [include/wintypes.h] [tools/build.c]
Changes to make the assembly understandable for even sun as.
".ascii" -> ".string", "call %foo" -> "call *%foo",
"pushw/popw %[cdes]s" written out to ".byte 0x66\npushl/popl %[cdes]s".
* [memory/ldt.c]
#ifdef added so <sys/seg.h> will not be included on Solaris.
Mon Dec 22 18:55:19 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [configure.in]
Added XF86DGA check.
* [multimedia/dsound.c][relay32/dsound.spec][include/dsound.h]
Started DirectSound. Only stubs for now.
* [graphics/ddraw.c][include/ddraw.h][relay32/ddraw.spec]
Started to implement DirectDraw. Mostly stubs, some
testcases work. Requires the XF86DGA extension to XFree86.
(check demo/blizdemo.exe from the Diablo CD-ROM).
* [files/drive.c]
Return correct "CDFS" fsname so Diablo is a bit happier.
Sun Dec 21 21:45:48 1997 Kevin Cozens <kcozens@interlog.com>
* [misc/registry.c]
Fixed bugs in the routines which read the Windows '95 registry
files. Added extra information regarding the format of the Windows
'95 registry files.
1998-01-04 18:49:09 +01:00
|
|
|
}
|