Desktop Functions: Smart Device Functions:
|
Search Results for "DISPLAY" in [All]wininetAn application that needs to display multiline text information sent by an FTP server can use InternetGetLastResponseInfo to retrieve the text. user32
static extern DISP_CHANGE ChangeDisplaySettingsEx(string lpszDeviceName, ref DEVMODE lpDevMode, IntPtr hwnd, ChangeDisplaySettingsFlags dwflags, IntPtr lParam);
Private Shared Function ChangeDisplaySettingsEx(ByVal lpszDeviceName As String, ByRef lpDevMode As DEVMODE, ByVal hwnd As IntPtr, ByVal dwflags As UInteger, ByVal lParam As IntPtr) As DISP_CHANGE See also ChangeDisplaySettings
DISPLAY_DEVICE d = new DISPLAY_DEVICE();
int deviceID=1; // This is only for my device setting. Go through the whole EnumDisplayDevices to find your device
EnumDisplayDevices(null,deviceID, ref d, 0); //
EnumDisplaySettings(d.DeviceName, 0, ref dm);
ChangeDisplaySettingsEx(d.DeviceName, ref dm, IntPtr.Zero, CDS_UPDATEREGISTRY, IntPtr.Zero);
/// <param name="lpWindowName">Pointer to a null-terminated string that specifies the window name. If the window style specifies a title bar, the window title pointed to by lpWindowName is displayed in the title bar. When using CreateWindow to create controls, such as buttons, check boxes, and static controls, use lpWindowName to specify the text of the control. When creating a static control with the SS_ICON style, use lpWindowName to specify the icon name or identifier. To specify an identifier, use the syntax "#num". </param>
''' <param name="lpWindowName">Pointer to a null-terminated string that specifies the window name. If the window style specifies a title bar, the window title pointed to by lpWindowName is displayed in the title bar. When using CreateWindow to create controls, such as buttons, check boxes, and static controls, use lpWindowName to specify the text of the control. When creating a static control with the SS_ICON style, use lpWindowName to specify the icon name or identifier. To specify an identifier, use the syntax "#num". </param>
///<Summary>Displays the window.</Summary>
'''<Summary>Displays the window.</Summary>
//Displays the id and name of the all the different data formats currently in the clipboard.
static extern bool EnumDisplayDevices(string lpDevice, uint iDevNum, ref DISPLAY_DEVICE lpDisplayDevice, uint dwFlags);
<DllImport("user32.dll", EntryPoint:="EnumDisplayDevices", CharSet:=CharSet.Auto, CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function EnumDisplayDevices(ByVal lpDevice As String, ByVal iDevNum As UInteger, ByRef lpDisplayDevice As DISPLAY_DEVICE, ByVal dwFlags As UInteger) As Integer
DISPLAY_DEVICE d=new DISPLAY_DEVICE();
for (uint id=0; EnumDisplayDevices(null, id, ref d, 0); id++) {
Dim dispDev1 As New DISPLAY_DEVICE
While (EnumDisplayDevices(vbNullString, i, dispDev1, &H0))
EnumDisplayDevices(vbNullString, i, dispDev1, &H0)
EnumDisplayDevices(dispDev1.DeviceName, 0, dispDev1, &H1)
static extern bool EnumDisplayMonitors(IntPtr hdc, IntPtr lprcClip,
Private Shared Function EnumDisplayMonitors(ByVal hdc As IntPtr, ByVal lprcClip As IntPtr, ByVal lpfnEnum As EnumMonitorsDelegate, ByVal dwData As IntPtr) As Boolean
/// The struct that contains the display information
public class DisplayInfo
/// Collection of display information
public class DisplayInfoCollection : List<DisplayInfo>
/// Returns the number of Displays using the Win32 functions
/// <returns>collection of Display Info</returns>
public DisplayInfoCollection GetDisplays()
DisplayInfoCollection col = new DisplayInfoCollection();
EnumDisplayMonitors( IntPtr.Zero, IntPtr.Zero,
DisplayInfo di = new DisplayInfo(); Use System.Windows.Forms.Screen.AllScreens to get an array of all displays on the system.
static extern bool EnumDisplaySettingsEx(string lpszDeviceName, int iModeNum, ref DEVMODE lpDevMode, uint dwFlags);
Private Shared Function EnumDisplaySettingsEx(ByVal lpszDeviceName As String, ByVal iModeNum As UInteger, ByRef lpDevMode As DEVMODE, ByVal dwFlags As UInteger) As Boolean See also: EnumDisplaySettings
static extern bool EnumDisplaySettingsEx(string lpszDeviceName, uint iModeNum, out DEVMODE lpDevMode, uint dwFlags);
Private Shared Function EnumDisplaySettingsEx(ByVal lpszDeviceName As String, ByVal iModeNum As UInteger, ByRef lpDevMode As DEVMODE, ByVal dwFlags As UInteger) As Boolean See also: EnumDisplaySettings
//Displays the id and name of the all the different data formats currently in the clipboard. 13: GetDC Retrieves a handle to a display device context (DC) for the client area of a specified window or for the entire screen. Unless the display DC belongs to a window class, the ReleaseDC function must be called to release the DC after painting. Also, ReleaseDC must be called from the same thread that called GetDCEx. The number of DCs is limited only by available memory. Unless the display DC belongs to a window class, the ReleaseDC function must be called to release the DC after painting. Also, ReleaseDC must be called from the same thread that called GetDCEx. The number of "DCs" is limited only by available memory. 14: GetDCEx Retrieves a handle to a display device context (DC) for the client area of a specified window or for the entire screen. Unless the display DC belongs to a window class, the ReleaseDC function must be called to release the DC after painting. Also, ReleaseDC must be called from the same thread that called GetDCEx. The number of DCs is limited only by available memory. Unless the display DC belongs to a window class, the ReleaseDC function must be called to release the DC after painting. Also, ReleaseDC must be called from the same thread that called GetDCEx. The number of "DCs" is limited only by available memory. 15: GetMonitorInfo internal static extern bool EnumDisplayMonitors(IntPtr hdc, IntPtr lprcClip, MonitorEnumProc lpfnEnum, IntPtr dwData);
EnumDisplayMonitors(IntPtr.Zero, IntPtr.Zero, MonitorEnumCallBack, IntPtr.Zero);
public const int GMMP_USE_DISPLAY_POINTS = 1;
uint mode = GMMP_USE_DISPLAY_POINTS; 17: GetSystemMetrics * System metrics may vary from display to display. Most values are returned in number of pixels, all others are flag or boolean values. * GetSystemMetrics(SM_CMONITORS) counts only display monitors. This is different from EnumDisplayMonitors, which enumerates display monitors and also non-display pseudo-monitors. The following example creates a new ListView control, and displays each member of the enumerator and it's return value. To use this example, paste it into the code (not the deigner code) file of a blank form. (ie, Form1.cs), if you have AIPCC installed you wont need to use the WindowsAPI class, instead it will be imported fron the AIP class library. 18: IsWindow
/// WS_VISIBLE[0x10000000L] is set, the window is displayed and subsequent drawing into it is displayed as long as the
/// not be displayed if the window is obscured by other windows or is clipped by its parent window. 19: MessageBox The language for the text displayed in the message box button(s). Specifying a value of zero (0) indicates to display the button text in the default system language. If this parameter is MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), the current language associated with the calling thread is used.
private Shared Function DisplayMessageBox( _
Public Function DisplayMessageBox( _
DisplayMessageBox = MessageBoxTimeOut(hWnd, Message, Caption, MessageBoxOptions, 0, TimeOutMilliseconds) 20: MONITORINFO The MONITORINFOEX structure contains information about a display monitor. The MONITORINFOEX structure is a superset of the MONITORINFO structure. The MONITORINFOEX structure adds a string member to contain a name for the display monitor.
/// The MONITORINFOEX structure contains information about a display monitor.
/// for the display monitor.
/// A RECT structure that specifies the display monitor rectangle, expressed in virtual-screen coordinates.
/// Note that if the monitor is not the primary display monitor, some of the rectangle's coordinates may be negative values.
/// A RECT structure that specifies the work area rectangle of the display monitor that can be used by applications,
/// Note that if the monitor is not the primary display monitor, some of the rectangle's coordinates may be negative values.
/// The attributes of the display monitor.
/// A string that specifies the device name of the monitor being used. Most applications have no use for a display monitor name, 21: MONITORINFOEX The MONITORINFOEX structure contains information about a display monitor. The MONITORINFOEX structure is a superset of the MONITORINFO structure. The MONITORINFOEX structure adds a string member to contain a name for the display monitor.
/// The MONITORINFOEX structure contains information about a display monitor.
/// for the display monitor.
/// A RECT structure that specifies the display monitor rectangle, expressed in virtual-screen coordinates.
/// Note that if the monitor is not the primary display monitor, some of the rectangle's coordinates may be negative values.
/// A RECT structure that specifies the work area rectangle of the display monitor that can be used by applications,
/// Note that if the monitor is not the primary display monitor, some of the rectangle's coordinates may be negative values.
/// The attributes of the display monitor.
/// A string that specifies the device name of the monitor being used. Most applications have no use for a display monitor name,
static extern bool SetWindowDisplayAffinity(IntPtr hwnd, DisplayAffinity affinity);
Declare Function SetWindowDisplayAffinity Lib "user32.dll" (hwnd As IntPtr, affinity As DisplayAffinity) As Boolean
enum DisplayAffinity : uint 25: SetWindowPos
/// <term>SWP_SHOWWINDOW (0x0040)</term><description>Displays the window.</description>
/// Displays the window. 26: SetWindowText
/// 0x09). Tab characters are displayed as vertical bar(|) characters.<br />For an example go to 27: ShowCursor The ShowCursor function displays or hides the cursor.
[in] Specifies whether the internal display counter is to be incremented or decremented. If bShow is TRUE, the display count is incremented by one. If bShow is FALSE, the display count is decremented by one. 28: ShowScrollBar In the TextBox's Change event handler, use the PictureBox's TextHeight function to see how tall the text is. If the text is too big to fit in the TextBox, we need to display the scrollbar. If the need for the scrollbar has changed, use the ShowScrollBar API function to show or hide it. 30: WinHelpCommands
///<Summary>Display topic in ulTopic</Summary>
///<Summary>Display index</Summary>
///<Summary>Display help on using help</Summary>
///<Summary>Display topic for keyword in offabData</Summary>
'''<Summary>Display topic in ulTopic</Summary>
'''<Summary>Display index</Summary>
'''<Summary>Display help on using help</Summary>
'''<Summary>Display topic for keyword in offabData</Summary> misc31: Comments Discovered DISPLAY_DEVICE struct defined with CharSet=CharSet.Ansi. Works much better on Win7 with CharSet=CharSet.Auto. Suspect this is also true of a number of other structs and Win7 predecessors. 32: Helpful Tools
shell32Consider a Winform application with a OpenFileDialog that helps pick some file. This is then passed to the ExtractAssociatedIcon method to get the icon and display in a picture box. 34: ITaskbarList2
35: ITaskbarList3
/// Activates an item on the taskbar. The window is not actually activated; the window's item on the taskbar is merely displayed as active.
/// <param name="hWnd">A handle to the window on the taskbar to be displayed as active.</param>
/// Displays or updates a progress bar hosted in a taskbar button to show the specific percentage
/// Sets the type and state of the progress indicator displayed on a taskbar button.
/// shown. This window's associated taskbar button will display the progress bar.</param>
/// Informs the taskbar that a new tab or document thumbnail has been provided for display in an
/// order in which they are displayed left to right, will be their permanent order.</param>
/// Specifies or updates the text of the tooltip that is displayed when the mouse pointer rests on an
/// <param name="hWnd">The handle to the window whose thumbnail displays the tooltip. This handle must
/// <param name="pszTip">The pointer to the text to be displayed in the tooltip. This value can be NULL,
/// Selects a portion of a window's client area to display as that window's thumbnail in the taskbar.
/// in place and return to the default display of the thumbnail, set this parameter to NULL.</param> 36: SHBindToParent
GetDisplayName (
MessageBox.Show ( "GetDisplayName(), PIDL count > 1" );
ShellFolder.GetDisplayNameOf(
string GetParsableDisplayName ( IntPtr lpifq )
GetDisplayName (
void ParseDisplayName(
String pszDisplayName,
void GetDisplayNameOf(
private uint BIF_BROWSEINCLUDEURLS = 0x0080; // Allow URLs to be displayed or entered. (Requires BIF_USENEWUI)
private uint BIF_SHAREABLE = 0x8000; // sharable resources displayed (remote shares, requires BIF_USENEWUI)
// Note that the BROWSEINFO object's pszDisplayName only gives you the name of the folder.
public string pszDisplayName; 38: ShellAbout
39: ShellExecuteEx With the above code (VB), I have had problems on Win 7 x64. By changing the build type to x86 in the advanced compile options, the code works... (Specifically, on Win7 x64, ShellExecuteEx returned NO error, but the file's property page was not displayed)
// No dialog box confirming the deletion of the objects will be displayed.
// No dialog box indicating the progress will be displayed. 41: SHGetFileInfo
public string szDisplayName; For a whole winform sample of Displayname see http://Dzaebel.NET/ShGetFileInfo.htm
szDisplayName="";
public string szDisplayName;
/// <summary>get display name</summary>
DisplayName = 0x000000200,
public string szDisplayName; Please note also that it returns a 32x32 icon with the default (lowest) resolution, which is resized by Windows if you display it as 16x16, the result being that it looks horrible. 42: SHGetImageList The image size is normally 32x32 pixels. However, if the Use large icons option is selected from the Effects section of the Appearance tab in Display Properties, the image is 48x48 pixels.
DISPLAYATTRMASK = &HFC000
DISPLAYNAME = &H200
NORMALDISPLAY = 0
<System.Runtime.InteropServices.DllImportAttribute("shell32.dll", EntryPoint:="SHParseDisplayName")> _
Private Shared Function SHParseDisplayName( _
displayType As SIGDN) As String
SHGetNameFromIDList(pidl, displayType, ptr)
SHParseDisplayName(parseName, IntPtr.Zero, ptr, 0, 0)
'Example = Get Display Name for 'My Computer'
Public Function ComputerDisplayName() As String
Dim displayName As String = GetNameFromPIDL(ptrLoc, SIGDN.NORMALDISPLAY)
Return displayName
Optional ByRef DisplayName As String = "", _
DisplayName = shi.Name
DisplayName = fit2.Name
DisplayName = f2.Self.Name
DisplayName = folder2.Title
public static extern void SHParseDisplayName([MarshalAs(UnmanagedType.LPWStr)] string name, IntPtr bindingContext, [Out] out IntPtr pidl, uint sfgaoIn, [Out] out uint psfgaoOut);
SHParseDisplayName(folderPath, IntPtr.Zero, out nativeFolder, 0, out psfgaoOut);
SHParseDisplayName(Path.Combine(folderPath, file), IntPtr.Zero, out nativeFile, 0, out psfgaoOut);
If SafeNativeMethods.SHParseDisplayName(folderPath, IntPtr.Zero, pidlFolder, 0, 0) = 0 Then
If SafeNativeMethods.SHParseDisplayName(Path.Combine(_folderPath, fileName), IntPtr.Zero, pidl, 0, 0) = 0 Then
Public Shared Function SHParseDisplayName(<MarshalAs(UnmanagedType.LPWStr)> ByVal pszName As String, ByVal pbc As IntPtr, ByRef ppidl As IntPtr, ByVal sfgaoIn As UInteger, ByRef psfgaoOut As UInteger) As Integer public static extern void SHParseDisplayName( [MarshalAs(UnmanagedType.LPWStr)] string name, IntPtr bindingContext,[Out()] out IntPtr pidl, uint sfgaoIn, [Out()] out uint psfgaoOut); Private Shared Sub SHParseDisplayName(<MarshalAs(UnmanagedType.LPWStr)> ByVal name As String, ByVal bindingContext As IntPtr, <Out()> ByRef pidl As IntPtr, ByVal sfgaoIn As UInt32, <Out()> ByRef sfgaoOut As UInt32)
static extern TODO SHParseDisplayName(TODO);
Declare Function SHParseDisplayName Lib "shell32.dll" (ByVal pszName As Long, Optional ByVal pbc As Long, Optional ByRef ppidl As Long, Optional ByVal sfgaoIn As Long, Optional ByRef psfgaoOut As Long) As Long
/// A screen saver is displayed, the machine is locked, setupapiDIBCI_NODISPLAYCLASS // Exclude a class if it has the NoDisplayClass value entry in its registry key.
const uint DIBCI_NODISPLAYCLASS = 0x00000002; hid
DisplayException( MODULE_NAME, ex ); comdlg3251: GetSaveFileName
netapi32
extern static uint NetQueryDisplayInformation([MarshalAs(UnmanagedType.LPWStr)]
Declare Function NetQueryDisplayInformation Lib "Netapi32.dll"
Declare Function NetQueryDisplayInformation Lib "Netapi32.dll" _ lret = NetQueryDisplayInformation(strDomain, 3, lindex, 100, MAX_PREFERRED_LENGTH, out lread , out x);
NET_DISPLAY_USER usr = new NET_DISPLAY_USER();
int StructSize = Marshal.SizeOf(typeof(NET_DISPLAY_USER));
lret = NetQueryDisplayInformation(DomainController, 1, lindex, reqRecs, MAX_PREFERRED_LENGTH, out lread, out UsrBuf);
usr = (NET_DISPLAY_USER)Marshal.PtrToStructure(item, typeof(NET_DISPLAY_USER));
public struct NET_DISPLAY_USER
public struct NET_DISPLAY_GROUP
public struct NET_DISPLAY_MACHINE
[DllImport("Netapi32.dll")] static extern int NetQueryDisplayInformation([MarshalAs(UnmanagedType.LPWStr)] string serverName,
NET_DISPLAY_GROUP grp = new NET_DISPLAY_GROUP ();
NET_DISPLAY_USER usr = new NET_DISPLAY_USER();
lret = NetQueryDisplayInformation(strDomain, 3, lindex, 1, 1024, out lread , out x);
grp = (NET_DISPLAY_GROUP)Marshal.PtrToStructure (x, typeof(NET_DISPLAY_GROUP));
lret = NetQueryDisplayInformation(strDomain, 1, lindex, 1, 1024, out lread , out x);
usr = (NET_DISPLAY_USER)Marshal.PtrToStructure(x, typeof(NET_DISPLAY_USER));
NET_DISPLAY_MACHINE mac = new NET_DISPLAY_MACHINE ();
lret = NetQueryDisplayInformation(strDomain, 2, lindex, 1, 1024, out lread , out x);
mac = (NET_DISPLAY_MACHINE) Marshal.PtrToStructure(x,typeof(NET_DISPLAY_MACHINE)); wtsapi3253: WTSSendMessage
54: WTS_INFO_CLASS
WTSClientDisplay = 15,
WTSClientDisplay = 15 advapi3256: CreateService
string lpDisplayName,
ByVal displayName As String, ByVal desiredAccess As Int32, ByVal serviceType As Int32, _
Dim displayName As String = "AAATestDisplayName"
Dim serviceHandle As IntPtr = CreateService(scHandle, serviceName, displayName, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, _
internal string pDisplayName;
static extern bool LookupPrivilegeDisplayName(
System.Text.StringBuilder displayName, // out
ref uint cbDisplayName,
Declare Function LookupPrivilegeDisplayName Lib "advapi32.dll" (TODO) As TODO This is one of those "call twice" functions, so this error is just daily life. When it returns with this error, the byte count (cbDisplayName) will be set to what you need. Call EnsureCapacity on your StringBuilder and go round again.
// Use the service name and *NOT* the display name.
string serviceName = "Dnscache"; // Display name is "DNS Client"
// Use the service name and *NOT* the display name.
string serviceName = "Dnscache"; // Display name is "DNS Client" Cut off search results after 60. Please refine your search. |