Hello, sorry for my late answer. No, this code show only a single process. Try to open 2 or more SharpDevelop Instances and you'll see that you only get one of them. In the meantime I found a solution. First get the ThreadID with the Win32 API and then get the ProcessByID, this works.
Seraphin
Posts
-
Process.GetProcesses() -
Process.GetProcesses()Process is the framework class.
-
Databinding Listview with array referenceIs it possible to fill listview with an one or more dimensional array by using databinding method?
-
Process.GetProcesses()Both types, don't work with both ones.
-
Help Me Please !!! Form problmHi, Check the Win32 API for the "SetParent" command.
-
Process.GetProcesses()Process[] procList = Process.GetProcesses();
It seems VS 2005 (maybe 2003 too) is buggy related to this code. If I have opened windows already before I start my application , VS only show 1 of them. But if I activate a window, which isn't listet in the process array, VS finds it immediately. Anybody here with the same experience? Is "EnumWindows" from Win32 API the only solution? -
Win32 API - Problems with SENDMESSAGEHello, I have a problem with this code. Signature error, but why?
using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Windows.Forms; namespace EnumerateSingle { public struct EditStream { public long dwCookie; public long dwError; public Delegate pfnCallback; } class RichEditC { public const long WM_USER = 0x400; public const long EM_STREAMIN = (WM_USER + 73); public const long EM_STREAMOUT = (WM_USER + 74); public const long SF_TEXT = 0x1 ; public const long SF_RTF = 0x2; public const long SF_RTFNOOBJS = 0x3; public const long SF_TEXTIZED = 0x4; public const long SF_UNICODE = 0x10; public const long SF_USECODEPAGE = 0x20; public const long SF_NCRFORNONASCII = 0x40; public delegate long RTFCallback(long dwCookie, long pbBuff, long cb, long pcb); public string buffText; [DllImport("User32.dll")] public static extern long SendMessage(long hWnd, long wMsg, long wParam, ref EditStream lParam); [DllImport("User32.dll")] public static extern void CopyMemory(object Destination, object source, long length); public static long EditStreamCallback(long dwCookie, long pbBuff, long cb, long pcb) { StringBuilder buff = new StringBuilder((int)cb); switch(dwCookie) { case 999: { CopyMemory(buff, pbBuff, cb); pcb = cb; return 0; } default: { return -1; } } } } }
And the Clientcode:private void button3_Click(object sender, EventArgs e) { RichEditC.RTFCallback myRtfCallback = new RichEditC.RTFCallback(RichEditC.EditStreamCallback); EditStream es = new EditStream(); es.dwCookie = 999; es.pfnCallback = myRtfCallback; //Error------------------------------------------------------------------------> RichEditC.SendMessage(0x80524, RichEditC.EM_STREAMOUT, RichEditC.SF_TEXT, ref es); } public long FARPROC(long pfn) { return pfn;
-
.NET CF 2.0 COM/COM+ AccessCurrently, I am trying to implement a COM into CF 2.0 I've already implemented and registered the DLL successfully. But I always get a "NotSupportedException":
Type objType = Type.GetTypeFromProgID("MacroCOM.dll); object oAct = Activator.CreateInstance(oType); object[] parameter = new object[1]; parameter[0] = 5; //long objType.InvokeMember("MCOMConnector",BindingFlags.SetProperty, null, oAct, parameter); //this lines executes the error
Any solutions there? TIA. -
Loading Webpage - Wait until page is loadedHi peshkunta, After InvokeMember (new in .NET Framework 2.0) -> IsBusy = false IsOffline = false that's the problem (tested with your code above as check process) InvokeMember fire a method of the selected HTML element. I loaded a FORM tag and after submitting it, a new webpage is loaded again. But if I am in debugging mode and go to the line after InvokeMember I wait a moment and then it works, because the browser don't fire the flag immediately.
-
Loading Webpage - Wait until page is loadedHi Judah, thx for reply and this tip. But additionally this won't work with InvokeMember. After firing this code line the application doesn't recognize browser activity.
-
Loading Webpage - Wait until page is loadedI am using this code for check webbrowser's activity
while (wbr.ReadyState != WebBrowserReadyState.Complete) { Application.DoEvents(); }
But when I am usingheForm.InvokeMember("submit");
which submits a form on a webpage, ReadyState will not be activated or changed. Also the IsBusy flag doesn't change. -
Webbroswer Control - Busy stateHow can I check when Webbrosercontrol (VS 2005) has loaded the Page completely? IsBusy and the ControlState(Completed, Loading, Loaded ... the enum) - doesn't work
-
Template MatchingCurrently, I am working on an OCR solution where a camera push video frames into the application. One task is template matching where I try to find a bitmap within a bitmap. 1)Is template matching worth the work related to performance (Resolution 1024x768 - 24 Bit)? 2)Are there any information or resources for this subject on the web? Google show only rare information about it. thx
-
Hashtable - Get picked valuesThanks, looks better. Additionally I works with permutation now.
-
Hashtable - Get picked valuesHi Leslie, Just so I understand, you're starting with a value of (00)01 and asking which keys have this value? The result in this case being $0002 and $0004? Yes. Christian suggestion leads into overhead within the recursion. It's impossible. Try to make a recursion with 800 items, and you need about 10 min to loop through. Yes, good idea ... but really time consuming (overhead) The problem: Give me all connectors and subconnectors for current item. Lets draw better example: $1 [0] $2 [1] $3 [1] $4 [2] Result: a) $1 - $2 - $3 and b) $1 - $3 for the first line a) search connectors for $1 - found $2 and $3 then loop through founded subconnectors $2 and $3 $2 has $4 as connector $3 has no further connectors next element in main loop is §2 $2 - $4 .... $4 has no more connectors
-
Hashtable - Get picked valuesYou are right. I never had problems with algorithms and data structures, but this problems sets boundaries.
-
Hashtable - Get picked valuesOK, but I have still a problem with overhead. Look at this link and look at those trees. http://personal.vsnl.com/erwin/pruning.htm[^] Level 1 Level 2 and so on. My hashtable uses 4 levels and each node needs ALL nodes from the upper levels to check. Level 1 has 800 entries. Level 2 has 800x800 entries and so on, which makes me crazy.
-
Hashtable - Get picked valuesHi Chris, Thanks for reply. Values are not unique, so it's a little bit hard to realize that. The big problem is to check each key with all available keys (so keys^keys possibilities) to find connectors. Speed is really hard task.
-
Hashtable - Get picked valuesI have a Hashtable with following values: [Key][Value] [$0001][1] [$0002][0] [$0003][1] [$0004][0] [$0005][0] [$0006][0] [$0007][1] [$0008][1] [$0009][1] [$0010][1] Now I need all Keys with value "1". It is possible to extract them without a for loop? My main problem is a recursion. This hashtable is used 4 times and I have to check each key. Hashtable contains ~800 entries, what means 800^4 possibilites. Big overhead. Simple example: [$0001][00] [$0002][01] [$0003][04] [$0004][01] [$0005][02] Recursion - check element and its connectors 1. 0001 - my for loop checks all connectors -> Result: 0002 and 0004 (because Key is 01). 2. now check the connectors for connectors (we have 0002 and 0004) 3. 0002 has 0005(key = 02) and so on ..... Is there a way for a fast progress in speed? Thanks for all tips.
-
Compile DLL project into 3 seperate onesThx for reply, By using VS 2003, it seems that I have to use copy paste.