Solved

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

Posted on 2002-03-08
5
221 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now