Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How I can move TopLevel Form without TitleBar?
Message
De
22/01/2001 11:42:07
 
 
À
22/01/2001 09:11:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00465622
Message ID:
00466678
Vues:
12
Bernard, I tried it and it does work. There is one proviso though. The GetFocus API call actually gets the keyboard focus. Because the controls on the form don't have actual window handles, it works. But, and hopefully this is just a small but, try this:

add an activex control that does have an hwnd (for example, MS's Date/Time Picker control). Now bring up the form, and click on the OLE control and set a date. Now click on the form and try moving it.

As long as the last control on the form to have the focus does not have it's own HWnd, it works properly.

You might want to add a line in the mousedown to set the focus somewhere safe before trying to move the form just in case.

Alan

>>Hi!
>>
>>It just dp npt works. I'm using Windows NT, VFP 6.0 SP3.
>>How I should run it to see how it works? Currently I'm trying to drag window, but it simple do not move at all...
>>
>>>>TopLevel Form and Screen.visible=.F.
>>>Alex
>>>
>>>Check out my form class in the File section of UT under classes.The number is 1291 I think, Look for "Cool shaped splash screen" and check out the mousedown event!
>>>
>>>No Titlebar, no move event, no show/hide code. Just API.
>>>
>>>
>>>Bernard
>
>
>Run splashdemo.prg
>
>This shows the form on screen.
>
>Now LEFT click and DRAG. Watch it move.
>
>To see the code look at the MOUSEDOWN() event
>
>* MOUSEDOWN
>LPARAMETERS nButton, nShift, nXCoord, nYCoord
>* Following code moves a TitleLess Window
>
>IF nButton = 1 && left mouse
> * GET WINDOW HANDLE
> * NOTE - Case is important in the Declare. MUST be exactly as shown!
> DECLARE INTEGER GetFocus in WIN32API
> lnHandle = GetFocus()
>
>
> mc001A = 274 &&H112%
> mc001C = -4078 &&HF012%
> Declare INTEGER ReleaseCapture in WIN32API
> Declare INTEGER SendMessage in WIN32API INTEGER, INTEGER, INTEGER, INTEGER
> bb=ReleaseCapture()
> bb=SendMessage(lnHandle, mc001A, mc001C,0)
>ENDIF
>
>
>That's all. Works for me in WIN 95,98 and NT4
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform