suspend

How to create suspended process from c# without P/Invoke?

我只是一个虾纸丫 提交于 2019-12-01 20:35:25
WinAPI CreateProcess has the flag CREATE_SUSPENDED so it's possible to attach process to JobObject before it has done something and then to call ResumeThread for its main thread. The only that I found searching for a solution is this post written 11 years ago! The only way to do this is with CreateProcess . The .net Process class does not offer the functionality. Either p/invoke CreateProcess or use a mixed mode C++/CLI assembly to call the same. 来源: https://stackoverflow.com/questions/22570591/how-to-create-suspended-process-from-c-sharp-without-p-invoke

i.MX35 suspend CPU and DDR2 from IRAM

≡放荡痞女 提交于 2019-12-01 10:41:07
I have to put my device into a very deep low power mode from Linux 2.6.38 and therefore, it's necessary to suspend all components, including CPU und DDR2. What I found out so far is that I have to copy the core assembler function into the processor's internal memory and execute it from there. Basically, it looks like this: cpaddr = iram_alloc(SZ_1K, &iram_addr); if(!cpaddr) return -ENOMEM; suspend_iram_base = __arm_ioremap(iram_addr, SZ_1K, MT_HIGH_VECTORS); memcpy(suspend_iram_base, cpu_v6_sdram_off, SZ_1K); flush_icache_range(suspend_iram_base, suspend_iram_base + SZ_1K); flush_cache_all();

Delphi thread that waits for data, processes it, then resumes waiting

混江龙づ霸主 提交于 2019-11-30 05:13:40
I need to create a thread in Delphi with the following characteristics: Waits until the main thread adds data to a shared queue. Processes all the data in the queue, returning the results to main thread (for this last part I'll just send messages to the main window). Processing is time-consuming, so new data may be added to the queue while the worker thread is processing previous entries. Resumes waiting, using as little cpu cycles as possible. I cannot send messages to the thread, since it does not have a window handle. Should I be using some variant of WaitForObject? If so, what would the

Prevent WPF window flicker

a 夏天 提交于 2019-11-29 15:07:54
I've got a borderless WPF window that needs to be able to hide one of its controls and shrink the window at the same time. The problem is that it looks terrible. Here's what I am doing now: private void btnShowHideTopBar_Click(object sender, RoutedEventArgs e) { if (commandTopHide == true) { txtblkShowHideTopBar.Text = "Show Top Bar"; commandTopHide = false; myWindow.Left = 1100; myWindow.Width = 180; RSide.Width = new GridLength(0, GridUnitType.Pixel); } else if (commandTopHide == false) { txtblkShowHideTopBar.Text = "Hide Top Bar"; commandTopHide = true; myWindow.Left = 1030; myWindow.Width

How can I run code on Windows Mobile while being suspended?

眉间皱痕 提交于 2019-11-29 08:45:23
I'd like to run some C++ code while the Windows Mobile PocketPC is (or seems) being suspended. An example what I mean is the HTC Home plugin that shows (among others) a tab where the HTC Audio Manager can be used to play back mp3 files. When I press the on/off button, the display goes black, but the audio keeps playing. The only button to switch back on is the on/off button, as expected. What I tried so far is to capture hardware button presses (works) and switch off the video display (works). What doesn't work with this approach is that when (accidentally) pressing any key on the device, the

UWP page state manage

南笙酒味 提交于 2019-11-28 11:46:51
I want to learn how to manage the state of a page between navigation. for example a navigate onto page1 and then i navigate to page2, but when i navigate back to page1, the UI elements must already be there with the same data as before and they must not be re-initialized or data must not be binded again by the compiler. Also what I can do to manage state of whole application such that, I terminate the app and then when i launch it next time, the same state is already there as last time. can i apply it on whole application? or what if I only want to apply it on a few pages? any help would be

How to get thread state (e.g. suspended), memory + CPU usage, start time, priority, etc

六月ゝ 毕业季﹏ 提交于 2019-11-28 07:51:06
How do I get the information if a thread has been suspended with SuspendThread() . There is no API that gives this information. The toolhelp snapshot API is very limited. There is a lot of misleading information in internet and also on StackOverflow. Some people on StackOverflow even say that this is not possible. Others post a solution that requires Windows 7. But I need the code to work on XP. Elmue I found the answer myself. I wrote a class cProcInfo that obtains a lot of information about processes and threads like: Process and Thread identifiers Process Parent Identifier Process Name

Self Suspending a thread in Delphi when it's not needed and safely resuming

怎甘沉沦 提交于 2019-11-28 04:17:56
问题 This question involves Delphi and XE specifically deprecating Suspend and Resume. I have read other posts and I have not found a similar usage so far, so I’m going to go ahead and ask for a discussion. What I’d like to know is there a better way to pause a thread when it is not needed? We have a Delphi class that we have used for years that is basically a FIFO Queue that is associated with a threaded process. The queue accepts a data object on the main thread and if the thread is suspended it

NativeActivity does not finish

北城以北 提交于 2019-11-28 03:56:30
问题 I call a NativeActivity from a JavaActivity. The entry point of my NativeActivity is android_main(struct android_app* state) At the end of this, I call ANativeActivity_finish However my native activity just hangs, instead of returning to the Java Activity that called it (it was called simply using startActivity ). It seems like it is in a pause state. The only way I can get it to return to the previous activity is by calling exit(0) at the end of my android_main, however this kills the

How to turn on monitor after wake-up from suspend mode? [closed]

∥☆過路亽.° 提交于 2019-11-28 02:03:08
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I need to wake up a PC from sleep to perform some actions using C#. I've used CreateWaitableTimer functions, everything goes fine. At given time the PC wakes up but the monitor stays in power save mode (turned off)! So I want to know, how to turn the monitor ON after wake up? PS I