473,698 Members | 2,192 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to constrain a screen-dump to include only the current form...

MLH
Last month, I posted this...

http://support.microsoft.com/d*efaul...;en-us;1009*73
shows Function Screendump(). It is code that effectively does the
same thing as pressing SHIFT-PRTSCR on your keyboard. I am
trying to modify that code to copy only the screen image of the
current form to the clipboard, rather than the entire Access window.
Here is a small snippet from the function...
'-----------------------------*----------------------
' Get window handle to Windows and Microsoft Access
'-----------------------------*----------------------
DeskHwnd = GetDesktopWindo w()
AccessHwnd = GetActiveWindow ()
'-----------------------------*----------------------
' Get screen coordinates of Microsoft Access
'-----------------------------*----------------------
Call GetWindowRect(A ccessHwnd, rect)
fwidth = rect.right - rect.left
fheight = rect.bottom - rect.top
'-----------------------------*----------------------
' Get the device context of Desktop and allocate memory
'-----------------------------*----------------------
hdc = GetDC(DeskHwnd)
hdcMem = CreateCompatibl eDC(hdc)
hBitmap = CreateCompatibl eBitmap(hdc, fwidth, fheight)
If its possible to drill down the "Get window handle to Windows
and Microsoft Access" operation and do the same sort of thing
for a specific form displayed in the MS Access window, I would
like to do so. That way, when I paste the clipboard contents into
PBrush.exe, only the subject form's image appears - none of the
surrounding image data.
I need read coordinates and make assignments to rect.right,
rect.left, rect.bottom & rect.top for form in the window rather than
the window itself. Suggestions anyone?

xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxx

Terry Kreft was so kind as to post an excellent recommendation. ..

Replace the line
AccessHwnd = GetActiveWindow ()

with
AccessHwnd = Screen.ActiveFo rm.Hwnd

xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxx

I would now like to ask for a solution that would capture some
other types of windows. Specifically, the relationships window,
the database window and the macro design window
Nov 13 '05 #1
1 2396
A simple method is to use the FindWindow API. This API allows you to
find a WIndow handle by the Caption of a Window and/or its Window class.
Here is sample code showing you how to find the Relationship window.
http://www.lebans.com/saverelationshipview.htm

If you have access to Spy++ then it is easy to determine the
Caption/Class of any window you want to programmaticall y find. If you do
not have Spy++ then there are several Freeware alternatives out there.
Alternatively, you could go to the Access Web where you'll find a
solution produced by Dev and Terry that can be used to find the
information you require.
http://www.mvps.org/access/modules/mdl0032.htm

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"MLH" <CR**@NorthStat e.net> wrote in message
news:k9******** *************** *********@4ax.c om...
Last month, I posted this...

http://support.microsoft.com/d*efaul...;en-us;1009*73
shows Function Screendump(). It is code that effectively does the
same thing as pressing SHIFT-PRTSCR on your keyboard. I am
trying to modify that code to copy only the screen image of the
current form to the clipboard, rather than the entire Access window.
Here is a small snippet from the function...
'-----------------------------*----------------------
' Get window handle to Windows and Microsoft Access
'-----------------------------*----------------------
DeskHwnd = GetDesktopWindo w()
AccessHwnd = GetActiveWindow ()
'-----------------------------*----------------------
' Get screen coordinates of Microsoft Access
'-----------------------------*----------------------
Call GetWindowRect(A ccessHwnd, rect)
fwidth = rect.right - rect.left
fheight = rect.bottom - rect.top
'-----------------------------*----------------------
' Get the device context of Desktop and allocate memory
'-----------------------------*----------------------
hdc = GetDC(DeskHwnd)
hdcMem = CreateCompatibl eDC(hdc)
hBitmap = CreateCompatibl eBitmap(hdc, fwidth, fheight)
If its possible to drill down the "Get window handle to Windows
and Microsoft Access" operation and do the same sort of thing
for a specific form displayed in the MS Access window, I would
like to do so. That way, when I paste the clipboard contents into
PBrush.exe, only the subject form's image appears - none of the
surrounding image data.
I need read coordinates and make assignments to rect.right,
rect.left, rect.bottom & rect.top for form in the window rather than
the window itself. Suggestions anyone?

xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxx

Terry Kreft was so kind as to post an excellent recommendation. ..

Replace the line
AccessHwnd = GetActiveWindow ()

with
AccessHwnd = Screen.ActiveFo rm.Hwnd

xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxx

I would now like to ask for a solution that would capture some
other types of windows. Specifically, the relationships window,
the database window and the macro design window


Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
28690
by: J. VerSchave | last post by:
I have a bunch of images that are 600x800 800x600 640x480 480x640 I want to use HTML to contrain the size of these images. I basically want to display them as thumnails. Here is what I am trying to do:
48
8702
by: David J Patrick | last post by:
I'm trying to rewrite the CSS used in http://s92415866.onlinehome.us/files/ScreenplayCSSv2.html. using the w3.org paged media standards as described at http://www.w3.org/TR/REC-CSS2/page.html The ScreenplayCSS is flawed, for several reasons; -overuse of <div id= tags -doesn't scale screen resolutions (convert from px to in, pt ?) -no media="print" (how much coule be shared between "screen" & "print") -no automatic page breaks (with...
6
5613
by: Tony Liu | last post by:
Hi, when switched to the full screen mode in VS.NET IDE, is there any way to hide the main menu bar? Thanks Tony
1
1719
by: Shmulik | last post by:
Is there a way to constrain a Generics class to only accept specific value types, for instance, lets say I want to create a Histogram class that could accept the types int, float, double, etc., but not char or string. Is is possible to declare the class to do this? class Histogram<T values> : constrain to {int, float, double} { ....
8
9426
by: Hei | last post by:
Hi, any ideas how to constrain the numbers of item can check in CheckListBox. i would force user can only check one item. thx William
0
3274
by: Jeffery Tyree | last post by:
I have a machine that will be used to demo some Excel spreadsheets at a convention. Because I did not author the spreadsheets and attendees will be allowed to play with the spreadsheets, I needed a way to periodically restore the original versions. In addition to the "always-on-top click this button to reset demo" application I wrote, I chose to use screen saver code to reset the demo after a period of inactivity in the event an attendee...
2
1557
oll3i
by: oll3i | last post by:
how to constrain a collection so it takes only strings
6
1727
oll3i
by: oll3i | last post by:
how to constrain a string to 30 chars?
0
1026
by: yashgt | last post by:
We have a ASP .NET 2.0 app that has a header, left nav and center. We want to provide a design mode so that the left nav and center can be interchanged. Also the header can be dragged and brought down as the footer. How can we constrain the movement of webparts so that the user cannot drag the left nav and place in the location of the header? What webpartzones will have to be created?
1
2224
karthickkuchanur
by: karthickkuchanur | last post by:
Please help me how rename my column and add contrain to my table I have tried alter but i cant able to add constrain
0
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9026
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8893
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7723
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4366
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2328
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.