Computing.Net > Forums > Disk Operating System > Disable Close Button in title bar

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Disable Close Button in title bar

Reply to Message Icon

Name: Wilster
Date: September 9, 2003 at 17:28:10 Pacific
OS: XP Prof
CPU/Ram: P4 1.8 Ghz/940 Mhz
Comment:

I have a small group of computers (about six) set up in a domain. I have created a login script to run and map the printer, map networked drives, synchronize the time, etc. We are planning expand later, and some users get confused and close the logon batch. How can I disabled the "close button" in the title bar so that users can't exit until the script is done?



Sponsored Link
Ads by Google

Response Number 1
Name: JackG
Date: September 10, 2003 at 00:52:53 Pacific
Reply:

Can you start the script with a START /m script so that it runs minimized?


0

Response Number 2
Name: Mick C
Date: September 10, 2003 at 04:02:04 Pacific
Reply:

Try this small program to Show/Hide Active Buttons:

http://website.lineone.net/~john.keeping/showhide.html

I found a few other ideas by typing "hide windows program buttons" in Google!


0

Response Number 3
Name: graye
Date: September 24, 2003 at 20:24:06 Pacific
Reply:

Here is a simple VC7 program that will do exactly what you want. Works on Win2k and above (only because I didn't use the generic GetConsoleWindow function).

------------ stdafx.h --------------
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once
#define _WIN32_WINNT 0x0500

#include <iostream>
#include <tchar.h>
#include <windows.h>
#include <wincon.h>

---------- DisableX.cpp -------------
#include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[])
{
HWND h;
HMENU sm;
int i, j, c;
LPTSTR buf;

// get the handle to the console
h = GetConsoleWindow();
// get handle to the System Menu
sm = GetSystemMenu(h, false);
// how many items are there?
c = GetMenuItemCount(sm);
j = -1;
buf = new TCHAR[256];
for (i=0; i<c; i++) {
// find the one we want
GetMenuString(sm, i, buf, 255, MF_BYPOSITION);
if (!strcmp(buf, "&Close")) {
j = i;
break;
}
}
// if found, remove that menu item
if (j >= 0)
RemoveMenu(sm, j, MF_BYPOSITION);
return 0;
}


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Disable Close Button in title bar

Disable CTRL C in batch files www.computing.net/answers/dos/disable-ctrl-c-in-batch-files/6608.html

disable the close botton of DOS window in Windows95/98 www.computing.net/answers/dos/disable-the-close-botton-of-dos-window-in-windows9598/2203.html

closing a program in a batchfile(DOS cmd www.computing.net/answers/dos/closing-a-program-in-a-batchfiledos-cmd/8108.html