Drew Wutka
DWUTKA at Marlow.com
Thu Aug 26 10:28:55 CDT 2010
Yep, back in the day, I was creating a VB program that would 'remote' an Access session. At the time, we had an Access database that was basically a big reporting engine for our production database. The reports run, would prompt with dialog boxes (Access generated). So the 'remote' program I wrote, would run the report in one thread, and in a separate thread, it would watch for dialog boxes. When one appeared, it used Window API calls to capture the dimensions and characteristics of the dialog box, and then it recreated them in an HTML format. Worked pretty good. Our remote users could run all the reports they wanted, and they got web pages that displayed the dialog prompts until the report actually ran (and the report was then sent in HTML or .snp format). When I tried to use the same process for an Access Form, however, that's when I ran into the monstrous subclassing that Access uses on it's forms. I have two little apps I wrote a long time ago, one's MoveWindows (when you run the program, it builds a treeview of all the windows on your computer, and allows you to manipulate the coordinates and whether they are visible or not), the other is Window Info. When that one runs, it displays the window info of whatever the mouse is over. If someone has a place to put them up on the web, I can email the .exes out. (They were written in VB, but almost everyone has the VB runtimes installed nowadays). It's a 13k zip file with both .exes. Run that Show Windows one, and you'll see the difference between an Access Form, and almost any other window on your machine. Heck, the Show Windows app itself, when you move your mouse over the text boxes, shows each text box to be its own window. Do that over an Access Form, and you'll see it's not what you'd expect. There are several 'child' windows, but the only 'control' is the active one, so when you move focus from one control to the next, the 'active' window moves to that control, everything else on the form is 'non-existant' as far as Windows is concerned. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, August 26, 2010 8:55 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Option Group's Control Collection - Weird Behavior A.D. / Michael, If I remember correctly, objects in Access are not individual "windows", in other words you cannot get a handle to window for a combo or a text box (or anything else) in Access. In most programs, when a graphical object is drawn by the windows operating system, Windows maps the memory, Windows draws it, and Windows hands you back a Handle To Window for that object, IOW it creates a handle to the exact piece of screen real estate that Windows uses. This is all just vague memories but the bottom line is that every "object" on a form is somehow drawn internally by Access (not directly by Windows), and I *believe* that is what you are running into here. When you programmatically move objects around, you are confusing the code internal to Access that draws and keeps track of where objects are drawn on the screen. IIRC Drew knows a lot about this stuff, in fact I think it was Drew that discussed all this stuff ages ago. John W. Colby www.ColbyConsulting.com Michael Mattys wrote: > Hi A.D., > > I changed the number to move in the loop to 10. > I haven't come upon a solution yet, but I do find this amusing! > > Michael R Mattys > Business Process Developers > www.mattysconsulting.com > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of A.D. Tejpal > Sent: Thursday, August 26, 2010 1:29 AM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Option Group's Control Collection - Weird Behavior > > Further to my previous post, I would like to add that the anomaly is > confined to manipulation of top property, if the toggle buttons are in same > horizontal alignment to start with. No problem with left property. > > Best wishes, > A.D. Tejpal > ------------ -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited.