Click here to Skip to main content
16,006,475 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Thread Suspending methods - for thread pool Pin
MetX1-May-03 16:10
sussMetX1-May-03 16:10 
GeneralRe: Thread Suspending methods - for thread pool Pin
Joe Woodbury1-May-03 20:12
professionalJoe Woodbury1-May-03 20:12 
GeneralRe: Thread Suspending methods - for thread pool Pin
MetX1-May-03 21:32
sussMetX1-May-03 21:32 
GeneralCOleFont to CFont Pin
Toni781-May-03 11:53
Toni781-May-03 11:53 
GeneralButtons on a DialogBar Pin
MattyBee1-May-03 11:05
MattyBee1-May-03 11:05 
GeneralRe: Buttons on a DialogBar Pin
Brian Shifrin1-May-03 11:27
Brian Shifrin1-May-03 11:27 
GeneralRe: Buttons on a DialogBar Pin
MattyBee1-May-03 11:41
MattyBee1-May-03 11:41 
GeneralDisabling Close in Console Pin
John L. DeVito1-May-03 10:53
professionalJohn L. DeVito1-May-03 10:53 
Can anyone please tell me why this isn't working? It compiles fine and runs, but the close button doesn't get "greyed out".

#include "stdafx.h"
#include "CELL v2.h"
#include "windows.h"
#include "tchar.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
using namespace std;

CWinApp theApp;
char buf[100];

void CloseMenu(){
wsprintf(buf,_T("CELL"));
SetConsoleTitle((LPCTSTR)buf);
HWND hwnd=NULL;

while(NULL==hwnd)
hwnd=::FindWindowEx(NULL,NULL,NULL,(LPCTSTR)buf);
SetConsoleTitle (_T("CELL"));
HMENU hmenu=GetSystemMenu(hwnd,FALSE);
DeleteMenu(hmenu,SC_CLOSE,MF_BYCOMMAND);
}

int _tmain(int argc,TCHAR* argv[],TCHAR* envp[]){
int nRetCode=0;

if(!AfxWinInit(::GetModuleHandle(NULL),NULL,::GetCommandLine(),0)){
cerr<<_T("Fatal Error: MFC initialization failed")<
GeneralRe: Disabling Close in Console Pin
Chris Richardson1-May-03 17:25
Chris Richardson1-May-03 17:25 
GeneralGetting binary values from registry Pin
Steve L.1-May-03 10:44
Steve L.1-May-03 10:44 
GeneralRe: Getting binary values from registry Pin
Michael Dunn1-May-03 11:01
sitebuilderMichael Dunn1-May-03 11:01 
GeneralRe: Getting binary values from registry Pin
Steve L.1-May-03 11:24
Steve L.1-May-03 11:24 
GeneralRe: Getting binary values from registry Pin
David Crow2-May-03 4:30
David Crow2-May-03 4:30 
GeneralItemData in a virtual list control Pin
Gilfrog1-May-03 10:39
Gilfrog1-May-03 10:39 
GeneralRe: ItemData in a virtual list control Pin
Phil Hamer1-May-03 14:17
Phil Hamer1-May-03 14:17 
GeneralCan't display items from an array. Pin
grscot1-May-03 10:32
grscot1-May-03 10:32 
GeneralRe: Can't display items from an array. Pin
Neville Franks1-May-03 11:55
Neville Franks1-May-03 11:55 
GeneralRe: Can't display items from an array. Pin
Toni781-May-03 12:09
Toni781-May-03 12:09 
GeneralUsing modem Pin
Anonymous1-May-03 10:04
Anonymous1-May-03 10:04 
GeneralRe: Using modem Pin
Jason Henderson1-May-03 20:29
Jason Henderson1-May-03 20:29 
GeneralRe: Using modem Pin
Anonymous2-May-03 0:07
Anonymous2-May-03 0:07 
GeneralRe: Using modem Pin
John R. Shaw2-May-03 20:28
John R. Shaw2-May-03 20:28 
GeneralGetting keyboard input. Pin
Anonymous1-May-03 9:46
Anonymous1-May-03 9:46 
GeneralRe: Getting keyboard input. Pin
Neville Franks1-May-03 11:58
Neville Franks1-May-03 11:58 
GeneralRe: Getting keyboard input. Pin
John R. Shaw2-May-03 20:40
John R. Shaw2-May-03 20:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.