Click here to Skip to main content
15,908,673 members
Home / Discussions / C#
   

C#

 
AnswerRe: Custom TextBox Text property default value Pin
leppie6-Nov-08 23:01
leppie6-Nov-08 23:01 
GeneralRe: Custom TextBox Text property default value Pin
DaveyM696-Nov-08 23:23
professionalDaveyM696-Nov-08 23:23 
AnswerRe: Custom TextBox Text property default value [modified] Pin
DaveyM697-Nov-08 9:07
professionalDaveyM697-Nov-08 9:07 
QuestionProblem with downloading html from the web with httpwebrequest object Pin
Haim Nachum6-Nov-08 10:56
Haim Nachum6-Nov-08 10:56 
AnswerRe: Problem with downloading html from the web with httpwebrequest object Pin
leppie6-Nov-08 22:51
leppie6-Nov-08 22:51 
GeneralRe: Problem with downloading html from the web with httpwebrequest object Pin
Haim Nachum6-Nov-08 22:59
Haim Nachum6-Nov-08 22:59 
AnswerRe: Problem with downloading html from the web with httpwebrequest object Pin
RGiroux3211-Jan-09 16:51
RGiroux3211-Jan-09 16:51 
QuestionDiffrent behaviour Pin
bsaksida6-Nov-08 9:45
bsaksida6-Nov-08 9:45 
// DLL imports
[DllImport("Psapi.dll", SetLastError = true)]
public static extern uint GetModuleFileNameEx(IntPtr hProcess, IntPtr hModule, StringBuilder lpFileName, [MarshalAs(UnmanagedType.U4)]Int32 nSize);

[DllImport("kernel32.dll")]
public static extern IntPtr OpenProcess(UInt32 dwDesiredAccsess, Int32 inherit, UInt32 dwProcessID);

[DllImport("kernel32.dll")]
public static extern bool CloseHandle(IntPtr handle

// Constants
public const long STANDARD_RIGHTS_REQUIRED = 0x000F0000L;
public const long SYNCHRONIZE = 0x00100000L;
public const long PROCESS_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFFF);

public const long PROCESS_QUERY_INFORMATION = 0x0400;

protected static ProcessInfo FillProcessInfoEX(ProcessInfo pi)
{
            // Atempt to open process
            IntPtr hWnd = OpenProcess((uint)PROCESS_ALL_ACCESS, 0, (uint)pi.iProcessID);

            if (hWnd == IntPtr.Zero)
            {
                        // If failed, attempt to open with limited accsess
                        hWnd = OpenProcess((uint)PROCESS_QUERY_INFORMATION, 0, (uint)pi.iProcessID);
                        if (hWnd == IntPtr.Zero)
                                    return pi;
            }
            StringBuilder path = new StringBuilder(1024);
            GetModuleFileNameEx((IntPtr)hWnd, IntPtr.Zero, path, 1024);
            pi.sFullFilePath = path.ToString();
            System.Windows.Forms.MessageBox.Show(pi.sFullFilePath); // Just to see what happend to it
            CloseHandle(hWnd);
            return pi;
        }


pi is a struct. This code works fine as long the build was ran within Visual Studio 2008. But if i run just with exe, pi.sFullFilePath has only garbage on all process id. What am i doing wrong? I am using XP

Thanks for help in advance
AnswerRe: Diffrent behaviour Pin
PIEBALDconsult6-Nov-08 10:28
mvePIEBALDconsult6-Nov-08 10:28 
GeneralRe: Diffrent behaviour Pin
Pete O'Hanlon6-Nov-08 10:45
mvePete O'Hanlon6-Nov-08 10:45 
GeneralRe: Diffrent behaviour Pin
bsaksida6-Nov-08 11:04
bsaksida6-Nov-08 11:04 
QuestionModify HtmlDocument Pin
OptiPlex6-Nov-08 8:18
OptiPlex6-Nov-08 8:18 
AnswerRe: Modify HtmlDocument Pin
Anthony Mushrow6-Nov-08 9:22
professionalAnthony Mushrow6-Nov-08 9:22 
GeneralRe: Modify HtmlDocument Pin
OptiPlex6-Nov-08 21:29
OptiPlex6-Nov-08 21:29 
QuestionCodeDom Problem,Script Application communication with Host Application? Pin
legalbattle6-Nov-08 6:46
legalbattle6-Nov-08 6:46 
AnswerRe: CodeDom Problem,Script Application communication with Host Application? [modified] Pin
Pedram Behroozi6-Nov-08 7:37
Pedram Behroozi6-Nov-08 7:37 
GeneralRe: CodeDom Problem,Script Application communication with Host Application? Pin
legalbattle6-Nov-08 14:27
legalbattle6-Nov-08 14:27 
QuestionDrawing a string without scaling the font size? [modified] Pin
DigiFaith6-Nov-08 3:31
DigiFaith6-Nov-08 3:31 
GeneralRe: Drawing a string without scaling the font size? Pin
Guffa6-Nov-08 8:09
Guffa6-Nov-08 8:09 
AnswerRe: Drawing a string without scaling the font size? Pin
Anthony Mushrow6-Nov-08 9:13
professionalAnthony Mushrow6-Nov-08 9:13 
Questionto execute command at command prompt from .net C# application Pin
sailesh_gupta6-Nov-08 3:02
sailesh_gupta6-Nov-08 3:02 
AnswerRe: to execute command at command prompt from .net C# application Pin
DaveyM696-Nov-08 3:17
professionalDaveyM696-Nov-08 3:17 
Questionwindows service deployment error Pin
vishnukamath6-Nov-08 2:56
vishnukamath6-Nov-08 2:56 
Questionxml Document Pin
arkiboys6-Nov-08 2:47
arkiboys6-Nov-08 2:47 
AnswerRe: xml Document Pin
Programm3r6-Nov-08 3:12
Programm3r6-Nov-08 3:12 

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.