Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How to disable maximize button- VB6

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
coder sal
Master Cheater
Reputation: 0

Joined: 11 May 2007
Posts: 304

PostPosted: Fri Feb 08, 2008 1:08 pm    Post subject: How to disable maximize button- VB6 Reply with quote

In this tut will teach you how to disable the maximize button in Visual Basic 6.0

First go to your declarations and put this in:

Code:
Option Explicit

Private Const WS_MAXIMIZEBOX = &H10000
Private Const GWL_STYLE = (-16)

Private Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long) As Long


Then go to your form code and put this in:

Code:
Private Sub Form1_Load()
Dim lngStyle As Long
lngStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
lngStyle = lngStyle And Not (WS_MAXIMIZEBOX)
lngStyle = SetWindowLong(Me.hwnd, GWL_STYLE, lngStyle)
End Sub


Hope this helped!
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Fri Feb 08, 2008 1:21 pm    Post subject: Reply with quote

idk if you have this in VB, but you can just select the form and disable the MAximize button (Boarder)
Back to top
View user's profile Send private message
coder sal
Master Cheater
Reputation: 0

Joined: 11 May 2007
Posts: 304

PostPosted: Fri Feb 08, 2008 1:45 pm    Post subject: Reply with quote

That takes away the maximize button, in the tut I teach you how to disable the maximize button.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Fri Feb 08, 2008 4:57 pm    Post subject: Reply with quote

Same code can be found at:
http://www.xtremevbtalk.com/showthread.php?t=4495
http://www.prog.hu/tudastar/73001-30/Access-urlap+ablak+elozo+merete+letiltasa.html
http://www.vbforums.com/archive/index.php/t-231689.html
(And plenty of other sites..)

Credit the code you didn't make please. The most you did was remove the function and move the code to Form_Load.

Not to mention it doesn't work anyway. (The one you posted.)


Credits:
http://www.prog.hu/tudastar/73001-30/Access-urlap+ablak+elozo+merete+letiltasa.html

Code:
Option Explicit

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_MAXIMIZEBOX = &H10000
Private Const GWL_STYLE = (-16)
Private Const WS_MAXIMIZE = &H1000000

Private Sub Form_Load()
    Dim lngStyle As Long
    lngStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
    lngStyle = lngStyle And Not (WS_MAXIMIZEBOX) Xor WS_MAXIMIZE
    lngStyle = SetWindowLong(Me.hwnd, GWL_STYLE, lngStyle)
End Sub

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
coder sal
Master Cheater
Reputation: 0

Joined: 11 May 2007
Posts: 304

PostPosted: Tue Feb 12, 2008 9:43 pm    Post subject: Reply with quote

Wiccaan wrote:
Same code can be found at:
http://www.xtremevbtalk.com/showthread.php?t=4495
http://www.prog.hu/tudastar/73001-30/Access-urlap+ablak+elozo+merete+letiltasa.html
http://www.vbforums.com/archive/index.php/t-231689.html
(And plenty of other sites..)

Credit the code you didn't make please. The most you did was remove the function and move the code to Form_Load.

Not to mention it doesn't work anyway. (The one you posted.)


Credits:
http://www.prog.hu/tudastar/73001-30/Access-urlap+ablak+elozo+merete+letiltasa.html

Code:
Option Explicit

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_MAXIMIZEBOX = &H10000
Private Const GWL_STYLE = (-16)
Private Const WS_MAXIMIZE = &H1000000

Private Sub Form_Load()
    Dim lngStyle As Long
    lngStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
    lngStyle = lngStyle And Not (WS_MAXIMIZEBOX) Xor WS_MAXIMIZE
    lngStyle = SetWindowLong(Me.hwnd, GWL_STYLE, lngStyle)
End Sub


I didn't get the code from any of those sites. I got it from a weird website really long ago and I made a .txt file for it. After like a while I decided to post the code on CEF, so idk who to give credits to, I would give credits though, I am not a leecher.
Back to top
View user's profile Send private message
Trow
Grandmaster Cheater
Reputation: 2

Joined: 17 Aug 2006
Posts: 957

PostPosted: Wed Feb 13, 2008 3:23 am    Post subject: Reply with quote

(really, selecting MaxButton and making it False on a standard form does the same thing...)

good for runtime adjustment, yes

_________________
Get kidnapped often.
Back to top
View user's profile Send private message
Tosy
How do I cheat?
Reputation: 0

Joined: 20 Jul 2007
Posts: 5

PostPosted: Wed Feb 13, 2008 9:38 am    Post subject: Reply with quote

Lol..If you know Private declares then its very easy to code in VB Very Happy
Back to top
View user's profile Send private message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Wed Feb 13, 2008 3:22 pm    Post subject: Reply with quote

Or...

You cn click the form and go to properties -> Maximize and change it to false.

_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
XxOsirisxX
Grandmaster Cheater Supreme
Reputation: 0

Joined: 30 Oct 2006
Posts: 1597

PostPosted: Wed Feb 13, 2008 3:29 pm    Post subject: Reply with quote

Wiccaan wrote:
Same code can be found at:
http://www.xtremevbtalk.com/showthread.php?t=4495
http://www.prog.hu/tudastar/73001-30/Access-urlap+ablak+elozo+merete+letiltasa.html
http://www.vbforums.com/archive/index.php/t-231689.html
(And plenty of other sites..)

Credit the code you didn't make please. The most you did was remove the function and move the code to Form_Load.

Not to mention it doesn't work anyway. (The one you posted.)


Credits:
http://www.prog.hu/tudastar/73001-30/Access-urlap+ablak+elozo+merete+letiltasa.html

Code:
Option Explicit

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_MAXIMIZEBOX = &H10000
Private Const GWL_STYLE = (-16)
Private Const WS_MAXIMIZE = &H1000000

Private Sub Form_Load()
    Dim lngStyle As Long
    lngStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
    lngStyle = lngStyle And Not (WS_MAXIMIZEBOX) Xor WS_MAXIMIZE
    lngStyle = SetWindowLong(Me.hwnd, GWL_STYLE, lngStyle)
End Sub


Sorry Wiccann, but this line is'nt neccessary

Code:
Private Const WS_MINIMIZEBOX = &H20000

_________________

Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Feb 13, 2008 4:35 pm    Post subject: Reply with quote

XxOsirisxX wrote:
Wiccaan wrote:
Same code can be found at:
http://www.xtremevbtalk.com/showthread.php?t=4495
http://www.prog.hu/tudastar/73001-30/Access-urlap+ablak+elozo+merete+letiltasa.html
http://www.vbforums.com/archive/index.php/t-231689.html
(And plenty of other sites..)

Credit the code you didn't make please. The most you did was remove the function and move the code to Form_Load.

Not to mention it doesn't work anyway. (The one you posted.)


Credits:
http://www.prog.hu/tudastar/73001-30/Access-urlap+ablak+elozo+merete+letiltasa.html

Code:
Option Explicit

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_MAXIMIZEBOX = &H10000
Private Const GWL_STYLE = (-16)
Private Const WS_MAXIMIZE = &H1000000

Private Sub Form_Load()
    Dim lngStyle As Long
    lngStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
    lngStyle = lngStyle And Not (WS_MAXIMIZEBOX) Xor WS_MAXIMIZE
    lngStyle = SetWindowLong(Me.hwnd, GWL_STYLE, lngStyle)
End Sub


Sorry Wiccann, but this line is'nt neccessary

Code:
Private Const WS_MINIMIZEBOX = &H20000


I never said any of the code was needed. I copy pasted from the link I credited just above the code.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
XxOsirisxX
Grandmaster Cheater Supreme
Reputation: 0

Joined: 30 Oct 2006
Posts: 1597

PostPosted: Wed Feb 13, 2008 4:40 pm    Post subject: Reply with quote

Wiccaan wrote:
XxOsirisxX wrote:
Wiccaan wrote:
Same code can be found at:
http://www.xtremevbtalk.com/showthread.php?t=4495
http://www.prog.hu/tudastar/73001-30/Access-urlap+ablak+elozo+merete+letiltasa.html
http://www.vbforums.com/archive/index.php/t-231689.html
(And plenty of other sites..)

Credit the code you didn't make please. The most you did was remove the function and move the code to Form_Load.

Not to mention it doesn't work anyway. (The one you posted.)


Credits:
http://www.prog.hu/tudastar/73001-30/Access-urlap+ablak+elozo+merete+letiltasa.html

Code:
Option Explicit

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_MAXIMIZEBOX = &H10000
Private Const GWL_STYLE = (-16)
Private Const WS_MAXIMIZE = &H1000000

Private Sub Form_Load()
    Dim lngStyle As Long
    lngStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
    lngStyle = lngStyle And Not (WS_MAXIMIZEBOX) Xor WS_MAXIMIZE
    lngStyle = SetWindowLong(Me.hwnd, GWL_STYLE, lngStyle)
End Sub


Sorry Wiccann, but this line is'nt neccessary

Code:
Private Const WS_MINIMIZEBOX = &H20000


I never said any of the code was needed. I copy pasted from the link I credited just above the code.


My bad trough, i will read better before post next time =x

_________________

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites