Desktop Functions: Smart Device Functions:
|
Search Results for "POINT" in [All]oleacc
public static extern IntPtr AccessibleObjectFromPoint(POINT pt, [Out, MarshalAs(UnmanagedType.Interface)] out IAccessible accObj, [Out] out object ChildID);
Declare Function AccessibleObjectFromPoint Lib "oleacc.dll" (TODO) As TODO This function retrieves the lowest-level accessible object in the object hierarchy at the given point specified in screen coordinates where 0, 0 is the upper left corner. If the element at the point is not an accessible object (that is, does not support IAccessible), then the function retrieves the IAccessible interface of the parent object. The parent object must provide information about the child element through the IAccessible interface.
public static IAccessible GetAccessibleObject(POINT pt, out int ChildID)
IntPtr success = AccessibleObjectFromPoint(pt, out accObj, out varChildID);
public static extern IntPtr AccessibleObjectFromPoint(POINT pt, [Out, MarshalAs(UnmanagedType.Interface)] out IAccessible accObj, [Out] out object ChildID);
Shared Function AccessibleObjectFromPoint(ByVal pt As Point, <MarshalAs(UnmanagedType.Interface)> ByRef accObj As IAccessible, ByRef ChildID As Object) As IntPtr The ManagedWindowsApi project (http://mwinapi.sourceforge.net) provides a SystemAccessibleObject class to access accessible objects, that can be instantiated from a point. This function retrieves the lowest-level accessible object in the object hierarchy at a given point in screen coordinates where (0, 0) is the upper left corner. If the element at the point is not an accessible object (that is, does not support IAccessible), then the function retrieves the IAccessible interface of the parent object. The parent object must provide information about the child element through the IAccessible interface.
public static IAccessible GetAccessibleObject(POINT pt, out int ChildID)
IntPtr success = AccessibleObjectFromPoint(pt, out accObj, out varChildID);
//MouseHook.POINT structure type of POINT
public static IntPtr GetControlHandlerFromPoint(MouseHook.POINT location)
handler = AccessibleObjectFromPoint(location,out iAccessible,out ChildId);
public static extern IntPtr AccessibleObjectFromPoint(MouseHook.POINT pt, [Out, MarshalAs(UnmanagedType.Interface)] out IAccessible accObj, [Out] out object ChildID); query5: lorem37 Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring. version6: lorem37 Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring. userenv
short* start = (short*)env.ToPointer();
<DllImport("userenv.dll", EntryPoint:="LoadUserProfile", SetLastError:=True, CharSet:=CharSet.Auto)> _ [in, out] Pointer to a PROFILEINFO structure. LoadUserProfile will fail and return ERROR_INVALID_PARAMETER if the dwSize member of the structure is not set to sizeof(PROFILEINFO) or if the lpUserName member is NULL. For more information, see the following Remarks section. mapi32[DllImport(@"C:\Program Files\Microsoft Office\Office15\OLMAPI32.dll", EntryPoint = "HrGetAutoDiscoverXML", CharSet = CharSet.Unicode)] 10: MAPIFindNext To get the Message ID of the first message, lpszSeedMessageID should be null or should point to an empty string. Pass null or an empty string for lpszMessageType to find InterPersonal Message (IPM). 11: MAPIInitialize [DllImport(@"C:\Program Files\Microsoft Office\Office15\OLMAPI32.dll", EntryPoint = "MAPIInitialize", CharSet = CharSet.Unicode)] 12: MAPIUninitialize [DllImport(@"C:\Program Files\Microsoft Office\Office15\OLMAPI32.dll", EntryPoint = "MAPIUninitialize", CharSet = CharSet.Unicode)] hhctrl13: HtmlHelp
[DllImport("hhctrl.ocx", SetLastError=true, EntryPoint = "HtmlHelpW", CharSet = CharSet.Unicode)]
<DllImport("hhctrl.ocx", SetLastError:=True, EntryPoint:="HtmlHelpW", CharSet:=CharSet.Unicode)> _
[DllImport("hhctrl.ocx", SetLastError = true, EntryPoint = "HtmlHelpW", CharSet = CharSet.Unicode)]
class POINT
public POINT()
public POINT(int x, int y)
internal POINT pt;
Point current_cursor_location = Control.MousePosition;
param.pt = new POINT(current_cursor_location.X, current_cursor_location.Y); hid
IntPtr preparsedDataPointer = new System.IntPtr();
success = HidD_GetPreparsedData( hidHandle, ref preparsedDataPointer );
// Copy the data at PreparsedDataPointer into a byte array.
result = HidP_GetCaps( preparsedDataPointer, ref Capabilities );
result = HidP_GetValueCaps(HidP_Input, ref valueCaps[0], ref Capabilities.NumberInputValueCaps, preparsedDataPointer);
success = HidD_FreePreparsedData( ref preparsedDataPointer );
Pointer to a caller-allocated HIDD_ATTRIBUTES structure that returns the attributes of the collection specified by DeviceObject. 16: HidD_GetHidGuid
[DllImport("hid.dll", EntryPoint="HidD_GetHidGuid", SetLastError=true)]
Pointer to a caller-allocated output report buffer that the caller uses to specify a report ID. 18: HidP_GetCaps
Pointer to a top-level collection's preparsed data.
Pointer to a caller-allocated buffer that the routine uses to return a collection's HIDP_CAPS structure. winfax
[DllImport("winfax.dll", SetLastError = true, EntryPoint = "FaxCompleteJobParamsW")]
[DllImport("winfax.dll", SetLastError = true, EntryPoint = "FaxCompleteJobParamsW")]
Be careful ! Don't miss the EntryPoint attribute, beacause string in structures will be in bad format (ANSI). credui
[DllImport("credui.dll", EntryPoint="CredUIConfirmCredentialsW", CharSet = CharSet.Unicode)]
[DllImport("credui.dll", EntryPoint="CredUIParseUserNameW", CharSet=CharSet.Unicode)]
<System.Runtime.InteropServices.DllImport("credui.dll", EntryPoint:="CredUIPromptForWindowsCredentials", CharSet:=CharSet.Unicode)> <CLSCompliant(False)> _
/// The credential provider should align the credential BLOB pointed to by the refOutAuthBuffer parameter to a 32-bit boundary, even if the provider is running on a 64-bit system. kernel3223: CloseHandle Unsafe Code refers to C# code with Pointers in it. "The use of pointers is rarely required in C#, but there are some situations that require them. Using an 'unsafe' context to allow pointers is warranted [... for use of] Advanced COM or Platform Invoke scenarios that involve structures with pointers in them" e.g. "You cannot return the same exact pointer from a native function that you took as a parameter. If a native function returns the pointer that has been marshaled to it by PInvoke[c or c++ or DllImport in c#], memory corruption and exceptions may ensue." http://msdn.microsoft.com/en-us/library/ms235282.aspx 24: ConsoleFunctions
// TODO: Test - what's an out uint[] during interop? This probably isn't quite right, but provides a starting point:
[DllImport("kernel32.dll", EntryPoint = "ReadConsoleInputW", CharSet = CharSet.Unicode)]
* IntPtr.Zero - Since I did not need to pass it on to a child process, I decided to leave this pointer as null.
26: CreateEvent
EntryPoint:="CreateEventA")> _ 27: CreateFile
byte* p = (byte*)hMVF.ToPointer() + iViewDelta;
byte* p = (byte*)hMVF.ToPointer() + iViewDelta;
byte* p = (byte*)hMVF.ToPointer() + iViewDelta;
byte* p = (byte*)hMVF.ToPointer() + iViewDelta;
byte* p = (byte*)hMVF.ToPointer() + iViewDelta;
byte* p = (byte*)hMVF.ToPointer() + iViewDelta;
byte* p = (byte*)hMVF.ToPointer() + iViewDelta;
byte* p = (byte*)hMVF.ToPointer() + iViewDelta; 29: CreateMutex
/// Main entry point for the application. 30: CreateNamedPipe
[DllImport("kernel32.dll", EntryPoint = "CreateFile", SetLastError = true)]
[DllImport("kernel32.dll", EntryPoint = "PeekNamedPipe", SetLastError = true)] The key is to use Marshal.GetFunctionPointerForDelegate to get an IntPtr to the method that will serve as the thread proc. 32: DebugBreak 33: DefineDosDevice
DeleteVolumeMountPoint(@"Y:\");
static extern bool DeleteVolumeMountPoint(string lpszVolumeMountPoint); DeleteVolumeMountPoint(DriveLetter+":\\"); 35: DeviceIoControl
FsctlQueryRetrievalPointers = (EFileDevice.FileSystem << 16) | (14 << 2) | EMethod.Neither | (0 << 14),
FsctlGetRetrievalPointers = (EFileDevice.FileSystem << 16) | (28 << 2) | EMethod.Neither | (0 << 14),
FsctlSetReparsePoint = (EFileDevice.FileSystem << 16) | (41 << 2) | EMethod.Buffered | (0 << 14),
FsctlGetReparsePoint = (EFileDevice.FileSystem << 16) | (42 << 2) | EMethod.Buffered | (0 << 14),
FsctlDeleteReparsePoint = (EFileDevice.FileSystem << 16) | (43 << 2) | EMethod.Buffered | (0 << 14),
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode, EntryPoint:="EnumResourceNamesW", SetLastError:=True)> _
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode, EntryPoint:="EnumResourceNamesW", SetLastError:=True)> _
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode, EntryPoint:="EnumResourceNamesW", SetLastError:=True)> _
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode, EntryPoint:="EnumResourceNamesW", SetLastError:=True)> _
[DllImport("kernel32.dll", EntryPoint = "EnumResourceNamesW", CharSet = CharSet.Unicode, SetLastError = true)]
[DllImport("kernel32.dll", EntryPoint = "EnumResourceNamesW", CharSet = CharSet.Unicode, SetLastError = true)]
/// The main entry point for the application.
<DllImport("kernel32.dll", EntryPoint:="ExpandEnvironmentStringsW", SetLastError:=true, CharSet:=CharSet.Unicode)> _
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true, EntryPoint="CreateFileW")]
<DllImport("Kernel32.dll", EntryPoint:="FormatMessageW", SetLastError:=True, CharSet:=CharSet.Unicode, CallingConvention:=CallingConvention.StdCall)> _
<DllImport("Kernel32.dll", EntryPoint:="FormatMessageW", SetLastError:=True, CharSet:=CharSet.Unicode, CallingConvention:=CallingConvention.StdCall)> _
<DllImport("Kernel32.dll", EntryPoint:="FormatMessageW", SetLastError:=True, CharSet:=CharSet.Unicode, CallingConvention:=CallingConvention.StdCall)> _ 41: FormatMessage
<DllImport("Kernel32.dll", EntryPoint:="FormatMessageW", SetLastError:=True, CharSet:=CharSet.Unicode, CallingConvention:=CallingConvention.StdCall)> _
<DllImport("Kernel32.dll", EntryPoint:="FormatMessageW", SetLastError:=True, CharSet:=CharSet.Unicode, CallingConvention:=CallingConvention.StdCall)> _
<DllImport("Kernel32.dll", EntryPoint:="FormatMessageW", SetLastError:=True, CharSet:=CharSet.Unicode, CallingConvention:=CallingConvention.StdCall)> _
<System.Runtime.InteropServices.DllImport("Kernel32.dll", EntryPoint:="FormatMessageW", SetLastError:=True, CharSet:=System.Runtime.InteropServices.CharSet.Unicode)> 42: FreeLibrary
<DllImport("kernel32.dll", SetLastError:=True, EntryPoint:="FreeLibrary")> _ 43: GetCommandLine The original GetCommandLine function returns a pointer to a buffer allocated and owned by the operating system. When marshaling strings as return types, the interop marshaler assumes it must free the memory that the original LPTSTR type pointed to by the function. To prevent the marshaler from automatically reclaiming this memory, the managed GetCommandLine prototype returns an IntPtr type instead of a string. The Marshal.PtrToStringAuto method copies the unmanaged LPSTR type to a managed string object, widening the character format, if required.
[DllImport("kernel32.dll", SetLastError=true, EntryPoint="GetCompressedFileSize")]
//Need to use reflection to obtain pointer to the console output buffer
[DllImport("kernel32.dll", EntryPoint = "GetConsoleOriginalTitleW", CharSet = CharSet.Unicode, SetLastError = true)] 47: GetConsoleTitle
[DllImport("kernel32.dll", EntryPoint = "GetConsoleTitle", CharSet = CharSet.Unicode, SetLastError = true)] 48: GetCPInfo
/// <param name="codePage">The code page 'pointer' to look up.</param> 49: GetDriveType
/// <param name="lpRootPathName">A pointer to a null-terminated string that specifies the root directory and returns information about the disk.A trailing backslash is required. If this parameter is NULL, the function uses the root of the current directory.</param> catch (EntryPointNotFoundException) Otherwise, an unhandled exception of type 'System.EntryPointNotFoundException' is thrown. 52: GetLogicalDrives bufferLength, The maximum size of the buffer pointed to by buffer, in TCHARs. This size does not include the terminating null character. If this parameter is zero, buffer is not used. buffer, A pointer to a buffer that receives a series of null-terminated strings, one for each valid drive in the system, plus with an additional null character. Each string is a device name.
[DllImport("KERNEL32.DLL", CharSet=CharSet::Auto, EntryPoint="GetPrivateProfileInt")]
<DllImport("kernel32.dll", SetLastError:=True, EntryPoint:="GetPrivateProfileIntA")> _
[DllImport("KERNEL32.DLL", CharSet=CharSet::Auto, EntryPoint="GetPrivateProfileString")] 55: GetProcAddress
[DllImport("KERNEL32.DLL", CharSet=CharSet::Ansi, EntryPoint="GetProcAddress", ExactSpelling=true)] This API becomes a lot more interesting in .NET v2.0 because the System.Runtime.InteropServices.Marshal class gains a new API called GetDelegateForFunctionPointer(). This means that you will be able to write code like this:
DllRegisterServerInvoker drs = (DllRegisterServerInvoker) Marshal.GetDelegateForFunctionPointer( fptr, typeof(DllRegisterServerInvoker) );
drs(); // call via a function pointer
[DllImport("kernel32", SetLastError = true, EntryPoint = "GetProcAddress")] 56: GetShortPathName
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, EntryPoint = "GetShortPathNameW", SetLastError = true)] 57: GetStartupInfo
[DllImport("kernel32.dll",EntryPoint="GetStartupInfoW")]
[DllImport("kernel32.dll", SetLastError = true, EntryPoint = "GetStartupInfoA")] 58: GetStringType 59: GetStringTypeEx
<DllImport("kernel32.dll", SetLastError:=true, EntryPoint:="GetSystemDirectoryW", CharSet:=CharSet.Unicode)> _ Cut off search results after 60. Please refine your search. |