Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6109f05e
Commit
6109f05e
authored
Jan 20, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
progman: Avoid Unicode macros.
parent
e12d39dc
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
133 additions
and
169 deletions
+133
-169
Makefile.in
programs/progman/Makefile.in
+1
-0
dialog.c
programs/progman/dialog.c
+0
-0
group.c
programs/progman/group.c
+19
-23
grpfile.c
programs/progman/grpfile.c
+16
-21
main.c
programs/progman/main.c
+41
-49
progman.h
programs/progman/progman.h
+16
-15
progman.rc
programs/progman/progman.rc
+8
-8
program.c
programs/progman/program.c
+24
-27
string.c
programs/progman/string.c
+8
-26
No files found.
programs/progman/Makefile.in
View file @
6109f05e
MODULE
=
progman.exe
APPMODE
=
-mwindows
EXTRADEFS
=
-DWINE_NO_UNICODE_MACROS
IMPORTS
=
shell32 comdlg32 user32 gdi32
C_SRCS
=
\
...
...
programs/progman/dialog.c
View file @
6109f05e
This diff is collapsed.
Click to expand it.
programs/progman/group.c
View file @
6109f05e
...
...
@@ -44,12 +44,12 @@ static LRESULT CALLBACK GROUP_GroupWndProc(HWND hWnd, UINT msg,
case
WM_CHILDACTIVATE
:
case
WM_NCLBUTTONDOWN
:
Globals
.
hActiveGroup
=
(
HLOCAL
)
GetWindowLongPtr
(
hWnd
,
0
);
Globals
.
hActiveGroup
=
(
HLOCAL
)
GetWindowLongPtrW
(
hWnd
,
0
);
EnableMenuItem
(
Globals
.
hFileMenu
,
PM_MOVE
,
MF_GRAYED
);
EnableMenuItem
(
Globals
.
hFileMenu
,
PM_COPY
,
MF_GRAYED
);
break
;
}
return
(
DefMDIChildProc
(
hWnd
,
msg
,
wParam
,
lParam
)
);
return
DefMDIChildProcW
(
hWnd
,
msg
,
wParam
,
lParam
);
}
/***********************************************************************
...
...
@@ -59,20 +59,20 @@ static LRESULT CALLBACK GROUP_GroupWndProc(HWND hWnd, UINT msg,
ATOM
GROUP_RegisterGroupWinClass
(
void
)
{
WNDCLASS
class
;
WNDCLASS
W
class
;
class
.
style
=
CS_HREDRAW
|
CS_VREDRAW
;
class
.
lpfnWndProc
=
GROUP_GroupWndProc
;
class
.
cbClsExtra
=
0
;
class
.
cbWndExtra
=
sizeof
(
LONG_PTR
);
class
.
hInstance
=
Globals
.
hInstance
;
class
.
hIcon
=
LoadIcon
(
0
,
IDI_WINLOGO
);
class
.
hCursor
=
LoadCursor
(
0
,
IDC_ARROW
);
class
.
hIcon
=
LoadIcon
W
(
0
,
(
LPWSTR
)
IDI_WINLOGO
);
class
.
hCursor
=
LoadCursor
W
(
0
,
(
LPWSTR
)
IDC_ARROW
);
class
.
hbrBackground
=
GetStockObject
(
WHITE_BRUSH
);
class
.
lpszMenuName
=
0
;
class
.
lpszClassName
=
STRING_GROUP_WIN_CLASS_NAME
;
return
RegisterClass
(
&
class
);
return
RegisterClass
W
(
&
class
);
}
/***********************************************************************
...
...
@@ -118,12 +118,12 @@ HLOCAL GROUP_AddGroup(LPCSTR lpszName, LPCSTR lpszGrpFile, INT nCmdShow,
BOOL
bSuppressShowWindow
)
{
PROGGROUP
*
group
,
*
prior
;
MDICREATESTRUCT
cs
;
MDICREATESTRUCT
W
cs
;
INT
seqnum
;
HLOCAL
hPrior
,
*
p
;
HLOCAL
hGroup
=
LocalAlloc
(
LMEM_FIXED
,
sizeof
(
PROGGROUP
));
HLOCAL
hName
=
LocalAlloc
(
LMEM_FIXED
,
1
+
l
strlen
(
lpszName
));
HLOCAL
hGrpFile
=
LocalAlloc
(
LMEM_FIXED
,
1
+
l
strlen
(
lpszGrpFile
));
HLOCAL
hName
=
LocalAlloc
(
LMEM_FIXED
,
1
+
strlen
(
lpszName
));
HLOCAL
hGrpFile
=
LocalAlloc
(
LMEM_FIXED
,
1
+
strlen
(
lpszGrpFile
));
if
(
!
hGroup
||
!
hName
||
!
hGrpFile
)
{
MAIN_MessageBoxIDS
(
IDS_OUT_OF_MEMORY
,
IDS_ERROR
,
MB_OK
);
...
...
@@ -132,8 +132,8 @@ HLOCAL GROUP_AddGroup(LPCSTR lpszName, LPCSTR lpszGrpFile, INT nCmdShow,
if
(
hGrpFile
)
LocalFree
(
hGrpFile
);
return
(
0
);
}
memcpy
(
LocalLock
(
hName
),
lpszName
,
1
+
l
strlen
(
lpszName
));
memcpy
(
LocalLock
(
hGrpFile
),
lpszGrpFile
,
1
+
l
strlen
(
lpszGrpFile
));
memcpy
(
LocalLock
(
hName
),
lpszName
,
1
+
strlen
(
lpszName
));
memcpy
(
LocalLock
(
hGrpFile
),
lpszGrpFile
,
1
+
strlen
(
lpszGrpFile
));
Globals
.
hActiveGroup
=
hGroup
;
...
...
@@ -169,7 +169,7 @@ HLOCAL GROUP_AddGroup(LPCSTR lpszName, LPCSTR lpszGrpFile, INT nCmdShow,
group
->
hActiveProgram
=
0
;
cs
.
szClass
=
STRING_GROUP_WIN_CLASS_NAME
;
cs
.
szTitle
=
lpszName
;
cs
.
szTitle
=
NULL
;
cs
.
hOwner
=
0
;
cs
.
x
=
x
;
cs
.
y
=
y
;
...
...
@@ -178,9 +178,9 @@ HLOCAL GROUP_AddGroup(LPCSTR lpszName, LPCSTR lpszGrpFile, INT nCmdShow,
cs
.
style
=
0
;
cs
.
lParam
=
0
;
group
->
hWnd
=
(
HWND
)
SendMessage
(
Globals
.
hMDIWnd
,
WM_MDICREATE
,
0
,
(
LPARAM
)
&
cs
);
SetWindowLongPtr
(
group
->
hWnd
,
0
,
(
LONG_PTR
)
hGroup
);
group
->
hWnd
=
(
HWND
)
SendMessage
A
(
Globals
.
hMDIWnd
,
WM_MDICREATE
,
0
,
(
LPARAM
)
&
cs
);
SetWindowTextA
(
group
->
hWnd
,
lpszName
);
SetWindowLongPtr
W
(
group
->
hWnd
,
0
,
(
LONG_PTR
)
hGroup
);
#if 1
if
(
!
bSuppressShowWindow
)
/* FIXME shouldn't be necessary */
...
...
@@ -203,8 +203,8 @@ VOID GROUP_ModifyGroup(HLOCAL hGroup)
PROGGROUP
*
group
=
LocalLock
(
hGroup
);
CHAR
szName
[
MAX_PATHNAME_LEN
];
CHAR
szFile
[
MAX_PATHNAME_LEN
];
lstrcpyn
(
szName
,
LocalLock
(
group
->
hName
),
MAX_PATHNAME_LEN
);
lstrcpyn
(
szFile
,
LocalLock
(
group
->
hGrpFile
),
MAX_PATHNAME_LEN
);
lstrcpyn
A
(
szName
,
LocalLock
(
group
->
hName
),
MAX_PATHNAME_LEN
);
lstrcpyn
A
(
szFile
,
LocalLock
(
group
->
hGrpFile
),
MAX_PATHNAME_LEN
);
if
(
!
DIALOG_GroupAttributes
(
szName
,
szFile
,
MAX_PATHNAME_LEN
))
return
;
...
...
@@ -220,7 +220,7 @@ VOID GROUP_ModifyGroup(HLOCAL hGroup)
/* FIXME Update progman.ini */
SetWindowText
(
group
->
hWnd
,
szName
);
SetWindowText
A
(
group
->
hWnd
,
szName
);
}
/***********************************************************************
...
...
@@ -259,7 +259,7 @@ VOID GROUP_DeleteGroup(HLOCAL hGroup)
/* FIXME Update progman.ini */
SendMessage
(
Globals
.
hMDIWnd
,
WM_MDIDESTROY
,
(
WPARAM
)
group
->
hWnd
,
0
);
SendMessage
W
(
Globals
.
hMDIWnd
,
WM_MDIDESTROY
,
(
WPARAM
)
group
->
hWnd
,
0
);
LocalFree
(
group
->
hName
);
LocalFree
(
group
->
hGrpFile
);
...
...
@@ -324,7 +324,3 @@ LPCSTR GROUP_GroupName(HLOCAL hGroup)
group
=
LocalLock
(
hGroup
);
return
(
LocalLock
(
group
->
hName
));
}
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */
programs/progman/grpfile.c
View file @
6109f05e
...
...
@@ -50,10 +50,10 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group);
static
VOID
GRPFILE_ModifyFileName
(
LPSTR
lpszNewName
,
LPCSTR
lpszOrigName
,
INT
nSize
,
BOOL
bModify
)
{
lstrcpyn
(
lpszNewName
,
lpszOrigName
,
nSize
);
lstrcpyn
A
(
lpszNewName
,
lpszOrigName
,
nSize
);
lpszNewName
[
nSize
-
1
]
=
'\0'
;
if
(
!
bModify
)
return
;
if
(
!
lstrcmpi
(
lpszNewName
+
strlen
(
lpszNewName
)
-
4
,
".grp"
))
if
(
!
lstrcmpi
A
(
lpszNewName
+
strlen
(
lpszNewName
)
-
4
,
".grp"
))
lpszNewName
[
strlen
(
lpszNewName
)
-
1
]
=
'\0'
;
}
...
...
@@ -382,11 +382,11 @@ BOOL GRPFILE_WriteGroupFile(HLOCAL hGroup)
{
/* Warn about the (possible) incompatibility */
CHAR
msg
[
MAX_PATHNAME_LEN
+
200
];
wsprintf
(
msg
,
wsprintf
A
(
msg
,
"Group files written by this DRAFT Program Manager "
"possibly cannot be read by the Microsoft Program Manager!!
\n
"
"Are you sure to write %s?"
,
szPath
);
if
(
IDOK
!=
MessageBox
(
Globals
.
hMainWnd
,
msg
,
"WARNING"
,
if
(
IDOK
!=
MessageBox
A
(
Globals
.
hMainWnd
,
msg
,
"WARNING"
,
MB_OKCANCEL
|
MB_DEFBUTTON2
))
return
FALSE
;
}
...
...
@@ -425,9 +425,9 @@ static VOID GRPFILE_CalculateSizes(PROGRAM *program, INT *Progs, INT *Icons,
DeleteObject
(
info
.
hbmColor
);
*
Progs
+=
24
;
*
Progs
+=
l
strlen
(
LocalLock
(
program
->
hName
))
+
1
;
*
Progs
+=
l
strlen
(
LocalLock
(
program
->
hCmdLine
))
+
1
;
*
Progs
+=
l
strlen
(
LocalLock
(
program
->
hIconFile
))
+
1
;
*
Progs
+=
strlen
(
LocalLock
(
program
->
hName
))
+
1
;
*
Progs
+=
strlen
(
LocalLock
(
program
->
hCmdLine
))
+
1
;
*
Progs
+=
strlen
(
LocalLock
(
program
->
hIconFile
))
+
1
;
*
Icons
+=
12
;
/* IconInfo */
*
Icons
+=
*
sizeAnd
;
...
...
@@ -540,7 +540,7 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group)
hProgram
=
program
->
hNext
;
}
Title
=
34
+
NumProg
*
2
;
Progs
=
Title
+
l
strlen
(
lpszTitle
)
+
1
;
Progs
=
Title
+
strlen
(
lpszTitle
)
+
1
;
Icons
+=
Progs
;
Extension
+=
Icons
;
...
...
@@ -589,8 +589,7 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group)
}
/* Title */
if
((
UINT
)
HFILE_ERROR
==
GRPFILE_WriteWithChecksum
(
file
,
lpszTitle
,
lstrlen
(
lpszTitle
)
+
1
))
if
((
UINT
)
HFILE_ERROR
==
GRPFILE_WriteWithChecksum
(
file
,
lpszTitle
,
strlen
(
lpszTitle
)
+
1
))
return
FALSE
;
/* Program entries */
...
...
@@ -618,15 +617,15 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group)
PUT_SHORT
(
buffer
,
16
,
CurrIcon
+
12
);
ptr
=
CurrProg
+
24
;
PUT_SHORT
(
buffer
,
18
,
ptr
);
ptr
+=
l
strlen
(
Name
)
+
1
;
ptr
+=
strlen
(
Name
)
+
1
;
PUT_SHORT
(
buffer
,
20
,
ptr
);
ptr
+=
l
strlen
(
CmdLine
)
+
1
;
ptr
+=
strlen
(
CmdLine
)
+
1
;
PUT_SHORT
(
buffer
,
22
,
ptr
);
if
((
UINT
)
HFILE_ERROR
==
GRPFILE_WriteWithChecksum
(
file
,
buffer
,
24
)
||
(
UINT
)
HFILE_ERROR
==
GRPFILE_WriteWithChecksum
(
file
,
Name
,
l
strlen
(
Name
)
+
1
)
||
(
UINT
)
HFILE_ERROR
==
GRPFILE_WriteWithChecksum
(
file
,
CmdLine
,
l
strlen
(
CmdLine
)
+
1
)
||
(
UINT
)
HFILE_ERROR
==
GRPFILE_WriteWithChecksum
(
file
,
IconFile
,
l
strlen
(
IconFile
)
+
1
))
(
UINT
)
HFILE_ERROR
==
GRPFILE_WriteWithChecksum
(
file
,
Name
,
strlen
(
Name
)
+
1
)
||
(
UINT
)
HFILE_ERROR
==
GRPFILE_WriteWithChecksum
(
file
,
CmdLine
,
strlen
(
CmdLine
)
+
1
)
||
(
UINT
)
HFILE_ERROR
==
GRPFILE_WriteWithChecksum
(
file
,
IconFile
,
strlen
(
IconFile
)
+
1
))
return
FALSE
;
CurrProg
=
next_prog
;
...
...
@@ -685,9 +684,9 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group)
{
PUT_SHORT
(
buffer
,
0
,
0x8101
);
PUT_SHORT
(
buffer
,
2
,
seqnum
);
PUT_SHORT
(
buffer
,
4
,
7
+
l
strlen
(
lpszWorkDir
));
PUT_SHORT
(
buffer
,
4
,
7
+
strlen
(
lpszWorkDir
));
if
((
UINT
)
HFILE_ERROR
==
GRPFILE_WriteWithChecksum
(
file
,
buffer
,
6
)
||
(
UINT
)
HFILE_ERROR
==
GRPFILE_WriteWithChecksum
(
file
,
lpszWorkDir
,
l
strlen
(
lpszWorkDir
)
+
1
))
(
UINT
)
HFILE_ERROR
==
GRPFILE_WriteWithChecksum
(
file
,
lpszWorkDir
,
strlen
(
lpszWorkDir
)
+
1
))
return
FALSE
;
}
...
...
@@ -729,7 +728,3 @@ static BOOL GRPFILE_DoWriteGroupFile(HFILE file, PROGGROUP *group)
return
TRUE
;
}
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */
programs/progman/main.c
View file @
6109f05e
This diff is collapsed.
Click to expand it.
programs/progman/progman.h
View file @
6109f05e
...
...
@@ -190,23 +190,24 @@ VOID DIALOG_Execute(void);
VOID
STRING_LoadMenus
(
VOID
);
/* Class names */
extern
CHAR
STRING_MAIN_WIN_CLASS_NAME
[];
extern
CHAR
STRING_MDI_WIN_CLASS_NAME
[];
extern
CHAR
STRING_GROUP_WIN_CLASS_NAME
[];
extern
CHAR
STRING_PROGRAM_WIN_CLASS_NAME
[];
extern
W
CHAR
STRING_MAIN_WIN_CLASS_NAME
[];
extern
W
CHAR
STRING_MDI_WIN_CLASS_NAME
[];
extern
W
CHAR
STRING_GROUP_WIN_CLASS_NAME
[];
extern
W
CHAR
STRING_PROGRAM_WIN_CLASS_NAME
[];
/* Resource names */
extern
CHAR
STRING_ACCEL
[];
extern
CHAR
STRING_MAIN
[];
extern
CHAR
STRING_NEW
[];
extern
CHAR
STRING_OPEN
[];
extern
CHAR
STRING_MOVE
[];
extern
CHAR
STRING_COPY
[];
extern
CHAR
STRING_DELETE
[];
extern
CHAR
STRING_GROUP
[];
extern
CHAR
STRING_PROGRAM
[];
extern
CHAR
STRING_SYMBOL
[];
extern
CHAR
STRING_EXECUTE
[];
#define IDD_MAIN 1
#define IDD_NEW 2
#define IDD_OPEN 3
#define IDD_MOVE 4
#define IDD_COPY 5
#define IDD_DELETE 6
#define IDD_GROUP 7
#define IDD_PROGRAM 8
#define IDD_SYMBOL 9
#define IDD_EXECUTE 10
#define IDA_ACCEL 1
/* Stringtable index */
#define IDS_PROGRAM_MANAGER 0x02
...
...
programs/progman/progman.rc
View file @
6109f05e
...
...
@@ -83,7 +83,7 @@ IDS_SYMBOL_FILES, "Icon files"
IDS_SYMBOLS_ICO, "Icons (*.ico)"
}
ACCEL ACCELERATORS
IDA_
ACCEL ACCELERATORS
{
VK_F1, PM_CONTENTS, VIRTKEY
VK_RETURN, PM_ATTRIBUTES, VIRTKEY, ALT
...
...
@@ -91,7 +91,7 @@ VK_RETURN, PM_ATTRIBUTES, VIRTKEY, ALT
/* Dialog `New' */
DIALOG
_NEW DIALOG 0, 0, 170, 65
IDD
_NEW DIALOG 0, 0, 170, 65
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg"
CAPTION "New"
...
...
@@ -107,7 +107,7 @@ PUSHBUTTON "&Help", PM_HELP, 105, 45, 60, 15, WS_TABSTOP
/* Dialog `Move' */
DIALOG
_MOVE DIALOG 0, 0, 250, 65
IDD
_MOVE DIALOG 0, 0, 250, 65
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg"
CAPTION "Move Program"
...
...
@@ -125,7 +125,7 @@ PUSHBUTTON "&Help", PM_HELP, 185, 45, 60, 15, WS_TABSTO
/* Dialog `Copy' */
DIALOG
_COPY DIALOG 0, 0, 250, 65
IDD
_COPY DIALOG 0, 0, 250, 65
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg"
CAPTION "Copy Program"
...
...
@@ -143,7 +143,7 @@ PUSHBUTTON "&Help", PM_HELP, 185, 45, 60, 15, WS_TABSTO
/* Dialog `Group attributes' */
DIALOG
_GROUP DIALOG 0, 0, 250, 65
IDD
_GROUP DIALOG 0, 0, 250, 65
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg"
CAPTION "Program Group Attributes"
...
...
@@ -159,7 +159,7 @@ PUSHBUTTON "&Help", PM_HELP, 185, 45, 60, 15, WS_TABSTO
/* Dialog `Program attributes' */
DIALOG
_PROGRAM DIALOG 0, 0, 275, 105
IDD
_PROGRAM DIALOG 0, 0, 275, 105
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg"
CAPTION "Program Attributes"
...
...
@@ -183,7 +183,7 @@ PUSHBUTTON "&Help", PM_HELP, 200, 85, 70, 15, WS
/* Dialog `Symbol' */
DIALOG
_SYMBOL DIALOG 0, 0, 240, 85
IDD
_SYMBOL DIALOG 0, 0, 240, 85
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg"
CAPTION "Change Icon"
...
...
@@ -201,7 +201,7 @@ PUSHBUTTON "&Help", PM_HELP, 175, 65, 60, 15, WS_TABSTOP
/* Dialog `Execute' */
DIALOG
_EXECUTE DIALOG 0, 0, 200, 85
IDD
_EXECUTE DIALOG 0, 0, 200, 85
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg"
CAPTION "Execute Program"
...
...
programs/progman/program.c
View file @
6109f05e
...
...
@@ -35,7 +35,7 @@ static LRESULT CALLBACK PROGRAM_ProgramWndProc(HWND hWnd, UINT msg, WPARAM wPara
{
case
WM_NCLBUTTONDOWN
:
{
HLOCAL
hProgram
=
(
HLOCAL
)
GetWindowLongPtr
(
hWnd
,
0
);
HLOCAL
hProgram
=
(
HLOCAL
)
GetWindowLongPtr
W
(
hWnd
,
0
);
PROGRAM
*
program
=
LocalLock
(
hProgram
);
PROGGROUP
*
group
=
LocalLock
(
program
->
hGroup
);
group
->
hActiveProgram
=
hProgram
;
...
...
@@ -45,7 +45,7 @@ static LRESULT CALLBACK PROGRAM_ProgramWndProc(HWND hWnd, UINT msg, WPARAM wPara
}
case
WM_NCLBUTTONDBLCLK
:
{
PROGRAM_ExecuteProgram
((
HLOCAL
)
GetWindowLongPtr
(
hWnd
,
0
));
PROGRAM_ExecuteProgram
((
HLOCAL
)
GetWindowLongPtr
W
(
hWnd
,
0
));
return
(
0
);
}
...
...
@@ -56,14 +56,14 @@ static LRESULT CALLBACK PROGRAM_ProgramWndProc(HWND hWnd, UINT msg, WPARAM wPara
PAINTSTRUCT
ps
;
HDC
hdc
;
hdc
=
BeginPaint
(
hWnd
,
&
ps
);
program
=
LocalLock
((
HLOCAL
)
GetWindowLongPtr
(
hWnd
,
0
));
program
=
LocalLock
((
HLOCAL
)
GetWindowLongPtr
W
(
hWnd
,
0
));
if
(
program
->
hIcon
)
DrawIcon
(
hdc
,
0
,
0
,
program
->
hIcon
);
EndPaint
(
hWnd
,
&
ps
);
break
;
}
}
return
(
DefWindowProc
(
hWnd
,
msg
,
wParam
,
lParam
)
);
return
DefWindowProcW
(
hWnd
,
msg
,
wParam
,
lParam
);
}
/***********************************************************************
...
...
@@ -73,7 +73,7 @@ static LRESULT CALLBACK PROGRAM_ProgramWndProc(HWND hWnd, UINT msg, WPARAM wPara
ATOM
PROGRAM_RegisterProgramWinClass
(
void
)
{
WNDCLASS
class
;
WNDCLASS
W
class
;
class
.
style
=
CS_HREDRAW
|
CS_VREDRAW
;
class
.
lpfnWndProc
=
PROGRAM_ProgramWndProc
;
...
...
@@ -81,12 +81,12 @@ ATOM PROGRAM_RegisterProgramWinClass(void)
class
.
cbWndExtra
=
sizeof
(
LONG_PTR
);
class
.
hInstance
=
Globals
.
hInstance
;
class
.
hIcon
=
0
;
class
.
hCursor
=
LoadCursor
(
0
,
IDC_ARROW
);
class
.
hCursor
=
LoadCursor
W
(
0
,
(
LPWSTR
)
IDC_ARROW
);
class
.
hbrBackground
=
GetStockObject
(
WHITE_BRUSH
);
class
.
lpszMenuName
=
0
;
class
.
lpszClassName
=
STRING_PROGRAM_WIN_CLASS_NAME
;
return
RegisterClass
(
&
class
);
return
RegisterClass
W
(
&
class
);
}
/***********************************************************************
...
...
@@ -110,7 +110,7 @@ VOID PROGRAM_NewProgram(HLOCAL hGroup)
&
nCmdShow
,
MAX_PATHNAME_LEN
))
return
;
if
(
!
hIcon
)
hIcon
=
LoadIcon
(
0
,
IDI_WINLOGO
);
if
(
!
hIcon
)
hIcon
=
LoadIcon
W
(
0
,
(
LPWSTR
)
IDI_WINLOGO
);
if
(
!
PROGRAM_AddProgram
(
hGroup
,
hIcon
,
szName
,
0
,
0
,
szCmdLine
,
szIconFile
,
...
...
@@ -133,10 +133,10 @@ VOID PROGRAM_ModifyProgram(HLOCAL hProgram)
CHAR
szIconFile
[
MAX_PATHNAME_LEN
];
CHAR
szWorkDir
[
MAX_PATHNAME_LEN
];
lstrcpyn
(
szName
,
LocalLock
(
program
->
hName
),
MAX_PATHNAME_LEN
);
lstrcpyn
(
szCmdLine
,
LocalLock
(
program
->
hCmdLine
),
MAX_PATHNAME_LEN
);
lstrcpyn
(
szIconFile
,
LocalLock
(
program
->
hIconFile
),
MAX_PATHNAME_LEN
);
lstrcpyn
(
szWorkDir
,
LocalLock
(
program
->
hWorkDir
),
MAX_PATHNAME_LEN
);
lstrcpyn
A
(
szName
,
LocalLock
(
program
->
hName
),
MAX_PATHNAME_LEN
);
lstrcpyn
A
(
szCmdLine
,
LocalLock
(
program
->
hCmdLine
),
MAX_PATHNAME_LEN
);
lstrcpyn
A
(
szIconFile
,
LocalLock
(
program
->
hIconFile
),
MAX_PATHNAME_LEN
);
lstrcpyn
A
(
szWorkDir
,
LocalLock
(
program
->
hWorkDir
),
MAX_PATHNAME_LEN
);
if
(
!
DIALOG_ProgramAttributes
(
szName
,
szCmdLine
,
szWorkDir
,
szIconFile
,
&
program
->
hIcon
,
&
program
->
nIconIndex
,
...
...
@@ -149,7 +149,7 @@ VOID PROGRAM_ModifyProgram(HLOCAL hProgram)
MAIN_ReplaceString
(
&
program
->
hIconFile
,
szIconFile
);
MAIN_ReplaceString
(
&
program
->
hWorkDir
,
szWorkDir
);
SetWindowText
(
program
->
hWnd
,
szName
);
SetWindowText
A
(
program
->
hWnd
,
szName
);
UpdateWindow
(
program
->
hWnd
);
GRPFILE_WriteGroupFile
(
program
->
hGroup
);
...
...
@@ -171,10 +171,10 @@ HLOCAL PROGRAM_AddProgram(HLOCAL hGroup, HICON hIcon, LPCSTR lpszName,
PROGRAM
*
program
;
HLOCAL
hPrior
,
*
p
;
HLOCAL
hProgram
=
LocalAlloc
(
LMEM_FIXED
,
sizeof
(
PROGRAM
));
HLOCAL
hName
=
LocalAlloc
(
LMEM_FIXED
,
1
+
l
strlen
(
lpszName
));
HLOCAL
hCmdLine
=
LocalAlloc
(
LMEM_FIXED
,
1
+
l
strlen
(
lpszCmdLine
));
HLOCAL
hIconFile
=
LocalAlloc
(
LMEM_FIXED
,
1
+
l
strlen
(
lpszIconFile
));
HLOCAL
hWorkDir
=
LocalAlloc
(
LMEM_FIXED
,
1
+
l
strlen
(
lpszWorkDir
));
HLOCAL
hName
=
LocalAlloc
(
LMEM_FIXED
,
1
+
strlen
(
lpszName
));
HLOCAL
hCmdLine
=
LocalAlloc
(
LMEM_FIXED
,
1
+
strlen
(
lpszCmdLine
));
HLOCAL
hIconFile
=
LocalAlloc
(
LMEM_FIXED
,
1
+
strlen
(
lpszIconFile
));
HLOCAL
hWorkDir
=
LocalAlloc
(
LMEM_FIXED
,
1
+
strlen
(
lpszWorkDir
));
if
(
!
hProgram
||
!
hName
||
!
hCmdLine
||
!
hIconFile
||
!
hWorkDir
)
{
MAIN_MessageBoxIDS
(
IDS_OUT_OF_MEMORY
,
IDS_ERROR
,
MB_OK
);
...
...
@@ -185,10 +185,10 @@ HLOCAL PROGRAM_AddProgram(HLOCAL hGroup, HICON hIcon, LPCSTR lpszName,
if
(
hWorkDir
)
LocalFree
(
hWorkDir
);
return
(
0
);
}
memcpy
(
LocalLock
(
hName
),
lpszName
,
1
+
l
strlen
(
lpszName
));
memcpy
(
LocalLock
(
hCmdLine
),
lpszCmdLine
,
1
+
l
strlen
(
lpszCmdLine
));
memcpy
(
LocalLock
(
hIconFile
),
lpszIconFile
,
1
+
l
strlen
(
lpszIconFile
));
memcpy
(
LocalLock
(
hWorkDir
),
lpszWorkDir
,
1
+
l
strlen
(
lpszWorkDir
));
memcpy
(
LocalLock
(
hName
),
lpszName
,
1
+
strlen
(
lpszName
));
memcpy
(
LocalLock
(
hCmdLine
),
lpszCmdLine
,
1
+
strlen
(
lpszCmdLine
));
memcpy
(
LocalLock
(
hIconFile
),
lpszIconFile
,
1
+
strlen
(
lpszIconFile
));
memcpy
(
LocalLock
(
hWorkDir
),
lpszWorkDir
,
1
+
strlen
(
lpszWorkDir
));
group
->
hActiveProgram
=
hProgram
;
...
...
@@ -215,12 +215,13 @@ HLOCAL PROGRAM_AddProgram(HLOCAL hGroup, HICON hIcon, LPCSTR lpszName,
program
->
nHotKey
=
nHotKey
;
program
->
hWnd
=
CreateWindow
(
STRING_PROGRAM_WIN_CLASS_NAME
,
lpszName
,
CreateWindow
W
(
STRING_PROGRAM_WIN_CLASS_NAME
,
NULL
,
WS_CHILD
|
WS_CAPTION
,
x
,
y
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
group
->
hWnd
,
0
,
Globals
.
hInstance
,
0
);
SetWindowLongPtr
(
program
->
hWnd
,
0
,
(
LONG_PTR
)
hProgram
);
SetWindowTextA
(
program
->
hWnd
,
lpszName
);
SetWindowLongPtrW
(
program
->
hWnd
,
0
,
(
LONG_PTR
)
hProgram
);
ShowWindow
(
program
->
hWnd
,
SW_SHOWMINIMIZED
);
SetWindowPos
(
program
->
hWnd
,
0
,
x
,
y
,
0
,
0
,
SWP_NOZORDER
|
SWP_NOACTIVATE
|
SWP_NOSIZE
);
...
...
@@ -367,7 +368,3 @@ LPCSTR PROGRAM_ProgramName(HLOCAL hProgram)
program
=
LocalLock
(
hProgram
);
return
(
LocalLock
(
program
->
hName
));
}
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */
programs/progman/string.c
View file @
6109f05e
...
...
@@ -26,24 +26,10 @@
/* Class names */
CHAR
STRING_MAIN_WIN_CLASS_NAME
[]
=
"PMMain"
;
CHAR
STRING_MDI_WIN_CLASS_NAME
[]
=
"MDICLIENT"
;
CHAR
STRING_GROUP_WIN_CLASS_NAME
[]
=
"PMGroup"
;
CHAR
STRING_PROGRAM_WIN_CLASS_NAME
[]
=
"PMProgram"
;
/* Resource names */
CHAR
STRING_ACCEL
[]
=
"ACCEL"
;
CHAR
STRING_MENU
[]
=
"MENU"
;
CHAR
STRING_NEW
[]
=
"DIALOG_NEW"
;
CHAR
STRING_OPEN
[]
=
"DIALOG_OPEN"
;
CHAR
STRING_MOVE
[]
=
"DIALOG_MOVE"
;
CHAR
STRING_COPY
[]
=
"DIALOG_COPY"
;
CHAR
STRING_DELETE
[]
=
"DIALOG_DELETE"
;
CHAR
STRING_GROUP
[]
=
"DIALOG_GROUP"
;
CHAR
STRING_PROGRAM
[]
=
"DIALOG_PROGRAM"
;
CHAR
STRING_SYMBOL
[]
=
"DIALOG_SYMBOL"
;
CHAR
STRING_EXECUTE
[]
=
"DIALOG_EXECUTE"
;
WCHAR
STRING_MAIN_WIN_CLASS_NAME
[]
=
{
'P'
,
'M'
,
'M'
,
'a'
,
'i'
,
'n'
,
0
};
WCHAR
STRING_MDI_WIN_CLASS_NAME
[]
=
{
'M'
,
'D'
,
'I'
,
'C'
,
'L'
,
'I'
,
'E'
,
'N'
,
'T'
,
0
};
WCHAR
STRING_GROUP_WIN_CLASS_NAME
[]
=
{
'P'
,
'M'
,
'G'
,
'r'
,
'o'
,
'u'
,
'p'
,
0
};
WCHAR
STRING_PROGRAM_WIN_CLASS_NAME
[]
=
{
'P'
,
'M'
,
'P'
,
'r'
,
'o'
,
'g'
,
'r'
,
'a'
,
'm'
,
0
};
VOID
STRING_LoadMenus
(
VOID
)
{
...
...
@@ -51,18 +37,18 @@ VOID STRING_LoadMenus(VOID)
HMENU
hMainMenu
;
/* Set frame caption */
LoadString
(
Globals
.
hInstance
,
IDS_PROGRAM_MANAGER
,
caption
,
sizeof
(
caption
));
SetWindowText
(
Globals
.
hMainWnd
,
caption
);
LoadString
A
(
Globals
.
hInstance
,
IDS_PROGRAM_MANAGER
,
caption
,
sizeof
(
caption
));
SetWindowText
A
(
Globals
.
hMainWnd
,
caption
);
/* Create menu */
hMainMenu
=
LoadMenu
(
Globals
.
hInstance
,
MAKEINTRESOURCE
(
MAIN_MENU
));
hMainMenu
=
LoadMenu
W
(
Globals
.
hInstance
,
MAKEINTRESOURCEW
(
MAIN_MENU
));
Globals
.
hFileMenu
=
GetSubMenu
(
hMainMenu
,
0
);
Globals
.
hOptionMenu
=
GetSubMenu
(
hMainMenu
,
1
);
Globals
.
hWindowsMenu
=
GetSubMenu
(
hMainMenu
,
2
);
Globals
.
hLanguageMenu
=
GetSubMenu
(
hMainMenu
,
3
);
if
(
Globals
.
hMDIWnd
)
SendMessage
(
Globals
.
hMDIWnd
,
WM_MDISETMENU
,
SendMessage
W
(
Globals
.
hMDIWnd
,
WM_MDISETMENU
,
(
WPARAM
)
hMainMenu
,
(
LPARAM
)
Globals
.
hWindowsMenu
);
else
SetMenu
(
Globals
.
hMainWnd
,
hMainMenu
);
...
...
@@ -71,7 +57,3 @@ VOID STRING_LoadMenus(VOID)
if
(
Globals
.
hMainMenu
)
DestroyMenu
(
Globals
.
hMainMenu
);
Globals
.
hMainMenu
=
hMainMenu
;
}
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment