Click here to Skip to main content
15,909,747 members
Home / Discussions / C#
   

C#

 
QuestionHide Name Pin
Tanuja1232-Jan-07 4:52
Tanuja1232-Jan-07 4:52 
AnswerRe: Hide Name Pin
Judah Gabriel Himango2-Jan-07 5:27
sponsorJudah Gabriel Himango2-Jan-07 5:27 
AnswerRe: Hide Name Pin
Ed.Poore2-Jan-07 6:07
Ed.Poore2-Jan-07 6:07 
QuestionCreating hidden window [modified] Pin
mikker_1232-Jan-07 4:47
mikker_1232-Jan-07 4:47 
AnswerRe: Creating hidden window Pin
Luc Pattyn2-Jan-07 7:27
sitebuilderLuc Pattyn2-Jan-07 7:27 
GeneralRe: Creating hidden window [modified] Pin
mikker_1232-Jan-07 11:39
mikker_1232-Jan-07 11:39 
GeneralRe: Creating hidden window Pin
Luc Pattyn2-Jan-07 14:14
sitebuilderLuc Pattyn2-Jan-07 14:14 
GeneralRe: Creating hidden window Pin
mikker_1232-Jan-07 21:11
mikker_1232-Jan-07 21:11 
Here is more info:

-1400 is decimal, it gives 00000578 when I put i.ToString("X8").
-my OS i WinXP and .NET is 2.0

Here is complete code:

<br />
	public partial class Form1 : Form<br />
	{<br />
		public Form1()<br />
		{<br />
			InitializeComponent();<br />
		}<br />
<br />
<br />
		private void Form1_Load(object sender, EventArgs e)<br />
		{<br />
			SetLastError(0);<br />
			int handle = CreateWindowEx(<br />
				0,				// extended style				<br />
				"PrintTray_Notify_WndClass",	// class name<br />
				"",				// window name<br />
				0x80000000,			// style=WS_POPUP<br />
				0, 0, 10, 10,			// bounds<br />
				IntPtr.Zero,			// no parent<br />
				IntPtr.Zero,			// no menu<br />
				IntPtr.Zero,			// instance (gets ignored)<br />
				IntPtr.Zero);			// no lpParam<br />
<br />
			MessageBox.Show("Handle: "+ handle.ToString("X8"));<br />
			if (handle == 0)<br />
			{<br />
				int i = GetLastError();<br />
<br />
				if (i == 183)<br />
					MessageBox.Show("ERROR_ALREADY_EXISTS");<br />
				else<br />
					MessageBox.Show("error code:"+ i.ToString("X8"));<br />
				<br />
			}<br />
		}<br />
<br />
		[DllImport("kernel32.dll", CallingConvention = CallingConvention.StdCall)]<br />
		private static extern int GetLastError();<br />
<br />
		[DllImport("kernel32.dll", CallingConvention = CallingConvention.StdCall)]<br />
		private static extern int SetLastError(int err);<br />
<br />
		[DllImport("user32.dll", CharSet = CharSet.Auto, EntryPoint = "CreateWindowEx", CallingConvention = CallingConvention.StdCall)]<br />
		public static extern int CreateWindowEx(uint style2, string className,<br />
			string windowName, uint style, int x, int y, int w, int h, IntPtr parent,<br />
			IntPtr menu, IntPtr instance, IntPtr lpParam);<br />
	}<br />


And it always gets to: MessageBox.Show("error code:"+ i.ToString("X8")); giving 00000573.

I tried your two ideas and nothing happens. Can you give me any more help?

Thanks!
GeneralRe: Creating hidden window Pin
Luc Pattyn3-Jan-07 3:33
sitebuilderLuc Pattyn3-Jan-07 3:33 
GeneralRe: Creating hidden window Pin
mikker_1233-Jan-07 9:17
mikker_1233-Jan-07 9:17 
GeneralRe: Creating hidden window Pin
Luc Pattyn3-Jan-07 9:57
sitebuilderLuc Pattyn3-Jan-07 9:57 
GeneralRe: Creating hidden window Pin
mmf8-Oct-08 0:18
mmf8-Oct-08 0:18 
QuestionHow would i go about inheriting System.IO.FileStream? [modified] Pin
Anthony Mushrow2-Jan-07 4:42
professionalAnthony Mushrow2-Jan-07 4:42 
AnswerRe: How would i go about inheriting System.IO.FileStream? Pin
Judah Gabriel Himango2-Jan-07 5:21
sponsorJudah Gabriel Himango2-Jan-07 5:21 
QuestionWordwrapping when printing Pin
numbers1thru92-Jan-07 3:49
numbers1thru92-Jan-07 3:49 
AnswerRe: Wordwrapping when printing Pin
Luc Pattyn2-Jan-07 16:02
sitebuilderLuc Pattyn2-Jan-07 16:02 
QuestionCustomising the Color of check mark in a checkedListBox Pin
Sreelakshmi Desai2-Jan-07 3:43
Sreelakshmi Desai2-Jan-07 3:43 
QuestionDataGridView Pin
robmays2-Jan-07 3:18
robmays2-Jan-07 3:18 
AnswerRe: DataGridView Pin
mwith2-Jan-07 5:59
mwith2-Jan-07 5:59 
Questionlandscape vs portrait Pin
quiteSmart2-Jan-07 2:32
quiteSmart2-Jan-07 2:32 
AnswerRe: landscape vs portrait Pin
Luc Pattyn2-Jan-07 3:03
sitebuilderLuc Pattyn2-Jan-07 3:03 
QuestionPrinting in C# Pin
numbers1thru92-Jan-07 1:44
numbers1thru92-Jan-07 1:44 
AnswerRe: Printing in C# Pin
Mircea Puiu2-Jan-07 2:10
Mircea Puiu2-Jan-07 2:10 
QuestionMaking a full-screen windows application. Pin
Hussam Fattahi2-Jan-07 0:51
Hussam Fattahi2-Jan-07 0:51 
AnswerRe: Making a full-screen windows application. Pin
Mircea Puiu2-Jan-07 1:11
Mircea Puiu2-Jan-07 1:11 

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.