Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Messagebox()
Message
From
25/02/2016 18:59:02
 
 
To
25/02/2016 13:49:23
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01632079
Message ID:
01632105
Views:
84
Hi John
this needs some VFP advanced coding with APIs as
setWindowLong,setWindowPos,CallwindowProc,FindWindowEx,SendMessage ,setlayeredWindow ...
and bindevent (recquiert vfp9)
the complet answer to your big question is in this link (Herman Tan):
http://hermantan.blogspot.com/2008/07/centering-vfp-messagebox-in-any-form.html
*how to use
save the complet code in a prg (myMessagebox.prg but replace the line:
** ** lo_MsgBox.hWnd = myForm.hWnd && center MessageBox in myForm && center MessageBox in myForm 
by
** lo_MsgBox.hWnd = hWnd 
and add at the top of this mymessagebox.prg this line
lparameters hwnd      &&receive a handle of any window as parameter
cut all the "?" in the mymessagebox.prg to dont echoing result on the form
add "clea dlls " as this to make the button not hanging after first try:
lo_MsgBox = Null
Release lo_MsgBox
clea dlls   &&important..can name the APis used is better ("..","..",...)
from any form for ex make a button with this code
do mymessagebox with thisform.hwnd
and see the diffrent messagebox (3th messagebox to 6th)...move the form and repeat...the messagebox is centered on the window (form).
can be any window given by its hwnd.
Note: the setLayeredWindow API made transparency on messagebox also
if you have a problem to make it working tell me i send you a complet test code.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform