Desktop Functions: Smart Device Functions:
|
Search Results for "time" in [All]winscard
/// <param name="dwTimeout">The maximum amount of time, in milliseconds, to wait for an action. A value of zero causes the function to return immediately. A value of INFINITE causes this function never to time out.</param>
static extern SCardFunctionReturnCodes SCardGetStatusChange(int hContext, int dwTimeout, [In, Out] SCARD_READERSTATE[] rgReaderStates, int cReaders);
SCARD_E_TIMEOUT = 0x8010000A, 2: SCardStatus
request.cbPciLength = System.Runtime.InteropServices.Marshal.SizeOf(typeof(UnsafeNativeMethods.SCARD_IO_REQUEST)); 4: WinSCard
internal static extern uint SCardGetStatusChange(IntPtr hContext, UInt32 dwTimeout, [In, Out] SCARD_READERSTATE[] rgReaderStates, UInt32 cReaders); odbc325: SQLAllocStmt
<Runtime.InteropServices.DllImport("odbc32.dll", CharSet:=Runtime.InteropServices.CharSet.Unicode)> _
Private Shared Function SQLAllocStmt(ByVal connectionHandle As IntPtr, <Runtime.InteropServices.Out()> _ 6: SQLConnect
<Runtime.InteropServices.DllImport("odbc32.dll", CharSet:=Runtime.InteropServices.CharSet.Unicode)> _
<Runtime.InteropServices.DllImport("odbc32.dll", CharSet:=Runtime.InteropServices.CharSet.Unicode)> _
<Runtime.InteropServices.Out()> ByRef pbcConnStrOut As Short, ByVal fDriverCompletion As Short) As Short
<Runtime.InteropServices.DllImport("odbc32.dll", CharSet:=Runtime.InteropServices.CharSet.Unicode)> _ 9: SQLFetch
<Runtime.InteropServices.DllImport("odbc32.dll", CharSet:=Runtime.InteropServices.CharSet.Unicode)> _ 10: SQLFreeStmt
<Runtime.InteropServices.DllImport("odbc32.dll", CharSet:=Runtime.InteropServices.CharSet.Unicode)> _ 11: SQLGetData
<Runtime.InteropServices.DllImport("odbc32.dll")> _ 12: SQLMoreResults
<Runtime.InteropServices.DllImport("odbc32.dll", CharSet:=Runtime.InteropServices.CharSet.Unicode)> _ winmm
Declare Function midiStreamPosition Lib "winmm.dll" (ByVal hms As IntPtr, ByVal pmmt As MMTIME, ByVal cbmmt As UInteger) As Integer
Structure MMTIME 14: mixerGetDevCaps
using System.Runtime.InteropServices; 15: timeBeginPeriod
[DllImport("winmm.dll", EntryPoint="timeBeginPeriod")]
Declare Function timeBeginPeriod Lib "winmm.dll" (ByVal uPeriod As Integer) As Integer Also see TimeGetTime (MM_GetTime) and TimeEndPeriod (MM_EndPeriod)
MM_BeginPeriod(1); // set timer resolution to 1ms => freq=1000Hz
// tickcount has resolution of 16.5ms, mmtime has 1ms
oWriter.WriteLine("{0}: TickCount={1}, MMTime={2}", nLoop, Environment.TickCount, MM_GetTime()); 16: timeEndPeriod
[DllImport("winmm.dll", EntryPoint="timeEndPeriod")]
Declare Function timeEndPeriod Lib "winmm.dll" (ByVal uPeriod As Integer) As Integer Also see timeBeginPeriod and timeEndPeriod See timeBeginPeriod for a sample 17: timeGetDevCaps
static extern UInt32 timeGetDevCaps( ref TimeCaps timeCaps,
UInt32 sizeTimeCaps ); Declare Function timeGetDevCaps Lib "winmm.dll" (ByRef lpTimeCaps As TimeCaps, ByVal uSize As UInt32) As UInt32 http://www.pinvoke.net/default.aspx/Structures.TimeCaps Returns TIMERR_NOERROR if successful or TIMERR_STRUCT if it fails to return the timer device capabilities. TIMERR_NOERROR is defined as UInt32 0 value.
static extern UInt32 timeGetSystemTime( ref MmTime mmTime, UInt32 sizeMmTime );
Declare Function timeGetSystemTime Lib "winmm.dll" (TODO) As TODO 19: timeGetTime
[DllImport("winmm.dll", EntryPoint="timeGetTime")]
public static extern uint MM_GetTime();
<DllImport("winmm.dll", EntryPoint := "timeGetTime")> _
Public Shared Function MM_GetTime() As UInteger Unlike Environment.TickCount, you can directly set the resolution of this timer with the TimeBeginPeriod function. See TimeBeginPeriod (imported as MM_BeginPeriod) and TimeEndPeriod (imported as MM_EndPeriod) See TimeBeginPeriod for a sample 20: timeKillEvent
static extern UInt32 timeKillEvent( UInt32 timerEventId );
Declare Function timeKillEvent Lib "winmm.dll" (TODO) As TODO 21: timeSetEvent
static extern UInt32 timeSetEvent( UInt32 msDelay, UInt32 msResolution,
TimerEventHandler handler, ref UInt32 userCtx, UInt32 eventType );
Declare Function timeSetEvent Lib "winmm.dll" (TODO) As TODO System.Threading.Timer
public class MMTimer : IDisposable
static extern uint timeSetEvent(uint uDelay, uint uResolution, TimerCallback lpTimeProc, UIntPtr dwUser, uint fuEvent);
static extern uint timeKillEvent(uint uTimerID);
static extern uint timeGetTime();
static extern uint timeBeginPeriod(uint uPeriod);
static extern uint timeEndPeriod(uint uPeriod);
//Timer type definitions
TIME_ONESHOT = 0, //Event occurs once, after uDelay milliseconds.
TIME_PERIODIC = 1,
TIME_CALLBACK_FUNCTION = 0x0000, /* callback is function */
//TIME_CALLBACK_EVENT_SET = 0x0010, /* callback is event - use SetEvent */
//TIME_CALLBACK_EVENT_PULSE = 0x0020 /* callback is event - use PulseEvent */
delegate void TimerCallback(uint uTimerID, uint uMsg, UIntPtr dwUser, UIntPtr dw1, UIntPtr dw2);
~MMTimer()
/// The current timer instance ID
TimerCallback thisCB;
/// The timer elapsed event
public event EventHandler Timer;
protected virtual void OnTimer(EventArgs e)
if (Timer != null)
Timer(this, e);
public MMTimer()
/// Stop the current timer instance (if any)
timeKillEvent(id);
Debug.WriteLine("MMTimer " + id.ToString() + " stopped");
/// Start a timer instance
/// <param name="ms">Timer interval in milliseconds</param>
//Kill any existing timer
//Set the timer type flags
fuEvent f = fuEvent.TIME_CALLBACK_FUNCTION | (repeat ? fuEvent.TIME_PERIODIC : fuEvent.TIME_ONESHOT);
id = timeSetEvent(ms, 0, thisCB, UIntPtr.Zero, (uint)f);
throw new Exception("timeSetEvent error");
Debug.WriteLine("MMTimer " + id.ToString() + " started");
void CBFunc(uint uTimerID, uint uMsg, UIntPtr dwUser, UIntPtr dw1, UIntPtr dw2)
//Callback from the MMTimer API that fires the Timer event. Note we are in a different thread here
OnTimer(new EventArgs());
<Runtime.InteropServices.StructLayout(Runtime.InteropServices.LayoutKind.Sequential, CharSet:=Runtime.InteropServices.CharSet.Auto)> _
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=32)> _
[System.Runtime.InteropServices.StructLayout(Runtime.InteropServices.LayoutKind.Sequential, CharSet = System.Runtime.InteropServices.CharSet.Auto)]
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 32)]
waveOutGetDevCaps(i, wc, System.Runtime.InteropServices.Marshal.SizeOf(wc))
using System.Runtime.InteropServices; ipaqutilNo tips or tricks required, should work first time! psapi
using System.Runtime.InteropServices; 26: EnumProcesses
using System.Runtime.InteropServices;
using System.Runtime.InteropServices;
public uint PeakPagefileUsage; // The peak value in bytes of the Commit Charge during the lifetime of this process (SIZE_T). rpcrt429: UuidFromStringA pin_ptr<unsigned char> UuidSringPtr = static_cast<unsigned char *>(System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi("C3ECE8CB-E9F8-47f9-AC61-8EA8572403F2").ToPointer()); user32- The foreground lock time-out has expired (see SPI_GETFOREGROUNDLOCKTIMEOUT in SystemParametersInfo). 31: AnimateWindow
static extern bool AnimateWindow(IntPtr hwnd, int time, AnimateWindowFlags flags);
Imports System.Runtime.InteropServices
Shared Function AnimateWindow(ByVal hwnd As IntPtr, ByVal time As Integer, ByVal flags As AnimateWindowFlags) As Boolean 32: ClipCursor
[System.Runtime.InteropServices.DllImport("user32.dll")] 33: CloseClipboard by using the 3 clipboard API's below first it work every time and you don't have to 34: CopyIcon CopyCursor reference will fail at runtime, according to documentation it is a macro: 35: CreateCaret
SetCaretBlinkTime(300) 36: CreateDesktop If you come across this error "System.Runtime.InteropServices.MarshalDirectiveException: Cannot marshal 'parameter #6': Invalid managed/unmanaged type combination (this value type must be paired with Struct).", you may want to use 37: CreatePopupMenu
[System.Runtime.InteropServices.ComRegisterFunctionAttribute()]
[System.Runtime.InteropServices.ComUnregisterFunctionAttribute()] 38: CreateWindowEx I sometimes get error 1407 ("Cannot find window class.") when trying to create the window (after a successful call to RegisterClass)
using System.Runtime.InteropServices;
IntPtr hConv, IntPtr hszItem, uint wFmt, uint wType, uint dwTimeout, 40: DestroyWindow
/// <para>The DestroyWindow function destroys the specified window. The function sends WM_DESTROY and WM_NCDESTROY messages to the window to deactivate it and remove the keyboard focus from it. The function also destroys the window's menu, flushes the thread message queue, destroys timers, removes clipboard ownership, and breaks the clipboard viewer chain (if the window is at the top of the viewer chain).</para>
''' <para>The DestroyWindow function destroys the specified window. The function sends WM_DESTROY and WM_NCDESTROY messages to the window to deactivate it and remove the keyboard focus from it. The function also destroys the window's menu, flushes the thread message queue, destroys timers, removes clipboard ownership, and breaks the clipboard viewer chain (if the window is at the top of the viewer chain).</para> 41: DragDetect
DateTime startTime = DateTime.Now;
while ((DateTime.Now - startTime).TotalMilliseconds < 500) {
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]
[System.Runtime.InteropServices.DllImport("user32.dll")]
[System.Runtime.InteropServices.In] ref RECT lprcFrom,
[System.Runtime.InteropServices.In] ref RECT lprcTo);
[System.Runtime.InteropServices.DllImport("user32.dll", SetLastError = true)]
[System.Runtime.InteropServices.DllImport("user32.dll", SetLastError = true)]
[System.Runtime.InteropServices.DllImport("user32.dll")]
[StructLayout(System::Runtime::InteropServices::LayoutKind::Sequential)] 43: DrawMenuBar
[System.Runtime.InteropServices.DllImport("user32.dll")]
[System.Runtime.InteropServices.DllImport("user32.dll")]
[System.Runtime.InteropServices.DllImport("user32.dll")]
[System.Runtime.InteropServices.DllImport("user32.dll")] 44: EnableMenuItem
<DllImport("user32.dll", CallingConvention:=Runtime.InteropServices.CallingConvention.Cdecl)> _
<DllImport("user32.dll", CallingConvention:=Runtime.InteropServices.CallingConvention.Cdecl)> _ 45: EnumChildWindows
Imports System.Runtime.InteropServices
using System.Runtime.InteropServices; 47: EnumDesktops
<Runtime.InteropServices.DllImport("user32.dll")>
using System.Runtime.InteropServices; using System.Runtime.InteropServices; Imports System.Runtime.InteropServices 50: FlashWindow
public UInt32 dwTimeout;
FLASHW_TIMER = 4,
FLASHW_TIMERNOFG = 12
fInfo.dwTimeout = 0;
fInfo.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG;
fInfo.dwTimeout = 0;
FLASHW_TIMER = 4
FLASHW_TIMERNOFG = 12
Public dwTimeout As Long
If FlashCount = 0 Then .dwFlags = .dwFlags Or FlashWindowFlags.FLASHW_TIMERNOFG
.dwTimeout = 0 ' Use the default cursor blink rate.
.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(fwi) 51: FlashWindowEx
public UInt32 dwTimeout;
FLASHW_TIMER = 4,
FLASHW_TIMERNOFG = 12
fInfo.dwTimeout = 0;
fInfo.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG;
fInfo.dwTimeout = 0;
FLASHW_TIMER = 4
FLASHW_TIMERNOFG = 12
Public dwTimeout As Long
If FlashCount = 0 Then .dwFlags = .dwFlags Or FlashWindowFlags.FLASHW_TIMERNOFG
.dwTimeout = 0 ' Use the default cursor blink rate.
.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(fwi) 52: GetAsyncKeyState
private void timer1_Tick(object sender, EventArgs e)
timer1.Interval = 3;
Imports System.Runtime.InteropServices
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
static extern uint GetCaretBlinkTime(); Is there some Windows Message posted when the user changes the Blink Time in the system control ? Use SystemInformation.CaretBlinkTime property [GetCaretBlinkTime] on MSDN
using System.Runtime.InteropServices; 55: GetComboBoxInfo
cbi.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(cbi);
cbi.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(cbi) 56: GetCursor
<System.Runtime.InteropServices.StructLayout(Runtime.InteropServices.LayoutKind.Sequential)> _
using System.Runtime.InteropServices; 57: GetCursorPos
<System.Runtime.InteropServices.StructLayout(Runtime.InteropServices.LayoutKind.Sequential)> _
static extern uint GetDoubleClickTime();
Declare Function GetDoubleClickTime Lib "user32.dll" () As Integer System.Windows.Forms.SystemInformation.DoubleClickTime (http://msdn.microsoft.com/en-us/library/system.windows.forms.systeminformation.doubleclicktime.aspx) 59: GetGUIThreadInfo
using System.Runtime.InteropServices; 60: GetIconInfo
<System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint:="GetIconInfo")> _
Public Shared Function GetIconInfo(ByVal hIcon As System.IntPtr, ByRef piconinfo As ICONINFO) As <System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)> Boolean Cut off search results after 60. Please refine your search. |