Related topics

Need source for Correct CONST values (?)
Yorai Aminov (TeamB) yaminov@delete_shorterpath.com borland public delphi vcl components using On 10 Sep 2003 06:34:33 -0700, "landis_lund" <landis_l...@yahoo.co.uk> wrote: I can get the current process handle using GetCurrentProcess() but cant find any fuctions that allow me set the current foreground process.

Using GetCurrentProcess API
The release code should be: I hope it helps. using System.Diagnostics; using System.Runtime.InteropServices; using System. GetCurrentProcess().Id) { EnumWindows(new EnumWindowsProcDel(EnumWindowsProc), proc.Id); bRunning = true; // Was app already running? if (bRunning == false) { // Start new instance

Form does not close + outlook interopability + process.kill + ...
It also demonstrates a technique for using anonymous pipes to redirect the child process's standard input and output handles. fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStdinWr, GetCurrentProcess(), &hChildStdinWrDup, 0, FALSE, // not inherited DUPLICATE_SAME_ACCESS); if (!

GetProcesses
"Sridhar" <Srid...@discussions.microsoft.com> wrote in message news:D491CFBB-B1EF-4DC8-A818-03472CD0DB42@microsoft.com... Hi, I want to find the current process name using System.diagnostics GetCurrentProcess API in Vista. But Vista prohibits a standard user from using the above command. Does anyone have any idea

killing a service on a remote server (W2K)
...
_ ByVal lpFile As String, _ lpSecurityAttributes As Any) As Long 'Private Declare Function RegSaveKey Lib "advapi32.dll" _ Alias "RegSaveKeyA" _ (ByVal hKey As Long, _ ByVal lpFile As String, _ lpSecurityAttributes As SECURITY_ATTRIBUTES) As Long Private Declare Function GetCurrentProcess Lib "kernel32" () As

Using DbgHelp API in connection with static libraries
There is no problem using dbghelp with static libraries. It doesn't care how you link. I solved the problem that dbghelp didn't find symbols . SymInitialize(GetCurrentProcess(), 0, TRUE)) return false; _inited = true; return _inited; //DBGUTILS_EXPORT int dbgutils_get_program_counters(int* pcs, int pccount)

Console with API
I can get the current process hooked using GetCurrentProcess or GetCurrentProcessId. How can I get window handle of process? What I want to know absolutely is the name of application being hooked. I think that by window text I can get the name of application. But a few application have the different name from

how do i get the path to my application?
Attributes := SE_PRIVILEGE_ENABLED; if not OpenProcessToken(GetCurrentProcess, TOKEN_ADJUST_PRIVILEGES, TokenHandle) then RaiseLastWin32Error; try if not AdjustTokenPrivileges(TokenHandle, false, Privileges, 0, PTokenPrivileges(nil)^, PDWORD(nil)^) then RaiseLastWin32Error; finally CloseHandle(TokenHandle); end;

Trying to marshal a process handle..
Can the timing be more accurate using a blit? Does it affect my DirectX application if I give it realtime-priority using SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS)? Does DirectInput read different mouse types differently, that means: Should I use a PS/2 mouse or a USB mouse?

Remoting bug?
LoggedSetLockPagesPrivilege( GetCurrentProcess(), TRUE ) ) { return 1; else { printf (" success of LoggedSetLockPagesPrivilege( GetCurrentProcess(), TRUE )\n"); bResult = FreeUserPhysicalPages( GetCurrentProcess(), &NumberOfPages, aPFNs ); if( bResult != TRUE ) { printf("Cannot free physical pages, error %u.

Process.ProcessName is very slow
I'm using MS Visual C++ 6.0 on Windows XP. I read the tutorial "Creating a Child Process with Redirected Input and Output" (at &hTmp, &sa, 0); DuplicateHandle(GetCurrentProcess(), hTmp, GetCurrentProcess(), &hStdHost[1], 0, FALSE, // not inherited DUPLICATE_SAME_ACCESS); CloseHandle(hTmp); sui.

ApplicationHost gives a NullReferenceException when processing ASP ...
... process' stdin and then tries to retrieve the output of the child process from it's stdout which is connected to parent process using an anonymous pipe. Here one of the parameters as FALSE will make sure that the // read handle is inheritable // Ques : Which process is returned when GetCurrentProcess() is

Problem in Interprocess Communication using anonymous pipes, when
processAppSpec = &outFSSpec; // now get the process information with its FSSpec theErrorStatus = GetProcessInformation ( &theProcSerNum, &theProcInfoRec ); return (theErrorStatus); That can be simplified. Instead of using GetCurrentProcess, start out with ProcessSerialNumber theProcSerNum = {kNoProcess,

Process.GetCurrentProcess().ProcessName slow. How to use ...
Begin
of code sample using System; using System.Text; using System.Runtime.InteropServices; using System.Security.Permissions; using System.Security.Principal; using System. GetCurrentProcess().ProcessName; Process[] myProcesses = Process.GetProcessesByName(processName); if(myProcesses.Length == 0) Console.

FSSpec of the current application
One program under VB 4.0 was able to shut down or restart the (windows XP) machine using a series of API calls. (Getlasterror, GetCurrentProcess, OpenProcessToken, LookupPrivilegeValue, AdjustTokenPrivilegese, ExitWindowsEx. I am trying to avoid using any API calls if possible and to use managed code instead.

How to call Win32 Native API GetTokenInformation() using C#?
Any help would be appreciated. thanks, Orlando My code, stripped for clarity (although i've also gotten the same results using IntPtr instead of out TOKEN_ELEVATION_TYPE): private static bool? TryGetIsInAdminRole() { IntPtr tokenHandle; OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, out tokenHandle);

How can I get window text from ProcessID
I am trying to shut down NT4 from VB5 using the API call ExitWindowsEx, but the call results in an error, and the system does not shut down. I have a portion of a C++ program which sets NT privileges using calls to OpenProcessToken, GetCurrentProcess, LookupPrivilegeValue, AdjustTokenPrivileges, to set a privilege

Repost/Update Nightmare Memory Consumption using .NET XML
StackWalk( IMAGE_FILE_MACHINE_I386, GetCurrentProcess(), thread, &sf, ctxp, 0, SymFunctionTableAccess, SymGetModuleBase, 0 ) ) break; // Sanity check to make sure the frame is OK. if( 0 == sf.AddrFrame.Offset ) break; pSymbol->SizeOfStruct = sizeof( symbolBuffer ); pSymbol->MaxNameLength = 1024; // Displacement of

Please help me to shutdown WinNT using "ExitWindowsEx"
Here is the sample snippet: <code> using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System. GetCurrentProcess().Id.ToString(); MessageBox.Show(strMoniker); EnvDTE._DTE dte =(EnvDTE._DTE)GetMSDEVFromGIT(strMoniker); this.Control.Text = dte.Solution.

using Delay load feature
FlushInstructionCache(GetCurrentProcess(),(LPCVOID)Address, Length); VirtualProtectEx(GetCurrentProcess(), (LPVOID)Address, Length, oldperm, &tmp); [snip] I think the main sticking point that I cannot seem to track down anywhere, is how on earth do I modify the memory in one program, using another.