 |
| How to position the GETPRINTER() dialog |
User rating: 0/10 (0 votes) | |
|
|
 |
 |
| Before you begin: |
 |
The GETPRINTER() dialog normaly appears at the left top corner of the main window of FoxPro.

What if you want it to popup in the middle of the screen?
The interface has no input parameters that can be used to position the dialog. Still the Timer control and several API calls can solve this small problem.
The same technique is used in another example Using Extended MessageBox() Class. First you start a Timer, then call the GETPRINTER(). Amazingly, the Timer keeps ticking behind this otherwise perfectly modal window. So from the Timer event you can access the dialog and move it.
This is not the ideal solution, because the dialog may "jump" -- fixed [May 9, 2006] by locking and subsequently unlocking drawing in the Windows desktop.
See also:
|
 |
 |
| |
| |
Members area. Log in to view this example. |
|
| |
|
|
|
|
|
 |
User rating: 0/10 (0 votes) | |
| 2233 bytes Created: 2005-03-04 09:08:20 Modified: 2011-12-10 09:20:22 Visits in 7 days: 119 |
|
 |
 |
| Listed functions: |
 |
|
 |
 |
| My comment: |
 |
Try this approach with other dialogs, like GETFONT(), GETFILE(). Note that in case of another dialog you must use the window title constant different from GETPRINTER_CAPTION.
Technically, you can even play an AVI on the dialog. Take a look at How to play AVI file on the _screen example. BTW, the TAvi also inherits the Timer class. |
 |
 |
| Word Index links for this example: |
 |
|
|
 |
 |
| Translate this page: |
 |
|