Click here to Skip to main content
16,013,918 members
Home / Discussions / C#
   

C#

 
AnswerRe: Graphics::FromHwnd ??? Pin
Neil Van Note29-Apr-02 10:18
Neil Van Note29-Apr-02 10:18 
GeneralRe: Calling Win32 API Pin
James T. Johnson27-Apr-02 22:56
James T. Johnson27-Apr-02 22:56 
GeneralQuestion Pin
Vlad Beu27-Apr-02 9:51
Vlad Beu27-Apr-02 9:51 
GeneralRe: Question Pin
James T. Johnson27-Apr-02 11:31
James T. Johnson27-Apr-02 11:31 
GeneralUsing COM Interface ICatInformation... Pin
Ollie27-Apr-02 4:52
Ollie27-Apr-02 4:52 
GeneralDisable Close Button Pin
Sabran27-Apr-02 0:05
Sabran27-Apr-02 0:05 
GeneralRe: Disable Close Button Pin
Neil Van Note27-Apr-02 9:26
Neil Van Note27-Apr-02 9:26 
GeneralRe: Disable Close Button Pin
Neil Van Note27-Apr-02 10:39
Neil Van Note27-Apr-02 10:39 
Yet, an alternative method.

const uint MF_BYCOMMAND = 0x00000000;
const uint MF_GRAYED    = 0x00000001;
const uint MF_DISABLED  = 0x00000002;
const uint SC_CLOSE     = 0xF060;


[DllImport("user32.dll")]
private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool revert);
[DllImport("user32.dll")]
private static extern bool EnableMenuItem(IntPtr hMenu, uint uIDEnableItem, uint uEnable);


protected override void OnLoad(
	EventArgs e
	)
{
	base.OnLoad(e);

	IntPtr hMenu = GetSystemMenu(Handle, false);
	if (IntPtr.Zero != hMenu)
	{
		EnableMenuItem(
			hMenu,
			SC_CLOSE,
			MF_BYCOMMAND | MF_DISABLED | MF_GRAYED
			);
	}
}

GeneralRe: Disable Close Button Pin
Neil Van Note27-Apr-02 11:32
Neil Van Note27-Apr-02 11:32 
GeneralRe: Disable Close Button Pin
Sabran27-Apr-02 12:51
Sabran27-Apr-02 12:51 
GeneralRe: Disable Close Button Pin
Nish Nishant27-Apr-02 15:00
sitebuilderNish Nishant27-Apr-02 15:00 
GeneralRe: Disable Close Button Pin
Neil Van Note27-Apr-02 15:34
Neil Van Note27-Apr-02 15:34 
GeneralRe: Disable Close Button Pin
Sabran28-Apr-02 9:03
Sabran28-Apr-02 9:03 
GeneralRe: Disable Close Button Pin
Neil Van Note28-Apr-02 9:33
Neil Van Note28-Apr-02 9:33 
GeneralThreads Pin
Sabran26-Apr-02 23:58
Sabran26-Apr-02 23:58 
GeneralRe: Threads Pin
James T. Johnson27-Apr-02 11:27
James T. Johnson27-Apr-02 11:27 
GeneralRe: Threads Pin
Sabran27-Apr-02 13:00
Sabran27-Apr-02 13:00 
GeneralRe: Threads Pin
James T. Johnson27-Apr-02 13:52
James T. Johnson27-Apr-02 13:52 
GeneralRe: Threads Pin
Sabran28-Apr-02 9:11
Sabran28-Apr-02 9:11 
GeneralDataGrid Cell / Row Color Change Pin
Prash26-Apr-02 23:28
Prash26-Apr-02 23:28 
GeneralRe: DataGrid Cell / Row Color Change Pin
James T. Johnson26-Apr-02 23:49
James T. Johnson26-Apr-02 23:49 
GeneralIDictionary Pin
Christian Graus26-Apr-02 18:07
protectorChristian Graus26-Apr-02 18:07 
GeneralRe: IDictionary Pin
Neil Van Note26-Apr-02 18:37
Neil Van Note26-Apr-02 18:37 
GeneralRe: IDictionary Pin
Tom Archer26-Apr-02 18:43
Tom Archer26-Apr-02 18:43 
GeneralChild Form positioning according to resize of MdiParent Form Pin
Prash26-Apr-02 17:56
Prash26-Apr-02 17:56 

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.