Okay, I confess I'm ignorant about DC and HWND and associated Windows stuff.
With that said, here's what I need...
I have an error routine that sends me an email when the user trips over
an error. It has all the needed info but I thought it would be great to
create a snapshot of the screen, save it to a file, and attach that
image file to the error email. So far, I have that working, but the
problem is that the routine uses a call to "GetFocus()" to determine the
window "handle" it creates the snapshot from and sometimes that is not
what I want. Sometimes I get a really nice snapshot of one of the DBI
OCX controls on my Foxpro form, sometimes I get the form (that triggered
the error)....which is what I wanted...and sometimes I get a snapshot of
the form but it is empty. Totally blank without controls (buttons, text
fields, etc.) This approach has a great potential, but so far has been
minimal value.
Which brings me to my lack of understanding about the Windows World of
device contexts and Windows Handles, etc.
What I do (I think) know is that VFP 9 (and its predecessors) does not
handle its form windows in a Windows way. Whether for speed enhancement,
or developmental baggage, I dunno. Not really concerned about the why.
What I want, I think, is the HWND or DC (are they similar? the same?)
for the entire VFP application's main desktop.
Oh, I have one main window for the app, and all the other forms and
windows are contained within that main window. I forget the terminology
for that approach, but I just need the integer value of that main window
so I can snap a screen shot of it. Here are some of the options
available for obtaining this info...
DECLARE INTEGER GetFocus IN user32
(seems to only grab the "currently clicked on thing"....this is
what I now use)
DECLARE INTEGER GetWindowRect IN user32 INTEGER hwnd, STRING @lpRect
(am not using this, but it would obtain the DC for the window
bounded by the lpRect string)
As I understand it, there are also GetDesktopWindow and GetActiveWindow,
which I suspect would do what I need? Maybe not.
Or, is there, by using _vfp or _screen, a way to get the DC/HWND?
Somebody edukate me on this simple detail. I never did grok VB or MSoft
Orifice...
Thanks!
Mike Copeland
Genesis Group Software
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.