严重寻求”最好“解决方法!!!!!!!!

iamnotyou 2003-01-07 07:35:49
在任意程序的窗体上进行绘画,
并且将绘画上的东西保存到该程序
(也就是说,下次运行还是照常保留上次绘画结果)

...全文
128 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
abrams 2003-01-08
  • 打赏
  • 举报
回复
取得desktop的句柄啊,总是在顶部窗口画图的
icelight 2003-01-08
  • 打赏
  • 举报
回复
不同程序在RedrawWindow时,用的是它们的代码,怎可能保存你画的东东。

要不,把你的代码(有针对性)象病毒一样加到其它可执行文件后面,一运行就HOOK。
isdong 2003-01-08
  • 打赏
  • 举报
回复
那需要你自己处理逻辑了,你需要为每个应用弄个记录。
iamnotyou 2003-01-07
  • 打赏
  • 举报
回复
如果保存成位图,重新运行程序的时候,怎样还原呢?

我想做的效果是象一开始做界面的时候添上去的一样
akiy 2003-01-07
  • 打赏
  • 举报
回复
把整个界面存成位图吧!
iamnotyou 2003-01-07
  • 打赏
  • 举报
回复
----------
Installation
------------
Select in BIN directory version which matches to your OS, copy ApiHooks.exe
and ApiHooks.dll into Windows system directory or to any directory in PATH.
Then will be ApiHooks always available for usage as application and library.
If you want to use ApiHooks in more operating systems you can choose ALL
version.

------------------------------------------------------------------------------
Using ApiHooks.exe
------------------

Syntax
-------
ApiHooks <-n | -o>[q | r] <[PathTo\]Hooks> <[PathTo\]Target | PID> [Parameters]
-n .. ......... create new process (process is not created in debug mode).
-o ............ find and open existing process.
q ............ display no message box if all went OK
r ............ display no message box even if there was an error
Hooks ......... module with hooks. When -n option is used and Hooks isn't in
PATH or current directory, PathTo\ must be specified. When -o
option is used and Hooks isn't in current directory, PathTo\
must be specified.
Process to open can be specified by name or by process ID. When there are
several processes with the same name in the system, specification by PID is
suitable. Process IDs can be obtained from process viewers and debuggers.
Process to create must be specified by name.
Target ........ the name of the file (main module) used for process creation.
ApiHooks can find both Target and [PathTo\]Target in the
system.
PID............ process ID = hexadecimal number with 0x prefix
Parameters .... Target's command-line-parameters (when -n option is used)
(example: -s ddt "e e" -x).

Examples of usage
-----------------
ApiHooks.exe -n MyHooks.dll notepad.exe
!) creates notepad.exe process and applies MyHooks.dll to this.
A) MyHooks.dll must be in PATH or current directory.
B) notepad.exe must be in PATH or current directory.
C) info message box is displayed.

Check ApiHooks.exe exit code for more info (exit codes are the same as for
EstablishApiHooks functions).

C:\DOS\ApiHooks.exe -nq F:\HOOKS\MyHooks.dll D:\WINNT\SYSTEM32\notepad.exe "new file.txt"
!) creates notepad.exe process and applies F:\HOOKS\MyHooks.dll to this.
A) no message box is displayed if all went ok.
note) full specifications -> faster execution.

ApiHooks.exe -o Hooks001.dll winver.exe
!) applies Hooks001.dll to the first of winver.exe processes found in the
system.
A) Hooks001.dll must be in the current directory.
B) info message box is displayed.

ApiHooks.exe -or Hooks001.dll D:\123\winver.exe
!) applies Hooks001.dll to the first of D:\123\winver.exe processes found
in the system.
A) no message box is displayed even if there was an error.
note) if you use W2K or ALL version under Windows 2000, the process won't
be found.

ApiHooks.exe -o NThexpl.drv 0x45
!) applies NThexpl.drv to the process with PID = 0x45.
A) NThexpl.drv must be in current directory.
B) info message box is displayed.

ApiHooks.exe -oq C:\TEMP\hookdlls\mpghooks\mpghks.333 mmxmpeg1.dll
!) applies C:\TEMP\hookdlls\mpghooks\mpghks.333 to the first of
mmxmpeg1.dll processes found in the system.
A) no message box is displayed if all went ok.

ApiHooks.exe -or D:\DEB\95hooks\0hooks\0hOOK.h 0XfFfFc67B
!) applies D:\DEB\95hooks\0hooks\0hOOK.h to the process with
PID = 0xFFFFC67B.
A) no message box is displayed even if there were errors.

ApiHooks -nq RegLog.dll CMD /C CMD /C CMD /C CMD /C TASKMGR
!) creates CMD process and applies RegLog.dll to it.
A) no message box is displayed if all went ok.

------------------------------------------------------------------------------
Using ApiHooks.dll
------------------
See AHasDLL.txt in the HDK subdirectory.

------------------------------------------------------------------------------
Hooking running process (here running process = process whose primary thread
----------------------- has executed at least one instruction in main module)
For applying hooks to an running process is most suitable WNT-2K version, so
NT4 users are OK. Also in Windows 2000 use WNT-2K version for hooking running
process if possible.
If you use W95-98, W2K or ALL version, here are the rules for hooking running
process:
A) You should know what you are hooking.
B) Hook processess with visible windows only.
C) Don't hook process with realtime priority.
If you will not respect above rules, there is a chance EstablishApiHooks
functions never return (and 2 tasks will have to be killed or PC rebooted).
If process is not waiting (for example playing mplayer2.exe) it will be
hooked in few seconds. If process is waiting, try to invoke some activity in
it, for example move with mouse over window or switch to it. Without activity
it may last several minutes (1-10) to hooks application.
WakeUpGUI significantly decreases time to hooks application because it
generates activity in waiting target process (with windows, dialogs,..). So in
Windows 95/98 and 2000 can be hooked more running processes faster.
From practice I can say that in 95/98 can be hooked everything except
KERNEL32.dll and 16bit processes. Processes waiting for console input are
hooked after some activity in console window/full screen.
In Windows 2000 is hooking processes waiting for non-windows-message object
(console input, mutex,.. finally any waiting projects to KeWaitForMutexObject)
difficult. For example when you open any windows .hlp file, 2 winhlp32.exe
processes are created in NT4/W2K. One process has window and can be easily
hooked but the second process which created the 1st winhlp32 process doesn't
have windows and waits for the 1st process termination (WaitForSingleObject)
will be hooked after termination of the 1st winhlp32 process. Processes
waiting for console input will be hooked after pressing Enter.

Hooking running protected process
---------------------------------
If you have right to debug programs (typically if you are administrator) you
can apply hooks to any process except Idle, System and smss.exe (kernel
process or kernel32.dll not present). For -o hooking protected processes like
services, csrss, lsass,... use WNT-2K version only! The only exception is
winlogon where can be used W2K version as well.


你说的是这个的上一个版本吧?
iamnotyou 2003-01-07
  • 打赏
  • 举报
回复
ApiHooks for Win32
------------------
version 2.0, released Jan-04-2000


ApiHooks allows to hook any API in specified process.
-----------------------------------------------------
ApiHooks allows inserting module (with hooks) into the specified process.
ApiHooks exports EstablishApiHooks functions for usage in your programs.


What is it good for?
--------------------
File monitors, Registry monitors, Windows hooks, Antiviruses, Dumpers,
Unpackers, Patchers, Spies, Trainers, ....


In any doc "to hook something" means "to apply hooks to something".



What's API hook?
----------------

module0 module1
| |
CALL module1!API001 --------------------------------->| API001
|<-------------------------------------------|
| |
API215 |<----------------------------------CALL module0!API215
|------------------------------------------->|
| |
* *
vs.

module0 Hooooks.dll module1
| | |
CALL module1!API001 -------->API001>----------------->| API001
|<-----------------<HOOOOK<------------------|
| | |
API215 |<-----------------<API215<---------CALL module0!API215
|------------------>HOOOOK>----------------->|
| | |
* * *


Hooking is module specific, so you can hook import of selected modules
in process and watch selected pathways. Use ALL_MODULES to hook everything.

ApiHooks was not tested, cause I have no testers.

ApiHooks uses "OpenThread9x" technique seen in ATM by Enrico Del Fante
(great!).
ApiHooks and examples were built using WINDOWS.inc by Iczelion & hutch.

--------------------------------------------------------------------
isdong 2003-01-07
  • 打赏
  • 举报
回复
网络上面应该有,我在公司,代码不在这里,你要是明白钩子的工作原理应该很快就明白了,不需要源代码也可以写
iamnotyou 2003-01-07
  • 打赏
  • 举报
回复
可以给我源代码,看一下吗?
谢谢
keer120@sina.com
isdong 2003-01-07
  • 打赏
  • 举报
回复
钩子即可,很早前有个apihook1.0的代码即是。你想的复杂了

16,548

社区成员

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

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

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