Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-and-itasks
clean-libraries
Commits
7bf3bede
Commit
7bf3bede
authored
Dec 21, 1999
by
Peter Achten
Browse files
(PA): clipboard viewer code added
parent
e3e27268
Changes
1
Hide whitespace changes
Inline
Side-by-side
ObjectIO/ObjectIO/OS Windows/Windows_C_12/cCrossCall_12.c
View file @
7bf3bede
...
@@ -36,8 +36,9 @@ static HANDLE ghOSThreadHandle = NULL;
...
@@ -36,8 +36,9 @@ static HANDLE ghOSThreadHandle = NULL;
HINSTANCE
ghInst
;
HINSTANCE
ghInst
;
HWND
ghMainWindow
=
NULL
;
HWND
ghMainWindow
=
NULL
;
/* RWS ... */
/* RWS ... */
static
HWND
gNextClipboardViewer
=
NULL
;
static
HWND
gNextClipboardViewer
=
NULL
;
/* PA: name was not used anymore. Now using it again for storing next clipboardviewer. */
/* ... RWS */
/* ... RWS */
static
int
gClipboardCount
=
0
;
/* PA: keeps track of changes of clipboard. */
static
HACCEL
gAcceleratorTable
=
NULL
;
/* Refers to the accelerator table of the active frame. */
static
HACCEL
gAcceleratorTable
=
NULL
;
/* Refers to the accelerator table of the active frame. */
static
BOOL
gAcceleratorTableIsUpToDate
=
TRUE
;
static
BOOL
gAcceleratorTableIsUpToDate
=
TRUE
;
static
PAINTSTRUCT
gPaintStruct
;
static
PAINTSTRUCT
gPaintStruct
;
...
@@ -1628,6 +1629,8 @@ void lookUpAndRemove(WPARAM dnsHdl,DNSInfo **listPtr,DNSInfo **elPtr)
...
@@ -1628,6 +1629,8 @@ void lookUpAndRemove(WPARAM dnsHdl,DNSInfo **listPtr,DNSInfo **elPtr)
// ... MW
// ... MW
/* The callback routine for the main window.
/* The callback routine for the main window.
PA: The WM_CREATE message registers the main window as a clipboard viewer.
The WM_DESTROY message unregisters the main window.
*/
*/
static
LRESULT
CALLBACK
static
LRESULT
CALLBACK
MainWindowProcedure
(
HWND
hWin
,
UINT
uMess
,
WPARAM
wPara
,
LPARAM
lPara
)
MainWindowProcedure
(
HWND
hWin
,
UINT
uMess
,
WPARAM
wPara
,
LPARAM
lPara
)
...
@@ -1697,6 +1700,41 @@ MainWindowProcedure (HWND hWin, UINT uMess, WPARAM wPara, LPARAM lPara)
...
@@ -1697,6 +1700,41 @@ MainWindowProcedure (HWND hWin, UINT uMess, WPARAM wPara, LPARAM lPara)
}
}
}
}
break
;
break
;
/* PA: The WM_CREATE message registers the ghMainWindow (hWin) as a clipboard viewer.
*/
case
WM_CREATE
:
{
gNextClipboardViewer
=
SetClipboardViewer
(
hWin
);
}
break
;
/* PA: The WM_DESTROY message unregisters the ghMainWindow (hWin) as a clipboard viewer.
*/
case
WM_DESTROY
:
{
ChangeClipboardChain
(
hWin
,
gNextClipboardViewer
);
}
break
;
/* PA: other clipboard chain management messages:
*/
case
WM_DRAWCLIPBOARD
:
{
gClipboardCount
+=
1
;
if
(
gNextClipboardViewer
!=
NULL
)
SendMessage
(
gNextClipboardViewer
,
uMess
,
wPara
,
lPara
);
return
0
;
}
break
;
case
WM_CHANGECBCHAIN
:
{
if
((
HWND
)
wPara
==
gNextClipboardViewer
)
/* gNextClipboardViewer is no longer a clipboard viewer. */
gNextClipboardViewer
=
(
HWND
)
lPara
;
/* then store the new viewer. */
else
if
(
gNextClipboardViewer
!=
NULL
)
SendMessage
(
gNextClipboardViewer
,
uMess
,
wPara
,
lPara
);
return
0
;
}
break
;
// MW...
// MW...
case
PM_SOCKET_EVENT
:
case
PM_SOCKET_EVENT
:
{
{
...
@@ -6526,7 +6564,7 @@ HandleCleanRequest (CrossCallInfo * pcci)
...
@@ -6526,7 +6564,7 @@ HandleCleanRequest (CrossCallInfo * pcci)
}
}
MakeReturn0Cci
(
pcci
);
MakeReturn0Cci
(
pcci
);
}
break
;
}
break
;
case
CcRqGETCLIPBOARDTEXT
:
/* no params; string result. */
case
CcRqGETCLIPBOARDTEXT
:
/* no params; string result. */
{
{
HANDLE
hClipText
;
HANDLE
hClipText
;
char
*
pClipText
;
char
*
pClipText
;
...
@@ -6556,6 +6594,12 @@ HandleCleanRequest (CrossCallInfo * pcci)
...
@@ -6556,6 +6594,12 @@ HandleCleanRequest (CrossCallInfo * pcci)
MakeReturn1Cci
(
pcci
,
(
int
)
result
);
MakeReturn1Cci
(
pcci
,
(
int
)
result
);
}
break
;
}
break
;
/* CcRqGETCLIPBOARDCOUNT is used by Clean to retrieve current clipboard count.
*/
case
CcRqGETCLIPBOARDCOUNT
:
/* no arguments; gClipboardCount result. */
{
MakeReturn1Cci
(
pcci
,
gClipboardCount
);
}
break
;
/* Implement WinRestackWindow as a crosscall operation.
/* Implement WinRestackWindow as a crosscall operation.
*/
*/
case
CcRqRESTACKWINDOW
:
/* thewindow,behind; no result. */
case
CcRqRESTACKWINDOW
:
/* thewindow,behind; no result. */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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