Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Remove Close Button From App Window


How do I remove the close (X) button from my Application window ? What is the API call to do this, and what are the steps please .Thanx in advance.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To REMOVE The X Close Button?
Umm, ive searched the forums but cant find how to REMOVE the x(close) not disable it?? anyone know how to??

How To Remove Control Box (close Button)
Hi all, I woul like to know how to remove the control box in a form at run time.

I appreciate for any comments.

Remove Close-Button On A Form?
Hello everybody,
how can I remove the close button on a form?
I already now the API-Function 'RemoveMenu'.
But although the function is called remove.. with this function the close button will be only disabled
and not really removed. (it's still visible)
Is there any other function, which really remove the button or at least make it unvisible so that the user
can't see it nor click on it?
Thanks in advance
Greets
Swisslupo

How To Remove Form Close Button?
Can anybody teach me how to remove the close button from form. I'm able to remove the max and min button, but not for close button.

Thank you.

Remove Workbook Close Button
I am trying to remove the x button from a workbook running in my VB-automated excel application. I used API calls to remove the x button, but it only disappears when the workbook window is minimized. When it is maximized, the x button re-appears in the menu bar. Has anybody had that problem before? Thanks a ton!

Remove Close Button From InputBox Function
Is there any way to remove the close button from the InputBox function ?

How To Remove The Close Button Of The Form Without Removing The Minimize And Maximize
Hi! I need some help help. I want to remove the close button of the form but retains the minimize and maximize buttons. I'm using VB6.

Thanks!

Remove Close,minimize And Maximize Button But Retain The Icon
I would like to put icon on the title bar without the close,maximize and minimize buttons. Is this possible?

Close Window Button
Can anyone tell me how to disable the close window "X" in the top-right of a form. I know that it's possible to disable min and max buttons but can you do the same with the close button?

Close Window Button, Again
How do you disable the close window "X" in the top-right of a form?

I've tried "Form.CloseButton = 0" but all i get is "Method or data member not found!"

Cheers,
Dave

How Do I Get My Button To Close The Window
How can i get my button to close the window and also to get the button to run a program

 

Coding For The Close Button Of A Window
I'm using VB6 implementing a program which connects to a database. The connection opens when the program start. Everything is alright if the user click the Exit button in my program. However, I wonder if the user click the close window button (the one with a cross on the right top corner), my program cannot close the connection and set the connection to nothing. I want to ask whether I can program the close windown button so that I can drop all the temp table, recordset and connection just before the program ends?

Issue With Close Button In A 2d Gaming Window.
Hello building a small game here and was having issues making a proper close button for in game windows.. I will post a chunk of code and maybe you can fix my issue..


Code:
Case MailboxWindow
With GameWindow.Mailbox
Engine_Render_Grh .SkinGrh, .Screen.X, .Screen.Y, 0, 1, True, GUIColorValue, GUIColorValue, GUIColorValue, GUIColorValue
Engine_Render_Text Font_Default, MailboxListBuffer, .Screen.X + .List.X, .Screen.Y + .List.Y, -1
Engine_Render_Text Font_Default, "Read", .Screen.X + .ReadLbl.X, .Screen.Y + .ReadLbl.Y, -1
Engine_Render_Text Font_Default, "Write", .Screen.X + .WriteLbl.X, .Screen.Y + .WriteLbl.Y, -1
Engine_Render_Text Font_Default, "Delete", .Screen.X + .DeleteLbl.X, .Screen.Y + .DeleteLbl.Y, -1
If SelMessage > 0 Then Engine_Render_Rectangle .Screen.X + .List.X, .Screen.Y + .List.Y + ((SelMessage - 1) * Font_Default.CharHeight), .List.Width, Font_Default.CharHeight, 1, 1, 1, 1, 1, 1, 0, 0, 2097217280, 2097217280, 2097217280, 2097217280, , False 'ARGB: 125/0/255/0
If Engine_Collision_Rect(MousePos.X, MousePos.Y, 1, 1, .Screen.X + 325, .Screen.Y + 5, 10, 17) Then
If MouseLeftDown > 0 Then
ShowGameWindow(LastClickedWindow) = 0
LastClickedWindow = 0
Exit Sub
End If
End If
End With


Now this is what I added extra in that is in the above code...

Code:
If Engine_Collision_Rect(MousePos.X, MousePos.Y, 1, 1, .Screen.X + 325, .Screen.Y + 5, 10, 17) Then
If MouseLeftDown > 0 Then
ShowGameWindow(LastClickedWindow) = 0
LastClickedWindow = 0
Exit Sub
End If
End If


This where I have issues.. It works fine closes no problem.. But when I click somewhere on the screen and hold down the mouse button right to this X in this window in the main game window it crashes...

So I get a error 9 and debugs goes to this:

Code:
LastClickedWindow = 0


I am a n99b and learning.. If you can give me a snip of code to try or know how to fix the issue that would be great..

Disable Console Window Close Button
Hi Guys,

I can open a console window, does anyone know how to disable the close window button. As if you close the console window the VB program always close too, so if I can disable the button users won't be able to do this by mistake.

Cheers.

dobby

FULL SCREEN WINDOW Without CLOSE Button
Dear Sir,

As part of my curriculam project, we are planning to create a Cyber Cafe Management software using VB and finally it in JAVA. We need the following help. I want to run a CLIENT PROGRAM that will ask username and password everytime when a new user comes. This window I want to see in full screen mode and the user should enter the username and password before using the system. So I want to run this program when the system boots up. So using ALT+TAB or CTRL+ALT+DEL etc., he will not able to skip this process? How we will do this. I need this help both for VB and JAVA.
No minimise, maximise, close button.

waiting for ur early reply.

Regards

Running A Command When The User Clicks The Close Button On The Window (X)
Hi I am sure this is very simple I just can't find it anywhere. How would I go about running the code "End" when the user clicks on the "X" (close button) at the top right of my VB application.

When they hit the X on my child window I need it to close the Exe. I can't do it just on unload because I have another button that unloads the window and I don't want the application to to close with that button. Thanks

Disable The Close Button Of Msword Window Using Visual Basic
is it possible to disable the close button of ms word application using visual basic, if so please help me and thanks in advance

I Canceled The Close Button On Child, But Now Mdi Form Won't Close
Ok I set a child window of an MDI form to cancel closing if the close button is pushed, but now my MDI form also will not close.

How do I get it where they can't close a child window from the close button on the child window, but when they click the close button on the MDI form it will close everything ?

How To Close The Application When Clicking On The Close Button In Title Bar
guys,

how to close the application when the user click on the close button on the title bar?


pls suggest

How Can I Prevent Right Corner Close Button To Close The Whole Application?
Dear Friends,

There is a close button at the top of right corner of form. When we click on it the whole program closes. Instead of that I want it to just close that form and open the Main form like....

Me.visible =false
frmMain.show

How can I do that?

Please help me out.

vblearner6

Using Close (X) Button To Close App Leaves It Hanging In TaskList
Hello all.

I just noticed my VB application stays in the WindowsNT TaskList afterclosing it via the Close Button. It doesn't do this when I close it with built-in close, whichs Ends the application.

I would get rid of the close button to prevent this, but I want the users be able to minimize the application. Any ideas how to prevent this fromstaying in memory? Thx.

Ron in NYC ; )



************************************************** **
This e-mail and any attachments thereto, is intended only for use by theaddressee(s) named herein and may contain legally privileged and/orconfidential information. If you are not the intended recipient of thise-mail, you are hereby notified any dissemination, distribution or copyingof this email, and any attachments thereto, is strictly prohibited. If youreceive this email in error please immediately notify me at (212) 735-3000and permanently delete the original copy and any copy of any e-mail, and a printout thereof.

Further information about the firm, a list of the Partners and theirprofessional qualifications will be provided upon request.
************************************************** **

Detecting Close Window Event From Crystal Reports Preview Window
Does anyone know how I can detect that a Crystal Reports preview window has been closed in VB ?

Thanks
Mario Giannone

Detecting Close Window Event From Crystal Reports Preview Window
Does anyone know how I can detect that a Crystal Reports preview window has been closed in VB ?

Thanks
Mario Giannone

Remove Exit Button But Leave Minimize Button
How can I remove the exit button on the top right corner of a form, while leaving the minimize button?

Remove Add When Close
I have a question on Microsoft Access Application. I have this problem whenever i close the program it will add an existing data on the textbox to database.

It also happened when i Close with X (Close Button)



VB Code:
Private Sub Command7_Click()On Error GoTo Err_Command7_Click        DoCmd.Close Exit_Command7_Click:    Exit Sub Err_Command7_Click:    MsgBox Err.Description    Resume Exit_Command7_ClickEnd Sub

How To Remove X Close In The Form?
How to remove this X in the form?I don't want it..

Close Button And Minimize Button (RESOLVED)
Is there anyway to disable/get rid of the Close button on a form, but still have the minimize button? I want people to click Exit on my app, in order to clean up some things, rather than clicking the close button. Any help or suggestions would be appreciated.



Edited by - jakohler on 6/1/2004 10:28:28 AM

How Do I Remove The Close Cross From A Floating Toolbar?
I've created a custom toolbar in excel which I want to have floating.
The thing is I want to be able to stop users from closing/hiding this toolbar.

Have tried to find an onEvent for closing and there doesn't seem to be anything.

Have a handle on the toolbar using the windows user32 library:
lnghwnd = FindWindow(vbNullString, "myToolbar")
but can't find the call which disables the cross.

Any ideas?

Window Handle And Close Window
Hello everybody,

I try to get a handle on a window which is popped up by a special remote library. The programm stops as long as I have pressed the O.K. button on the window. After this I would get the handle, but this is to late. I want to get the handle when the window pops up. I think threads could solve this problem but they don't exist in VB. Has anyone an idea how can I get the handle? I have to start two functions similary but how does it work?

Thanks and greetings, tksvc ;-)

How Do I Remove The 'TOP' Of A Form Window?
I have two forms one on top of another (top one covering the bottom ones form caption bar)- hope you know what i mean - i have a problem in which the user can select the bottom form and the form caption bar is showing and the form comes in front of the the form above it (covers the bottom of the form above) - so basically is it possible to have a form that is ALWAYS behind the other forms even when it is selected?
Sorry if this sounds confusing and thanks in advanced for any help

Click() Remove Window Focus?
Hey,

I seem to be having troubles getting a minimize to work with my custom picturebox GUI, I can do Close by using unload, but with minimize I seem to not be able to do anything except minimize to tray. Using 'Hide' unfortunately removes the entry from the taskbar, so you can't get it back up. If I can't get minimize to work, is there a way I could make it tell it to remove focus instead? Basically the same exact thing... But maybe I could use a different method?

Or if anyone knows how I can simply use a minimize command, let me know.

Thanks again

David

Remove Item From Window List
Hello Guys. Prob not possible... but is there any way not through the API to remove a form from the File Menu Windowed List... I have some toolbars that are going to stay up there the whole time anyways, so having them just out of the window list makes perfect sense.

If it can't be done w/o api, what is the code.

How Do You Remove The Icon From The Controlbar Of A Window?
How do you remove the icon from the controlbar of a window while leaving the min/max/close buttons intact? The ControlBox option removes everything so its not good...

Perhaps some one knows some tricks with messing the window handle.

I want it so the icon of an MDI child won't interrupt the MDI menus (Basically remove the icon altogether.)

Cheers~

(I see programs have certain windows in this state so i know its possible.)

How To Remove Register Window From An Ocx File
Hi,

I have downloaded an MJPanel3D.ocx file which is used to make the form's background color with Gradient effect. After I have designed a form with that control and while running, it asks me to register that ocx file. How to remove that regiester window.

I have downloaded that file from the follwing url ( I have also attached the zip file):

http://www.geocities.com/michel_juni...el3D-Share.zip

If it is not possible then suggest me a free Gradient control.

Calling The Add/remove Programs Window
is there a way of: calling the add/remove programs window

Win95/2000


thanks

Remove Border From Window Through Winapi
How can I remove the border from a window (no tilte bar, no edges) through api's? I tried changing a bunch of styles but I can't seem to get it to work

Help On Remove This Button
Ok all i want to do is Remove the Play button and Make the Music Play in a Loop.

Code:
Dim Playing As Boolean
Private Sub Command1_Click()
Dim File As String


If Command1.Caption = "Play Module" Then
'Set File
If Len("C:Documents and SettingsDanDesktopkeygenmusickeygen.xm") = 3 Then
File = "C:Documents and SettingsDanDesktopkeygenmusickeygen.xm"
Else
File = "C:Documents and SettingsDanDesktopkeygenmusickeygen.xm"
End If

'Load File into MODControl
MODCtrl1.LoadModule File
'Play Loaded File
MODCtrl1.PlayModule False

Playing = True



'Change text of button
Command1.Caption = "Stop Module"

ElseIf Command1.Caption = "Stop Module" Then
Command1.Caption = "Play Module"

'Stop the module
MODCtrl1.StopModule

Playing = False
End If
End Sub

Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
On Error Resume Next
Dir1.Path = Drive1.Drive
End Sub

Private Sub Form_Load()
'Initialize MODControl, very important!
MODCtrl1.Initialize
End Sub

Private Sub Form_Unload(Cancel As Integer)
'DeActivate MODControl, very important!
MODCtrl1.Deactivate
End Sub

Private Sub HScroll1_Change()
Dim Volume As Long
If Playing Then
Volume = HScroll1.Value
'set volume
MODCtrl1.SetVolume Volume
End If
End Sub

Private Sub Label1_Click()

End Sub

Picture:
http://img192.imageshack.us/img192/3...kkkkkkkuh9.png

Remove X Button?
Hi,

I was hoping someone could tell me how to remove the corner x-button in a form while keeping the icon on the form and on the task-bar.

I'd like to avoid subclassing if I can. I'm hoping for a simple API call...

any Ideas?

I've already been able to virtually disable it with the following code:

VB Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)If UnloadMode = vbFormControlMenu Then _Cancel = True: Exit SubEnd Sub


but leaving the image on the form is misleading and could cause some confusion to users.

Thanks in advance.

- Dim A
(VB5 -Sp3, Win98)

Close Window
All -

I was wondering if there is a way to have a window open when a document is closed.

For example, I am creating a program that creates a word document with inputs from a userform. A new word document opens up with the inputs from the user form. When this document is closed, I want another userform to open up.

Does anyone know how to do this?

Thanks,

Mike

Close Window
Hi guys,

Is there a command to close a dos window that's currently open?

Close Window
I dont know much about Visual Basic, but here is what I have:

Sub Macro1()

For x = 1 To 10
ActiveDocument.FollowHyperlink Address:="http://www.spftservers.com", _
NewWindow:=False, AddHistory:=True

Next x

End

End Sub

That basicallly opens up an internet explorer window during the loop. What I want it to do is close that internet explorer window after it is opened. Also, I would preferably like it to wait 2 seconds before closing the window. I need the code for the program since I dont know much. Thank you.

Here is what my total program is to do, so if you can write better code...:

1. Open a new Mozilla/Internet Window
2. Go to a certain website
3. **Optional** Wait 5 seconds
3. Close that Window
4. Have a loop with a certain amount runs

Thanks

Min Max Close Window
if click ... same of window right-top _ [] X
but no click _ [] X, use Command 1,2,3

Command1 = Min Window
Command2 = Max Window or restore it
Command3 = Close Windows

but how to do this , can suggest me! thx!

Close Window
I am trying to close the following code from MSDN to close a window but I am getting the following error:

File Not Found: User

I am not to familiar with API calls but could someone please help what is wrong with the code below. Like I said it was taken directly from:

http://msdn.microsoft.com/archive/de...sdn_msdn36.asp

Please any help would be appreciated

Private Declare Function IsWindow Lib "User" (ByVal Hwnd As Integer) As Integer
Private Declare Function GetWindow Lib "User" (ByVal Hwnd As Integer, ByVal wCmd As Integer) As Integer
Private Declare Function GetWindowLong Lib "User" (ByVal Hwnd As Integer, ByVal nIndex As Integer) As Long
Private Declare Function PostMessage Lib "User" (ByVal Hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Long) As Integer
Private Declare Function FindWindow Lib "User" (ByVal lpClassName As Any, ByVal lpWindowName As String) As Integer
Const GW_OWNER = 4
Const GWL_STYLE = -16
Const WS_DISABLED = &H8000000
Const WS_CANCELMODE = &H1F
Const WM_CLOSE = &H10

Private Sub Form_Load()
Dim Hwnd As Integer
Dim Y As Integer
Hwnd = FindWindow(0&, "Solitaire")
If Hwnd = 0 Then
MsgBox "SOLITAIRE is not running"
Exit Sub
Else
MsgBox "Click to quit SOLITAIRE"
End If
Y = EndTask(Hwnd)
If Y <> 0 Then
MsgBox "SOLITAIRE terminated"
Else
MsgBox "Error - Cannot terminate SOLITAIRE"
End If

End Sub
Function EndTask(TargetHwnd As Integer) As Integer
Dim X As Integer
Dim ReturnVal As Integer
If TargetHwnd = hWndMe% Or GetWindow(TargetHwnd, GW_OWNER) = hWndMe% Then
End
End If
If IsWindow(TargetHwnd) = False Then GoTo EndTaskFail
If (GetWindowLong(TargetHwnd, GWL_STYLE) And WS_DISABLED) Then GoTo EndTaskSucceed

If IsWindow(TargetHwnd) Then
If Not (GetWindowLong(TargetHwnd, GWL_STYLE) And WS_DISABLED) Then
X = PostMessage(TargetHwnd, WM_CANCELMODE, 0, 0&)
X = PostMessage(TargetHwnd, WM_CLOSE, 0, 0&)
DoEvents
End If
End If
GoTo EndTaskSucceed

EndTaskFail:
ReturnVal = False
GoTo EndTaskEndSub
EndTaskSucceed:
ReturnVal = True
EndTaskEndSub:
EndTask% = ReturnVal
End Function

Window.close()
Using the Web Browser control, I have created a browser. As such the browser is working fine but there's a problem.

Many website make use of JavaScript to close a pop-up window. For e.g. window.close() or self.close(). Here's an e.g.:


Code:
<input type="button" class="button" value="Close Window" onclick="window.close();" />
Now what I find is when such a button or link is clicked in a web page, the web page closes but the Form still remains open. Have a look at the 2 images below. Note the Close this window button at the bottom in the 1st image. When I click this button, all I get to see is the 2nd image i.e. the entire Form doesn't close when the button was clicked; only the web page vanished.

How do I overcome this?

Close Window
I dont know much about Visual Basic, but here is what I have:

Sub Macro1()

For x = 1 To 10
ActiveDocument.FollowHyperlink Address:="http://www.spftservers.com", _
NewWindow:=False, AddHistory:=True

Next x

End

End Sub

That basicallly opens up an internet explorer window during the loop. What I want it to do is close that internet explorer window after it is opened. Also, I would preferably like it to wait 2 seconds before closing the window. I need the code for the program since I dont know much. Thank you.

Here is what my total program is to do, so if you can write better code...:

1. Open a new Mozilla/Internet Window
2. Go to a certain website
3. **Optional** Wait 5 seconds
3. Close that Window
4. Have a loop with a certain amount runs

Thanks

Close Window
The end user opens a folder that contains the executable. When he opens the executable, I want the folder window to close automatically. How do I force this?

Close Window.
I Want To Close my MDIchild Form with user press Ctrl + W. I Have many controls on the form I not want to write code in all control’s KeyDown event. Any Short Cut!

Copyright © 2005-08 www.BigResource.com, All rights reserved