Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Repositioning messageboxes
Message
 
 
À
04/01/2000 15:24:12
Stephen Hunt
Admit Computer Services Inc.
Farmingdale, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00312704
Message ID:
00313051
Vues:
62
Stephen,

It's kind of a hack and the messagebox will pop up centered and then move, but this will work:
ox = createobject( "mytimer" )

#define SWP_NOSIZE          0x0001
#define HWND_NOTOPMOST  -2

declare integer FindWindow in win32api ;
  string lpClassName, ; && pointer to class name
  string lpWindowName   && pointer to window name

declare integer SetWindowPos IN win32api ;
  integer hWnd,            ; && handle to window
  integer hWndInsertAfter, ; && placement-order handle
  integer X,               ; && horizontal position
  integer Y,               ; && vertical position  
  integer cx,              ; && width
  integer cy,              ; && height
  integer uFlags             && window-positioning flags

=messagebox( "test", 0, "My Title" )
ox = .null.
return

define class MyTimer as timer

procedure Init()
this.Interval = 1
this.Enabled = .t.
endproc

procedure Timer()
this.Enabled = .f.
local lnHWND
lnHWND = FindWindow( .null., "My Title" )
SetWindowPos( lnHWND, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE )
endproc

enddefine
The timer is needed because the MessageBox is modal as far as VFP is concerned.

>when using the =MESSAGEBOX() is there a way to reposition the messagebox to a different location on the screen instead of it allways being in the middle ?
>
>Thanks for your help !
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform