Click here to Skip to main content
15,891,607 members
Home / Discussions / C#
   

C#

 
GeneralRe: Architecture Question! Pin
Jammer5-Mar-08 12:20
Jammer5-Mar-08 12:20 
GeneralRe: Architecture Question! Pin
Jammer5-Mar-08 12:52
Jammer5-Mar-08 12:52 
GeneralUser Control without UI Pin
DaveyM695-Mar-08 10:38
professionalDaveyM695-Mar-08 10:38 
GeneralRe: User Control without UI Pin
Christian Graus5-Mar-08 10:57
protectorChristian Graus5-Mar-08 10:57 
GeneralRe: User Control without UI Pin
DaveyM696-Mar-08 5:25
professionalDaveyM696-Mar-08 5:25 
GeneralRe: User Control without UI Pin
DaveyM696-Mar-08 6:22
professionalDaveyM696-Mar-08 6:22 
GeneralDirectX C# - creating a button Pin
2hdass5-Mar-08 10:12
2hdass5-Mar-08 10:12 
GeneralManage SQLServer C# Pin
half-life5-Mar-08 9:56
half-life5-Mar-08 9:56 
GeneralRe: Manage SQLServer C# Pin
Christian Graus5-Mar-08 10:08
protectorChristian Graus5-Mar-08 10:08 
GeneralRe: Manage SQLServer C# Pin
half-life5-Mar-08 10:14
half-life5-Mar-08 10:14 
GeneralRe: Manage SQLServer C# Pin
Christian Graus5-Mar-08 11:00
protectorChristian Graus5-Mar-08 11:00 
GeneralRe: Manage SQLServer C# Pin
half-life5-Mar-08 11:04
half-life5-Mar-08 11:04 
GeneralRe: Manage SQLServer C# Pin
Tobias Schoenig5-Mar-08 21:25
Tobias Schoenig5-Mar-08 21:25 
GeneralPlaying a file using MCI Pin
Johan Martensson5-Mar-08 9:40
Johan Martensson5-Mar-08 9:40 
GeneralHelp needed regarding MSI Pin
robustm5-Mar-08 9:34
robustm5-Mar-08 9:34 
GeneralRe: Help needed regarding MSI Pin
Christian Graus5-Mar-08 10:13
protectorChristian Graus5-Mar-08 10:13 
QuestionRun with the windows Pin
Knowledgestudent5-Mar-08 9:09
Knowledgestudent5-Mar-08 9:09 
GeneralRe: Run with the windows Pin
Pete O'Hanlon5-Mar-08 9:40
mvePete O'Hanlon5-Mar-08 9:40 
QuestionRe: Run with the windows Pin
Knowledgestudent5-Mar-08 11:19
Knowledgestudent5-Mar-08 11:19 
GeneralRe: Run with the windows Pin
Ravi Bhavnani5-Mar-08 18:47
professionalRavi Bhavnani5-Mar-08 18:47 
QuestionRe: Run with the windows Pin
Knowledgestudent9-Mar-08 11:13
Knowledgestudent9-Mar-08 11:13 
QuestionSystemParametersInfo SPI_SETWORKAREA Pin
chrsarly045-Mar-08 8:48
chrsarly045-Mar-08 8:48 
Is anyone able to help me get this to work? Im not that familiar with the Windows API and have been fiddling around with this for days D'Oh! | :doh:

<br />
using System;<br />
using System.Runtime.InteropServices;<br />
<br />
namespace System<br />
{<br />
	public class WorkingArea<br />
	{<br />
		[DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]<br />
        [return:MarshalAs(UnmanagedType.Bool)]<br />
        public static extern bool SendMessageTimeout(IntPtr hWnd,int Msg,string lParam,int uTimeout,int lpdwResult);<br />
<br />
		public struct RECT<br />
		{<br />
			public int Left;<br />
			public int Top;<br />
			public int Right;<br />
			public int Bottom;<br />
		}<br />
		[DllImport("User32.dll", EntryPoint = "SystemParametersInfoA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]<br />
		private static extern short SystemParametersInfo(short uAction, short uparam, ref RECT lpvParam, short fuWinIni);<br />
		[DllImport("user32", EntryPoint = "PostMessageA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]<br />
		private static extern int PostMessage(int hwnd, int wMsg, int wParam, ref int lParam);<br />
<br />
	<br />
        public const int HWND_BROADCAST = 0xffff;<br />
        public const int WM_SETTINGCHANGE = 0x001A;<br />
        public const int SMTO_NORMAL = 0x0000;<br />
        public const int SMTO_BLOCK = 0x0001;<br />
        public const int SMTO_ABORTIFHUNG = 0x0002;<br />
        public const int SMTO_NOTIMEOUTIFNOTHUNG = 0x0008;<br />
	public const int SPIF_SENDCHANGE = 0x02;<br />
	public const short SPI_SETWORKAREA = 47;<br />
	<br />
		public void SetWorkArea(RECT rect)<br />
		{<br />
			SystemParametersInfo(SPI_SETWORKAREA, 0,ref rect, SPIF_SENDCHANGE);<br />
			//SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETWORKAREA, "", SMTO_ABORTIFHUNG, 100000, null);<br />
		}<br />
	}<br />
}


ie.

WorkingArea WorkSpace = new WorkingArea();<br />
RECT Area = new WorkingArea.RECT();<br />
Area.Left=25;<br />
Area.Top=25;<br />
Area.Bottom=25;<br />
Area.Right=25;<br />
WorkSpace.SetWorkArea(Area);


------------------------

GeneralApplication Issue with Access and ReportViewer Pin
rwinte5-Mar-08 8:40
rwinte5-Mar-08 8:40 
GeneralMVP Pattern Pin
Quang Tran Minh5-Mar-08 6:29
Quang Tran Minh5-Mar-08 6:29 
GeneralRe: MVP Pattern Pin
led mike5-Mar-08 6:38
led mike5-Mar-08 6:38 

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.