vc++ hook截获鼠标右键的复制粘贴消息

emad1211 2009-09-21 05:03:38
我想实现对鼠标右键的复制粘贴消息的截获


请问用系统的哪些API函数来实现。


...全文
447 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
MoXiaoRab 2009-09-21
  • 打赏
  • 举报
回复
Hook GetClipboardData 和SetClipboardData就好。和Hook右键菜单没关系,也没法实现你的要求
MoXiaoRab 2009-09-21
  • 打赏
  • 举报
回复
Hook右键是没问题,但是你没法知道右键菜单出来后点击的是什么。
dulvtianya 2009-09-21
  • 打赏
  • 举报
回复
学习啊学习
WuXinyang 2009-09-21
  • 打赏
  • 举报
回复
API HOOK
rendao0563 2009-09-21
  • 打赏
  • 举报
回复
估计是这2个.
GetClipboardData
SetClipboardData
rendao0563 2009-09-21
  • 打赏
  • 举报
回复
剪切板相关函数.

Functions
ChangeClipboardChain
The ChangeClipboardChain function removes a specified window from the chain of clipboard viewers.

CloseClipboard
The CloseClipboard function closes the clipboard.

CountClipboardFormats
The CountClipboardFormats function retrieves the number of different data formats currently on the clipboard.

EmptyClipboard
The EmptyClipboard function empties the clipboard and frees handles to data in the clipboard. The function then assigns ownership of the clipboard to the window that currently has the clipboard open.

EnumClipboardFormats
The EnumClipboardFormats function enumerates the data formats currently available on the clipboard.

Clipboard data formats are stored in an ordered list. To perform an enumeration of clipboard data formats, you make a series of calls to the EnumClipboardFormats function. For each call, the format parameter specifies an available clipboard format, and the function returns the next available clipboard format.


GetClipboardData
The GetClipboardData function retrieves data from the clipboard in a specified format. The clipboard must have been opened previously.

GetClipboardFormatName
The GetClipboardFormatName function retrieves from the clipboard the name of the specified registered format. The function copies the name to the specified buffer.

GetClipboardOwner
The GetClipboardOwner function retrieves the window handle of the current owner of the clipboard.

GetClipboardSequenceNumber
The GetClipboardSequenceNumber function retrieves the clipboard sequence number for the current window station.

GetClipboardViewer
The GetClipboardViewer function retrieves the handle to the first window in the clipboard viewer chain.

GetOpenClipboardWindow
The GetOpenClipboardWindow function retrieves the handle to the window that currently has the clipboard open.

GetPriorityClipboardFormat
The GetPriorityClipboardFormat function retrieves the first available clipboard format in the specified list.

IsClipboardFormatAvailable
The IsClipboardFormatAvailable function determines whether the clipboard contains data in the specified format.

OpenClipboard
The OpenClipboard function opens the clipboard for examination and prevents other applications from modifying the clipboard content.

RegisterClipboardFormat
The RegisterClipboardFormat function registers a new clipboard format. This format can then be used as a valid clipboard format.

SetClipboardData
The SetClipboardData function places data on the clipboard in a specified clipboard format. The window must be the current clipboard owner, and the application must have called the OpenClipboard function. (When responding to the WM_RENDERFORMAT and WM_RENDERALLFORMATS messages, the clipboard owner must not call OpenClipboard before calling SetClipboardData.)

SetClipboardViewer
The SetClipboardViewer function adds the specified window to the chain of clipboard viewers. Clipboard viewer windows receive a WM_DRAWCLIPBOARD message whenever the content of the clipboard changes.

hhwei1985 2009-09-21
  • 打赏
  • 举报
回复
sf

16,551

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧