Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

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



Building the Right Environment to Support AI, Machine Learning and Deep Learning

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.



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