IPB

Welcome Guest ( Log In | Register )


 
Reply to this topicStart new topic
> Macro to Copy Window to MS Paint
DAS
post Sep 22 2005, 07:05 PM
Post #1


Member
***

Group: Members
Posts: 398
Joined: 27-August 02
Member No.: 690
Which Program?: DNS 8.0
Where are you Located: San Diego



Here is a little macro to copy the active Window to MS paint. It uses a Windows API call to do a "Print Screen". It then opens Paint (or you can change to any program) and pastes the Window.

I used it to create the thumbnail below.

Code:

Option Explicit
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal _
bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Private Const KEYEVENTF_KEYUP = &H2
Private Const VK_SNAPSHOT = &H2C
Private Const VK_MENU = &H12

Sub Main

keybd_event VK_SNAPSHOT, 1, 0, 0 'capture active window
'keybd_event VK_SNAPSHOT, 0, 0, 0 'capture entire screen

AppBringUp "mspaint" 'Opens MS Paint
Wait .5
SendKeys "^V", True 'Pastes Picture into Paint
SendKeys "{Enter}" 'Presses Enter in case Paint wants to resize

End Sub

If you want to import the macro, download the file and change it from .txt to .dat unsure.gif
Attached thumbnail(s)
Attached Image
 

Attached File(s)
Attached File  Take_a_picture.txt ( 684bytes ) Number of downloads: 133
 
Go to the top of the page
 
+Quote Post
Ingram
post Sep 23 2005, 08:25 AM
Post #2


Moderator
***

Group: Admin
Posts: 550
Joined: 3-May 04
Member No.: 1,486
Where are you Located: Williamsburg, Virginia



This is cool!!!

I needed this for taking screen shots of troubleshooting, and or when I'm making documents, I can get a quick shot, edit the part I want, and use it for a picture insertion(s)...

Excellent macro DAS!!! You have embraced the psychedelic side of Dragon!

Ingram


--------------------
Go to the top of the page
 
+Quote Post
DAS
post Sep 23 2005, 10:04 AM
Post #3


Member
***

Group: Members
Posts: 398
Joined: 27-August 02
Member No.: 690
Which Program?: DNS 8.0
Where are you Located: San Diego



rolleyes.gif
Go to the top of the page
 
+Quote Post
John Wickett
post Sep 23 2005, 05:32 PM
Post #4


Moderator
****

Group: Super Moderators
Posts: 4,266
Joined: 9-January 01
From: wickworks@xplornet.com
Member No.: 51
VR User?: about 18 years
Which Program?: DragonDictate then DNS
Why do you Use VR?: Ease, speed, and to stay current to assist disabled clients
Where are you Located: Villsge Green, PEI, Canada



David,

Well-done, I have done the same thing often that have "voiced" my way through it; I never even thought about making a macro as I don't have to use that function very often although I can see where it would be of great benefit! :-)

Dictated with Dragon Naturally Speaking Version 8 Professional
John Wickett
PEI Canada
902-368-0141
902-651-2152
jwickett@auracom.com
john.wickett@vac-acc.gc.ca
Go to the top of the page
 
+Quote Post
Larry Allen
post Sep 23 2005, 06:20 PM
Post #5


Member
***

Group: Members
Posts: 459
Joined: 15-May 03
From: Phoenix Arizona
Member No.: 1,104



I've had a similar macro for clients that has proven quite effective. Sometimes I've named it "kodak moment" as an easy-to-remember command name to give when something has gone wrong. Typically, in addition to opening Paint (historically I've used WordPad, but the principle is identical), I've added code such as the following to put the screenshot into a file and close the application. These screen shots have been key to solving several difficult-to-reproduce problems. Code such as the following can be appended:



SendKeys "%fa",True ' Save As function in File menu
Wait .5 ' not needed on all systems
' next line is for a file name with the time of the problem
SendKeys "ScreenShot Taken " & Format(Now, "mm-dd-yy hh:mm",True
SendKeys "%s", True ' save it
SendKeys "%fx",True 'exit Paint


There are variations such as switching to a directory other than the default for saving the screenshot.

Larry Allen
http://www.pcspeak.com


--------------------
Larry Allen
http://www.pcspeak.com
Author, "Scripting for Dragon NaturallySpeaking 9"
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th June 2013 - 05:10 AM

We Recommend Using Dragon Medical and Dragon NaturallySpeaking Speech Recognition Software

Physicians Using Dragon Medical - Looking for the Best Electronic Health Record (EHR / EMR)?