Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Aug 7, 1997

Remove that Move!

Sometimes it is desirable to prevent a user from moving a form. A little known feature of Windows is that for any form, functionality that doesn't appear in the control menu (ControlBox in VB terms) is not available to that form. Therefore, remove the Move command from that form's control menu to prevent a form from being moved:

 
Declare Function GetMenu% Lib "User" (ByVal hWnd%)
Declare Function RemoveMenu% Lib "User" (ByVal hMenu%, _
        ByVal nPosition%, ByVal wFlags%)
Const SC_MOVE = &hF010, MF_BYPOSITION = &H400
' This deletes the Move command from the form's
' control menu
Dim Res%
Res = RemoveMenu(GetMenu(Form.hWnd), SC_MOVE, MF_BYCOMMAND)



Phil Parsons
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date