Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getprinter()
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01355160
Message ID:
01355507
Views:
19
There is a technique in VFP that allows reaching the GETPRINTER dialog via the Timer control. Interestingly the Timer keeps ticking even behind the supposedly modal dialog. The Timer event thus can run some VFP code.

Such code easily identifies the window handle (HWND) of the dialog. Nothing fancy, the GetActiveWindow works just fine. Once the handle is known, various Win32 API Windowing functions can be called using it as the input parameter. In particular: GetWindowPos, SetWIndowPos, GetWindowText, SetWindowText.

The last function on that list does the trick -- sets the dialog caption to the desired one.

A working code sample can be found in the membership area of the website:

How to position the GETPRINTER() dialog
http://www.news2news.com/vfp/?example=482

The following line should be added to the SetPosition method in the code:
= SetWindowText(THIS.hDialog, 'User-defined dialog caption')
preceded by the declaration for the SetWindowText.
Previous
Reply
Map
View

Click here to load this message in the networking platform