win32-process

Arithmetic operation resulted in an overflow c#

你离开我真会死。 提交于 2019-12-12 01:54:53
问题 I am getting the following error when unlocking a file Arithmetic operation resulted in an overflow System.IntPtr.ToInt32 I suspect it is the following line to pBuffer.ToInt32() : IntPtr iPtr = new IntPtr(pBuffer.ToInt32() + (i * Marshal.SizeOf(fi3))); I am unable to reproduce the error myself and the error is not displaying the correct line number. I am looking for a way to reproduce this or any feedback on the possible cause. Thanks public void Close() { const int MAX_PREFERRED_LENGTH = -1;

Change a process description at run time

北城余情 提交于 2019-12-11 09:51:39
问题 I have an C win32 application that starts other apps by using the CreateProcess(). Each of the new processes get a unique port number and other stuff. My question is there anyway to add, for example the port number, to the new process description at run time? I want this to to be able to separate the processes by looking at the Task manager > Processes > Description column. Please understand I am talking about run time not compile time. with regards, Ehsan 回答1: The Description value is

CreateProcessAsUser from c++ service creates process but no console

白昼怎懂夜的黑 提交于 2019-12-11 07:59:47
问题 I am developing C++ service which uses CreateProcessAsUser function. I have tested this on Windows 7 and it was working excellent. But i am testing now my code for windows 10 and it doesnt want to work but process is created and visible in task manager, just no windows/console created. I am trying now code snippet with cmd only without any parameters I will really appreciate any kind of help I can see this with task manager, so my process is created. task manager PROCESS_INFORMATION pi;

Removing the maximize button from a window created using glfw

安稳与你 提交于 2019-12-10 11:11:09
问题 How do you remove the maximize button from a window created usingg the glfwopenWindow functionn call ? Currently, what I'm doing is: windowHandle = GetForegroundWindow(); long Style = GetWindowLong(windowHandle, GWL_STYLE); Style ^= WS_MAXIMIZEBOX; SetWindowLong(windowHandle, GWL_STYLE, WS_MAXIMIZEBOX); Where, I get the window handle and then toggle the maximize bit. Then I re-apply the window style. But this doesn't work an it makes the window completely blank without any buttons or title

visual studio crashes randomly devenv KERNELBASE.dll

瘦欲@ 提交于 2019-12-08 11:55:48
问题 My Visual Studio crashes randomly. Event Viewer shows the following error Faulting application name: devenv.exe, version: 12.0.40629.0, time stamp: 0x5590c8a4 Faulting module name: KERNELBASE.dll, version: 10.0.15063.674, time stamp: 0x6d16dd24 Exception code: 0xe0434352 Fault offset: 0x000eb872 Faulting process id: 0x3b00 Faulting application start time: 0x01d34ecf7a049150 Faulting application path: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe Faulting module

How to determine with certainty if an appliction is running before InnoSetup install script is executed

空扰寡人 提交于 2019-12-08 05:58:00
问题 I have an install script with Pascal code to determine if the app to be installed is currently running: ; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! [Setup] AppName=MyApp AppVerName=MyApp v1.0 DiskSpanning=no AppPublisher=me AppPublisherURL=http://www.example.com AppSupportURL=http://www.example.com AppUpdatesURL=http://www.example.com DefaultDirName={pf}\MyApp UsePreviousAppDir=yes DefaultGroupName=MyApp

Stop a process from showing a window from C#

匆匆过客 提交于 2019-12-07 15:04:15
问题 I'm trying to automate an application that creates a GUI window on startup that has no user interaction, but I can't figure out how to hide the actual window. I've tried using ProcessStartInfo thus: Process.Start(new ProcessStartInfo { UseShellExecute = false, CreateNoWindow = true, WindowStyle = ProcessWindowStyle.Hidden, // other properties here }); But the window still shows up. I've also tried spin-waiting for the window to exist, and then hiding it: while (process.MainWindowHandle ==

How to determine with certainty if an appliction is running before InnoSetup install script is executed

拥有回忆 提交于 2019-12-07 12:39:26
I have an install script with Pascal code to determine if the app to be installed is currently running: ; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! [Setup] AppName=MyApp AppVerName=MyApp v1.0 DiskSpanning=no AppPublisher=me AppPublisherURL=http://www.example.com AppSupportURL=http://www.example.com AppUpdatesURL=http://www.example.com DefaultDirName={pf}\MyApp UsePreviousAppDir=yes DefaultGroupName=MyApp OutputBaseFilename=Setup OutputDir=.\MyAppSetup MinVersion=5.0 [Tasks] Name: desktopicon; Description: Create a

Starting a process remotely in Powershell, getting %ERRORLEVEL% in Windows

允我心安 提交于 2019-12-04 11:15:03
A bit of background: I'm trying to start and stop some performance counters remotely at the start of a test, then stop them at the end of the test. I'm doing this from an automated test framework from a Win2003 machine, the test framework executes commands without launching a console, some of the system under test is running Win2008. I've written scripts to choose the performance counters based on roles assigned to the servers. My problem(s): logman can't start or stop counters on machines that run a later version of the OS. psexec can be used to run logman remotely, but psexec likes to hang

WaitForSingleObject doesn't wait the end of the process [duplicate]

ⅰ亾dé卋堺 提交于 2019-12-02 13:12:59
This question already has an answer here: Why those two different behaviors with WaitForSingleObject function in CPP 2 answers I would like to wait the end of the process execution (calc.exe) but it doesn't work. My program finishes fast/now while my process(calc.exe) continue to run (I don't stopped it). and WaitForSingleObject returns immediatly WAIT_OBJECT_0. ps: I disabled my software anti-virus (AVIRA) int main(int argc, char** arv) { STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); ZeroMemory(&pi, sizeof(pi)); const char * calcPrgm = "C:\\\\Windows