Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ZOrder
Message
 
 
À
07/05/2000 19:16:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Re: ZOrder
Divers
Thread ID:
00367023
Message ID:
00367128
Vues:
28
Hi Keith,

Dave gave me the following code which uses an API call to set a window to the always on top:
* HelpOnTop.prg 05-Jan-99

* Set the VFP6 help window to always ontop

* Usage: HelpOnTop( lOnTop )
* lOnTop - .t. set it to top
*          .f. set it to not on top

lparameter tcWindowCaption,plOnTop

if ( ( type( "plOnTop" ) != "L" ) or ( pcount() = 0 ) )
   plOnTop = .t.
endif

local lnHwnd

#DEFINE HWND_TOPMOST -1
#DEFINE HWND_NOTOPMOST -2
#DEFINE SWP_NOSIZE 1
#DEFINE SWP_NOMOVE 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
  
lnHwnd = FindWindow( .null., tcWindowCaption)

if ( lnHwnd > 0 )
   SetWindowPos( lnHwnd, iif( plOnTop, HWND_TOPMOST, HWND_NOTOPMOST ), 0,0,0,0, SWP_NOSIZE + SWP_NOMOVE )
endif
>I've done that. That didn't work.
>
>I also tried ZORDER(), etc.
>Setting the _SCREEN.AlwaysOnTop etc.
>
>That doesn't work.
>
>Am I doing something wrong?
>
>This seems like a simple operation...
Rick Hodder
MCP Visual Foxpro
C#, VB.NET Developer
Independent Consultant
www.RickHodder.com
MyBlog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform