Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "code" in [All]

powrprof

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

uint ReturnCode = 0;

.

while (ReturnCode == 0)

.

     ReturnCode = PowerEnumerate(IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, PowerDataAccessor.ACCESS_SCHEME, Index, ReadBuffer, ref BufferSize);

.

     if (ReturnCode == 259) break; // no more data

.

     if (ReturnCode != 0)

.

       throw new COMException("Error occurred while enumerating power schemes. Win32 error code: " + ReturnCode);

.

Sample Code:

.

        throw new Exception("Error reading current power scheme. Native Win32 error code = " + res);

.

    ''' Retrieves the friendly name for the specified power setting, subgroup, or scheme, in Unicode (Each Char is 2 bytes).

.

Sample Code:

.

        throw new Exception("Error reading current power scheme. Native Win32 error code = " + res);

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

[DllImport("powrprof.dll", SetLastError=true, CharSet=CharSet.Unicode)]

.

Sample Code:

.

        uint BufferSize = (uint)System.Text.ASCIIEncoding.Unicode.GetByteCount(name);

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

iprop

.

[DllImport("iprop.dll", SetLastError=true, CharSet=CharSet.Unicode)]

.

Sample Code:

rpcrt4

.

Sample Code:

.

Sample Code in C#:

.

Sample Code in VB:

.

   Dim code As Integer

.

   code = UuidCreateSequential(myId)

.

   If code <> 0 Then

.

     Console.WriteLine("UuidCreateSequential failed: {0}", code)

.

Sample Code in C#:

.

Sample Code in VB:

.

   Dim code As Integer

.

   code = UuidCreateSequential(myId)

.

   If code <> 0 Then

.

     Console.WriteLine("UuidCreateSequential failed: {0}", code)

.

There is an Unicode version call UuidFromStringW

.

Sample Code:

winhttp

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

/// <param name="lpcwszUrl">A pointer to a null-terminated Unicode string that contains the URL of the HTTP request that the application is preparing to send.</param>

.

[DllImport("winhttp.dll", SetLastError = true, CharSet = CharSet.Unicode)]

.

Possible error codes include the folllowing:

.

Error Code - Description

.

ERROR_WINHTTP_BAD_AUTO_PROXY_SCRIPT - An error occurred executing the script code in the Proxy Auto-Configuration (PAC) file.

.

ERROR_NOT_ENOUGH_MEMORY - Not enough memory was available to complete the requested operation. (Windows error code)

.

Sample Code:

.

     NULL_CODEPAGE = 0x00000008,

.

Sample Code:

.

Sample Code:

.

I tested this method in sync method, it is ok. But according to MSDN and C++ code, the second param should be NULL when use async method. This function cann't work.

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Sample Code:

mqrt

.

Sample Code:

.

Sample Code:

.

I can share more of the code if people are interested, but there are lots of API calls leading up to the call to MQSetQueueSecurity, so I'll just show the interesting parts here:

icmp

.

Sample Code:

.

Sample Code:

.

Sample Code:

.

Complete "simple sample" coded by Aprelov Sergey:

.
Sample code tiny c OR gcc Cygwin:

imm32

.

Sample Code:

.

[DllImport("imm32.dll", CharSet=CharSet.Unicode)]

.

Sample Code:

.

[DllImport("imm32.dll", CharSet=CharSet.Unicode)]

.

Sample Code:

.

Sample Code:

.

Sample Code:

avifil32

.

Sample Code:

.

Sample Code:

Cut off search results after 60. Please refine your search.


 
Access PInvoke.net directly from VS: