Re: Winforms, Shown Event and SetEnvironmentVariable

Tech-Archive recommends: Speed Up your PC by fixing your registry



On Sat, 16 Feb 2008 13:42:49 -0800, Willy Denoyette [MVP] <willy.denoyette@xxxxxxxxxx> wrote:

Yep, these two:
Environment.SetEnvironmentVariable("someKey", "1", EnvironmentVariableTarget.User);
Environment.SetEnvironmentVariable("someOtherKey", "2", EnvironmentVariableTarget.User);

in Shown handler.

Running V2 SP1 of the FW on VISTA.
Timing done using "QueryThreadCycleTime" API (Vista and up), with Processor clock at fixed rate.

Why are you doing that? The question here is elapsed time, not the CPU time consumed by the thread for the calls.

If you just put a Stopwatch in the Shown event handler, start it before the two calls, and check the Elapsed time after them, what results do you get?

Not that it's relevant to this question IMHO, but what's the .NET API for the QueryThreadCycleTime call (if any)? I can only find the unmanaged version. Is there a managed way to get at that? Maybe in WMI?

Pete
.



Relevant Pages

  • Re: Poweroff / shell
    ... it was not the Explorer but Winlogon that handled that broadcast and called to ExitWindowAPI. ... if you are running your own application as the shell you can always "fix" the behavior by providing your own handler for the ... Basically if you catch the message by your window or thread proc, you should call a shutting the system ... Some more info and ways how to intercept the power management events you can find in this thread: ...
    (microsoft.public.windowsxp.embedded)
  • Re: CreateProcessWithLogonW on Vista
    ... less work than the APIs you're trying to use, even without Vista! ... is there a list of API function that do not function properly anymore ... But because the ERP is changing a lot, we build an updater that allows ... This solution keeps our costs low (no administrator needed to install ...
    (microsoft.public.vb.winapi)
  • Re: Porting a DOS app to Windows
    ... > The application is in C and is using assembly code for ... Its been implemented in assembly via the interrupts ... delaying using a timer interrupt handler ... > routines in Win API. ...
    (comp.lang.asm.x86)
  • Re: Setting OID_802_11_BSSID through DeviceIOControl()
    ... Yes, WLAN API exists on Vista, ... I did not write a specific driver myself. ... DeviceIOControl() function, I can query all the OIDs of interest without any ...
    (microsoft.public.development.device.drivers)
  • Re: Process to Port Numbers
    ... Microsoft MVP, MCSD ... MVP VC FAQ: http://vcfaq.mvps.org ... Going to stop functioning after Vista, because TDI is depricated, and is ... I have found API Methods for the same which are ...
    (microsoft.public.win32.programmer.networks)