Click here to Skip to main content
15,887,776 members
Home / Discussions / C#
   

C#

 
AnswerRe: Help writing a program which adds up values in a 2D array to determine if it is a magic square Pin
BillWoodruff20-Jan-14 9:08
professionalBillWoodruff20-Jan-14 9:08 
QuestionCustom Data Types Pin
sunsilk1020-Jan-14 3:04
sunsilk1020-Jan-14 3:04 
AnswerRe: Custom Data Types Pin
Manfred Rudolf Bihy20-Jan-14 3:25
professionalManfred Rudolf Bihy20-Jan-14 3:25 
AnswerRe: Custom Data Types Pin
BillWoodruff20-Jan-14 5:13
professionalBillWoodruff20-Jan-14 5:13 
AnswerRe: Custom Data Types Pin
Freak3020-Jan-14 23:30
Freak3020-Jan-14 23:30 
QuestionC# with Oraclei Pin
Nightbird.14319-Jan-14 21:00
Nightbird.14319-Jan-14 21:00 
AnswerRe: C# with Oraclei Pin
V.19-Jan-14 21:49
professionalV.19-Jan-14 21:49 
QuestionMulti Desktop app, Need to take Screen short of a given desktop using handle. Pin
ptr_Electron19-Jan-14 19:23
ptr_Electron19-Jan-14 19:23 
I was been working on multiple desktop app. and would like to Screen shot of a desktop using the handle of the specific desktop.. I was using the blow code, but this always makes the the screenshort of current desktop.. as the Handle of "MyNewDesktop" was not supplyed. could you please tell me how to make use of hdesk to capture the screen short of the "MyNewDesktop". The below code is of utility app which captures desk top

C#
hwinsta = OpenWindowStation("WinSta0", false, WINDOWS_STATION_ACCESS_MASK.WINSTA_ALL_ACCESS);
           hwinsta2 = SetProcessWindowStation(hwinsta);
           hdesk = OpenDesktop("MyNewDesktop", 0, false, DESKTOP_ACCESS_MASK.GENERIC_ALL);//0x0001L | SetThreadDesktop);
           bool thset = SetThreadDesktop(hdesk);

           EnumDelegate delEnumfunc = new EnumDelegate(EnumWindowsProc);
           IntPtr DesktopWindow = GetDesktopWindow();
           bool bSuccessful = EnumDesktopWindows(hdesk, delEnumfunc, DesktopWindow);
           if (bSuccessful) // this was sucessfull control enters this block
           {
               string filename = string.Format("ScreenCap-{0:yyyy-MM-dd_hh-mm-ss-tt}", DateTime.Now);
               var bounds = Screen.GetBounds(Point.Empty);
               using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height))
               {
                   using (Graphics g = Graphics.FromImage(bitmap))
                   {
                       g.CopyFromScreen(Point.Empty, Point.Empty, bounds.Size);
                   }
                   bitmap.Save(@"C:\" + filename + ".jpg", ImageFormat.Jpeg);
               }
            }
            else
            {
            // Get the last Win32 error code
                int nErrorCode = Marshal.GetLastWin32Error();
                string strErrMsg = String.Format("EnumDesktopWindows failed with code {0}.", nErrorCode);
                throw new Exception(strErrMsg);
           }


thanks
AnswerRe: Multi Desktop app, Need to take Screen short of a given desktop using handle. Pin
Mycroft Holmes19-Jan-14 21:02
professionalMycroft Holmes19-Jan-14 21:02 
GeneralRe: Multi Desktop app, Need to take Screen short of a given desktop using handle. Pin
ptr_Electron20-Jan-14 0:40
ptr_Electron20-Jan-14 0:40 
AnswerRe: Multi Desktop app, Need to take Screen short of a given desktop using handle. Pin
Bernhard Hiller20-Jan-14 3:47
Bernhard Hiller20-Jan-14 3:47 
GeneralRe: Multi Desktop app, Need to take Screen short of a given desktop using handle. Pin
ptr_Electron20-Jan-14 7:11
ptr_Electron20-Jan-14 7:11 
QuestionSuggestion required for Accounting Software core infrastructure VS2010 C# MySql Pin
ahmed_one19-Jan-14 18:48
ahmed_one19-Jan-14 18:48 
AnswerRe: Suggestion required for Accounting Software core infrastructure VS2010 C# MySql Pin
Mycroft Holmes19-Jan-14 20:57
professionalMycroft Holmes19-Jan-14 20:57 
GeneralRe: Suggestion required for Accounting Software core infrastructure VS2010 C# MySql Pin
ahmed_one19-Jan-14 21:11
ahmed_one19-Jan-14 21:11 
GeneralRe: Suggestion required for Accounting Software core infrastructure VS2010 C# MySql Pin
Trak4Net20-Jan-14 9:01
Trak4Net20-Jan-14 9:01 
GeneralRe: Suggestion required for Accounting Software core infrastructure VS2010 C# MySql Pin
ahmed_one20-Jan-14 17:05
ahmed_one20-Jan-14 17:05 
Questioncreate and use .DLL Pin
DrooBo19-Jan-14 6:28
DrooBo19-Jan-14 6:28 
SuggestionRe: create and use .DLL Pin
Richard MacCutchan19-Jan-14 6:52
mveRichard MacCutchan19-Jan-14 6:52 
AnswerRe: create and use .DLL Pin
Dave Kreskowiak19-Jan-14 6:57
mveDave Kreskowiak19-Jan-14 6:57 
AnswerRe: create and use .DLL Pin
DrooBo19-Jan-14 7:30
DrooBo19-Jan-14 7:30 
GeneralRe: create and use .DLL Pin
Dave Kreskowiak19-Jan-14 10:22
mveDave Kreskowiak19-Jan-14 10:22 
GeneralRe: create and use .DLL Pin
Richard MacCutchan19-Jan-14 22:36
mveRichard MacCutchan19-Jan-14 22:36 
AnswerRe: create and use .DLL Pin
Ron Beyer19-Jan-14 10:38
professionalRon Beyer19-Jan-14 10:38 
GeneralRe: create and use .DLL Pin
BillWoodruff19-Jan-14 12:58
professionalBillWoodruff19-Jan-14 12:58 

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.