|
-
Nov 20th, 2001, 09:50 AM
#1
Thread Starter
Addicted Member
(Resolved)....Disable Internet Explorer Maximize button....
Hello,
Does anyone know if it is possible to disable the Internet Explorer's maximize button and how to do it? Please help.....
Thanks.
______________________________________
vbBoy.
Last edited by vbBoy; Nov 22nd, 2001 at 12:55 PM.
-
Nov 20th, 2001, 12:32 PM
#2
Fanatic Member
uses form with a command button called cmdKillIE
Code:
Option Explicit
Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
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 MF_BYCOMMAND = &H0&
Private Const SC_MINIMIZE = &HF020
Private Const WS_MINIMIZEBOX = &H20000
Private Const SC_MAXIMIZE = &HF030&
Private Const WS_MAXIMIZEBOX = &H10000
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Sub cmdKillIE_Click()
Dim lhWnd&
Dim hMenu As Long, k As Long
lhWnd = FindWindowEx(0&, 0&, "IEFrame", vbNullString)
hMenu = GetSystemMenu(lhWnd, False)
k = DeleteMenu(hMenu, SC_MAXIMIZE, MF_BYCOMMAND)
k = GetWindowLong(lhWnd, GWL_STYLE)
k = k Xor WS_MAXIMIZEBOX
SetWindowLong lhWnd, GWL_STYLE, k
End Sub
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Nov 22nd, 2001, 12:54 PM
#3
Thread Starter
Addicted Member
Thanxs crispin
It did help.
_______________________________________________
vbBoy.
-
Nov 23rd, 2001, 03:06 AM
#4
Fanatic Member
hi crispin
hi crispin
It did work... but if i try it once again it gets back the maximize button..
but on clicking the maximize button my IE doesnt get maximized...
maximize button becomes useless..
could you please check it..
thanks,
Pradeep
-
Nov 23rd, 2001, 04:10 AM
#5
Fanatic Member
If you look at the code you'll see that the button state gets Xor'd, this means that you can turn the button on and off, but the functionality is removed from the menu earlier in the code, so you can turn the button on and off but the functionality remains off.....
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Nov 23rd, 2001, 04:15 AM
#6
Fanatic Member
do you mean that if i remove the following line in your code
k = DeleteMenu(hMenu, SC_MAXIMIZE, MF_BYCOMMAND)
would serve my purpose..
that is i need your app to just toggle the state of the max button
and not its property..
Thanks in advance,
Pradeep
-
Nov 23rd, 2001, 04:16 AM
#7
Fanatic Member
try it and see
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Nov 23rd, 2001, 04:19 AM
#8
Fanatic Member
wow
Its working....
Thanks crispin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|