?
Solved

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

Posted on 2002-03-08
5
Medium Priority
?
233 Views
Last Modified: 2012-06-27
How can make the window(vbform) unmovable using API?
0
Comment
Question by:kkps_s
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 225 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Suggested Courses
Course of the Month11 days, 3 hours left to enroll

770 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