![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-28 23:42 |
47,816 topics / 349,916 posts / today 2 new / 48,265 members |
| DOS批处理 & 脚本技术(批处理室) » Implement screenshot to system clipboard or Paint using VBS script |
| Printable Version 4,615 / 22 |
| Floor1 my3439955 | Posted 2007-06-16 21:48 |
| 中级用户 Posts 99 Credits 272 | |
|
This way, integrating short third-party tools into a VBS script can achieve more abundant functions.
This post can also serve as a general method for embedding binary code in VBS. The code from the twelfth floor adds support for sending to Paint [ Last edited by my3439955 on 2007-6-18 at 07:12 PM ] |
|
| Floor2 lxmxn | Posted 2007-06-16 21:51 |
| 版主 Posts 4,938 Credits 11,386 | |
|
This is pretty good, give some extra points to encourage.
|
|
| Floor3 wudixin96 | Posted 2007-06-16 22:01 |
| 银牌会员 Posts 931 Credits 1,928 | |
|
Also use XML. Not bad. Add points, :-)
|
|
| Floor4 my3439955 | Posted 2007-06-16 22:05 |
| 中级用户 Posts 99 Credits 272 | |
|
Otherwise, you can't write binary files.
|
|
| Floor5 zh159 | Posted 2007-06-16 23:04 |
| 金牌会员 Posts 1,467 Credits 3,687 | |
|
The larger the binary file, the more space it seems to save when converted by baomaboy's "Convert to Batch File" (small files mainly have more script writing parts)
LZ's is 3.57k, this one is 3.1k [ Last edited by zh159 on 2007-6-16 at 11:05 PM ] |
|
| Floor6 my3439955 | Posted 2007-06-16 23:06 |
| 中级用户 Posts 99 Credits 272 | |
|
Right. This one uses a much larger character set than mine. Therefore, it must have an advantage in terms of compression ratio.
|
|
| Floor7 zh159 | Posted 2007-06-16 23:14 |
| 金牌会员 Posts 1,467 Credits 3,687 | |
|
The advantage of this is that you can directly write hexadecimal data into a bin; I just used it before, converting GB characters to hexadecimal UTF-8 encoding and writing it as a BIN file
|
|
| Floor8 eech | Posted 2007-06-16 23:39 |
| 高级用户 Posts 346 Credits 906 | |
|
Great, after asking for so long, there's finally a result. Can we directly send the captured image to Paint? That would be much more convenient. I wonder if the requirement is too excessive, heh.
|
|
| Floor9 eech | Posted 2007-06-16 23:49 |
| 高级用户 Posts 346 Credits 906 | |
|
Isn't it good to add another line of code to delete the generated temporary files? Just generate them when needed.
|
|
| Floor10 my3439955 | Posted 2007-06-16 23:53 |
| 中级用户 Posts 99 Credits 272 | |
|
This is a program written purely with APIs. It's already not easy to be as small as 1.5K. If it needs to support image saving, the program will be extremely complicated. Using class libraries is simpler, but the target program is then very large. It's a dilemma.
|
|
| Floor11 my3439955 | Posted 2007-06-16 23:57 |
| 中级用户 Posts 99 Credits 272 | |
Originally posted by eech at 2007-6-16 23:49: Hmm That's pretty good But many times that program will pop up a notification dialog box The program is resident in memory It cannot be deleted |
|
| Floor12 my3439955 | Posted 2007-06-17 00:44 |
| 中级用户 Posts 99 Credits 272 | |
|
Now it can support sending to Paint.
The Exe file generated by the following script with the /c parameter can achieve the function of sending to Paint. View how to use this type of VBS script [ Last edited by my3439955 on 2007-6-17 at 06:49 PM ] |
|
| Floor13 zh159 | Posted 2007-06-17 01:15 |
| 金牌会员 Posts 1,467 Credits 3,687 | |
|
Modify it can delete temporary files
|
|
| Floor14 my3439955 | Posted 2007-06-17 11:54 |
| 中级用户 Posts 99 Credits 272 | |
|
Could it be that the program has already been deleted before it had the chance to start?
|
|
| Floor15 zh159 | Posted 2007-06-17 13:51 |
| 金牌会员 Posts 1,467 Credits 3,687 | |
Originally posted by my3439955 at 2007-6-17 11:54: I've tried it and can capture the screen. You can also give it a try. The key is WScript.CreateObject("WScript.Shell").Run TargetFileName & " /s",,true. Using true ensures that the next step is entered only after the program being run finishes execution. PS: Two commas are needed because the first comma segment can increase the use of vbhid for hidden running. |
|
| 1 2 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |