Solved

How can make the window(vbform) unmovable using API?

Posted on 2002-03-08
5
228 Views
Last Modified: 2012-06-27
How can make the window(vbform) unmovable using API?
0
Comment
Question by:kkps_s
5 Comments
 
LVL 1

Expert Comment

by:Madmarlin
ID: 6850309

.Moveable property

Form1.Moveable = false.
0
 
LVL 1

Expert Comment

by:Madmarlin
ID: 6850310
Ah sorry didnt read it all..
0
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6850483
I have tested it and figured out, that you can't reset the
windows WS_EX_NODRAG flag during runtime. I think you can only set this attribute during a CreateWindowEx Api call which creates the window ... Resetting the attribute with this code bring no results because my explanations above:

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_NODRAG = &H40000000

Private Sub Form_Activate()
 Call SetWindowLong(Me.hwnd, GWL_EXSTYLE, WS_EX_NODRAG)
End Sub


;)
WoK
0
 
LVL 5

Expert Comment

by:kcm76
ID: 6851333
try other ways. like
u can always disable/hide the move menuitem in the system menu of the dialog box. also the hide the mousecursor in the dialog bar.

KCM
0
 
LVL 8

Accepted Solution

by:
glass_cookie earned 75 total points
ID: 6852225
Hi!

Here's a file for you over the net:

Download...
http://www.vb-helper.com/HowTo/nomove.zip
Description: Prevent a form from moving (3K)

That's it!

glass cookie : )
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question