本文整理汇总了C#中System.Win32类的典型用法代码示例。如果您正苦于以下问题:C# Win32类的具体用法?C# Win32怎么用?C# Win32使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Win32类属于System命名空间,在下文中一共展示了Win32类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SearchResult
public SearchResult(Win32.UsnEntry usnEntry, UsnJournal journal)
{
UsnEntry = usnEntry;
_journal = journal;
_driveName = journal.RootDirectory.FullName;
}
开发者ID:beaugunderson,项目名称:scrutiny,代码行数:7,代码来源:SearchResult.cs
示例2: DeviceDetectorEventArgs
public DeviceDetectorEventArgs(Win32.DBT changeType, Win32.DBCH_DEVICETYPE? deviceType, object deviceInfo)
{
Cancel = false;
_ChangeType = changeType;
_DeviceInfo = deviceInfo;
_DeviceType = deviceType;
}
开发者ID:vcompestine,项目名称:x360ce,代码行数:7,代码来源:DeviceDetectorEventArgs.cs
示例3: DataBase
public DataBase( Win32.USER32.TBBUTTON tbButton, string buttonText, IntPtr windowHandle, int imageIndex )
{
_TBButton = tbButton;
_ButtonText = buttonText;
_WindowHandle = windowHandle;
_ImageIndex = imageIndex;
}
开发者ID:zaeem,项目名称:FlexCollab,代码行数:7,代码来源:Data.cs
示例4: AddBubbleEvent
public void AddBubbleEvent(Func<BubbleEventArgs, bool> handleEvent, Win32.WM message)
{
messages.Add((int)message, new BubbleEvent
{
Message = message,
HandleEvent = handleEvent
});
}
开发者ID:alexandrebaker,项目名称:Eto,代码行数:8,代码来源:BubbleEventFilter.cs
示例5: WndProcHook
private int WndProcHook(int nCode, IntPtr wParam, ref Win32.Message lParam)
{
if (nCode >= 0)
{
Win32.TranslateMessage(ref lParam); // You may want to remove this line, if you find your not quite getting the right messages through. This is here so that WM_CHAR is correctly called when a key is pressed.
WndProc(ref lParam);
}
return Win32.CallNextHookEx(hHook, nCode, wParam, ref lParam);
}
开发者ID:slicedpan,项目名称:SpaceInvaders,代码行数:10,代码来源:WindowsHook.cs
示例6: DeviceInfo
public DeviceInfo(string deviceId, string manufacturer, string description, Guid classGuid, string classDescription, Win32.DeviceNodeStatus status, uint vid, uint pid, uint rev)
{
_DeviceId = deviceId ?? "";
_Description = description ?? "";
_Manufacturer = manufacturer ?? "";
_ClassGuid = classGuid;
_ClassDescription = classDescription ?? "";
_Status = status;
_VendorId = vid;
_ProductId = pid;
_Revision = rev;
}
开发者ID:XxRaPiDK3LLERxX,项目名称:nucleuscoop,代码行数:12,代码来源:DeviceInfo.cs
示例7: HasTitleBarButtonChangedCallback
static void HasTitleBarButtonChangedCallback(DependencyObject obj,
DependencyPropertyChangedEventArgs e, Win32.WindowStyles button)
{
var window = obj as Window;
if (window == null)
return;
if (!window.IsLoaded)
window.Loaded += s_loadedHandler;
else
InternalSetStyleFlag(window, button, (bool)e.NewValue);
}
开发者ID:CarlosX,项目名称:Kamilla,代码行数:12,代码来源:WindowBehavior.cs
示例8: DebugProcess
public DebugProcess(Debuggee dbg, Win32.CREATE_PROCESS_DEBUG_INFO info, uint id, uint threadId)
{
this.Debuggee = dbg;
Handle = info.hProcess;
Id = id == 0 ? API.GetProcessId(Handle) : id;
var moduleFile = APIIntermediate.GetModulePath(Handle, info.lpBaseOfImage, info.hFile);
// Deduce main module
MainModule = new DebugProcessModule(info.lpBaseOfImage, moduleFile, ExecutableMetaInfo.ExtractFrom(moduleFile));
RegModule(MainModule);
// Create main thread
MainThread = new DebugThread(this,
info.hThread,
threadId == 0 ? API.GetThreadId(info.hThread) : threadId,
info.lpStartAddress,
info.lpThreadLocalBase);
RegThread(MainThread);
}
开发者ID:aBothe,项目名称:DDebugger,代码行数:20,代码来源:DebugProcess.cs
示例9: SetWindowsHookEx
public static extern IntPtr SetWindowsHookEx(Win32.HookType code, HookProc func, IntPtr hInstance, int threadID);
开发者ID:JackWangCUMT,项目名称:rdlc.report.engine,代码行数:1,代码来源:NativeMethods.cs
示例10: GetDeviceNodeStatus
static bool GetDeviceNodeStatus(UInt32 dnDevInst, IntPtr hMachine, out Win32.DeviceNodeStatus status)
{
// c:\Program Files\Microsoft SDKs\Windows\v7.1\Include\cfg.h
uint Status;
uint ProblemNumber;
bool success = false;
// http://msdn.microsoft.com/en-gb/library/windows/hardware/ff538517%28v=vs.85%29.aspx
var cr = CM_Get_DevNode_Status_Ex(out Status, out ProblemNumber, dnDevInst, 0, hMachine);
status = 0;
if (cr == CR.CR_SUCCESS)
{
status = (Win32.DeviceNodeStatus)Status;
success = true;
}
return success;
}
开发者ID:huntintiger1004,项目名称:nucleuscoop,代码行数:16,代码来源:DeviceDetector.cs
示例11: GetClipBox
public static extern int GetClipBox(IntPtr hDC, ref Win32.RECT rectBox);
开发者ID:tropology,项目名称:ceptr,代码行数:1,代码来源:Gdi32.cs
示例12: SetFlag
/// <summary>
/// Helper function to set or clear a bit in the flags field.
/// </summary>
/// <param name="flag">The Flag bit to set or clear.</param>
/// <param name="value">True to set, false to clear the bit in the flags field.</param>
private void SetFlag( Win32.NativeMethods.TASKDIALOG_FLAGS flag, bool value )
{
if ( value )
{
this.flags |= flag;
}
else
{
this.flags &= ~flag;
}
}
开发者ID:pvginkel,项目名称:SystemEx,代码行数:16,代码来源:TaskDialog.cs
示例13: DirectionResize
public void DirectionResize(Win32.ResizeDirection direction)
{
int _direction = -1;
switch (direction)
{
case Win32.ResizeDirection.Left:
_direction = Win32.HTLEFT;
break;
case Win32.ResizeDirection.TopLeft:
_direction = Win32.HTTOPLEFT;
break;
case Win32.ResizeDirection.Top:
_direction = Win32.HTTOP;
break;
case Win32.ResizeDirection.TopRight:
_direction = Win32.HTTOPRIGHT;
break;
case Win32.ResizeDirection.Right:
_direction = Win32.HTRIGHT;
break;
case Win32.ResizeDirection.BottomRight:
_direction = Win32.HTBOTTOMRIGHT;
break;
case Win32.ResizeDirection.Bottom:
_direction = Win32.HTBOTTOM;
break;
case Win32.ResizeDirection.BottomLeft:
_direction = Win32.HTBOTTOMLEFT;
break;
}
if (_direction != -1)
{
Win32.ReleaseCapture();
Win32.SendMessage(this.Handle, Win32.WM_NCLBUTTONDOWN, _direction, 0);
}
}
开发者ID:autarchprinceps,项目名称:Chiave,代码行数:38,代码来源:MainWindow.cs
示例14: OnWM_MOUSEMOVE
internal void OnWM_MOUSEMOVE(Win32.POINT screenPos)
{
// Convert the mouse position to screen coordinates
User32.ScreenToClient(this.Handle, ref screenPos);
OnProcessMouseMove(screenPos.x, screenPos.y);
}
开发者ID:uvbs,项目名称:Holodeck,代码行数:7,代码来源:MenuControl.cs
示例15: hsServer_ClientStyleChanged
void hsServer_ClientStyleChanged(Win32.WindowShowStyle style)
{
MethodInvoker action = delegate
{
gbClient.Enabled = true;
if (style == Win32.WindowShowStyle.Hide)
cbShowHideClient.Checked = false;
else if (style == Win32.WindowShowStyle.Show)
cbShowHideClient.Checked = true;
};
this.Invoke(action);
}
开发者ID:EgyFalseX,项目名称:Winform,代码行数:12,代码来源:MainFrm.cs
示例16: GetUsnJournalState
/// <summary>
/// GetUsnJournalState() gets the current state of the USN Journal if it is active.
/// </summary>
/// <param name="usnJournalState">
/// Reference to usn journal data object filled with the current USN Journal state.
/// </param>
/// <returns>
/// USN_JOURNAL_SUCCESS GetUsnJournalState() function succeeded.
/// VOLUME_NOT_NTFS volume is not an NTFS volume.
/// INVALID_HANDLE_VALUE NtfsUsnJournal object failed initialization.
/// USN_JOURNAL_NOT_ACTIVE usn journal is not active on volume.
/// ERROR_ACCESS_DENIED accessing the usn journal requires admin rights, see remarks.
/// ERROR_INVALID_FUNCTION error generated by DeviceIoControl() call.
/// ERROR_FILE_NOT_FOUND error generated by DeviceIoControl() call.
/// ERROR_PATH_NOT_FOUND error generated by DeviceIoControl() call.
/// ERROR_TOO_MANY_OPEN_FILES error generated by DeviceIoControl() call.
/// ERROR_INVALID_HANDLE error generated by DeviceIoControl() call.
/// ERROR_INVALID_DATA error generated by DeviceIoControl() call.
/// ERROR_NOT_SUPPORTED error generated by DeviceIoControl() call.
/// ERROR_INVALID_PARAMETER error generated by DeviceIoControl() call.
/// ERROR_JOURNAL_DELETE_IN_PROGRESS usn journal delete is in progress.
/// ERROR_INVALID_USER_BUFFER error generated by DeviceIoControl() call.
/// USN_JOURNAL_ERROR unspecified usn journal error.
/// </returns>
/// <remarks>
/// If function returns ERROR_ACCESS_DENIED you need to run application as an Administrator.
/// </remarks>
public UsnJournalReturnCode GetUsnJournalState(ref Win32.USN_JOURNAL_DATA usnJournalState)
{
UsnJournalReturnCode returnCode = UsnJournalReturnCode.VOLUME_NOT_NTFS;
if (IsNtfsVolume)
{
if (_usnJournalRootHandle.ToInt32() != Win32.INVALID_HANDLE_VALUE)
{
returnCode = QueryUsnJournal(ref usnJournalState);
}
else
{
returnCode = UsnJournalReturnCode.INVALID_HANDLE_VALUE;
}
}
return returnCode;
}
开发者ID:beaugunderson,项目名称:scrutiny,代码行数:45,代码来源:UsnJournal.cs
示例17: IsUsnJournalValid
/// <summary>
/// Rests to see if there is a USN Journal on this volume and if there is
/// determines whether any journal entries have been lost.
/// </summary>
/// <returns>true if the USN Journal is active and if the JournalId's are the same
/// and if all the usn journal entries expected by the previous state are available
/// from the current state.
/// false if not</returns>
public bool IsUsnJournalValid(Win32.USN_JOURNAL_DATA usnJournalPreviousState)
{
bool bRtnCode = false;
if (IsNtfsVolume)
{
if (_usnJournalRootHandle.ToInt32() != Win32.INVALID_HANDLE_VALUE)
{
var usnJournalState = new Win32.USN_JOURNAL_DATA();
var usnError = QueryUsnJournal(ref usnJournalState);
if (usnError == UsnJournalReturnCode.USN_JOURNAL_SUCCESS)
{
if (usnJournalPreviousState.UsnJournalID == usnJournalState.UsnJournalID)
{
if (usnJournalPreviousState.NextUsn >= usnJournalState.NextUsn)
{
bRtnCode = true;
}
}
}
}
}
return bRtnCode;
}
开发者ID:beaugunderson,项目名称:scrutiny,代码行数:33,代码来源:UsnJournal.cs
示例18: ProcessInterceptedMessage
protected bool ProcessInterceptedMessage(ref Win32.MSG msg)
{
bool eat = false;
switch(msg.message)
{
case (int)Win32.Msgs.WM_LBUTTONDOWN:
case (int)Win32.Msgs.WM_MBUTTONDOWN:
case (int)Win32.Msgs.WM_RBUTTONDOWN:
case (int)Win32.Msgs.WM_XBUTTONDOWN:
case (int)Win32.Msgs.WM_NCLBUTTONDOWN:
case (int)Win32.Msgs.WM_NCMBUTTONDOWN:
case (int)Win32.Msgs.WM_NCRBUTTONDOWN:
// Mouse clicks cause the end of simulated focus unless they are
// inside the client area of the menu control itself
Point pt = new Point( (int)((uint)msg.lParam & 0x0000FFFFU),
(int)(((uint)msg.lParam & 0xFFFF0000U) >> 16));
if (!this.ClientRectangle.Contains(pt))
SimulateReturnFocus();
break;
case (int)Win32.Msgs.WM_KEYDOWN:
// Find up/down state of shift and control keys
ushort shiftKey = User32.GetKeyState((int)Win32.VirtualKeys.VK_SHIFT);
ushort controlKey = User32.GetKeyState((int)Win32.VirtualKeys.VK_CONTROL);
// Basic code we are looking for is the key pressed...
int basecode = (int)msg.wParam;
int code = basecode;
// ...plus the modifier for SHIFT...
if (((int)shiftKey & 0x00008000) != 0)
code += 0x00010000;
// ...plus the modifier for CONTROL
if (((int)controlKey & 0x00008000) != 0)
code += 0x00020000;
if (code == (int)Win32.VirtualKeys.VK_ESCAPE)
{
// Is an item being tracked
if (_trackItem != -1)
{
// Is it also showing a submenu
if (_popupMenu == null)
{
// Unselect the current item
_trackItem = SwitchTrackingItem(_trackItem, -1);
}
}
SimulateReturnFocus();
// Prevent intended destination getting message
eat = true;
}
else if (code == (int)Win32.VirtualKeys.VK_LEFT)
{
if (_direction == Direction.Horizontal)
ProcessMoveLeft(false);
if (_selected)
_ignoreMouseMove = true;
// Prevent intended destination getting message
eat = true;
}
else if (code == (int)Win32.VirtualKeys.VK_RIGHT)
{
if (_direction == Direction.Horizontal)
ProcessMoveRight(false);
else
ProcessMoveDown();
if (_selected)
_ignoreMouseMove = true;
// Prevent intended destination getting message
eat = true;
}
else if (code == (int)Win32.VirtualKeys.VK_RETURN)
{
ProcessEnter();
// Prevent intended destination getting message
eat = true;
}
else if (code == (int)Win32.VirtualKeys.VK_DOWN)
{
if (_direction == Direction.Horizontal)
ProcessMoveDown();
else
ProcessMoveRight(false);
// Prevent intended destination getting message
eat = true;
}
else if (code == (int)Win32.VirtualKeys.VK_UP)
{
//.........这里部分代码省略.........
开发者ID:uvbs,项目名称:Holodeck,代码行数:101,代码来源:MenuControl.cs
示例19: SetWindowFromInfo
private static void SetWindowFromInfo(IntPtr hwnd, Win32.WINDOWINFO info)
{
int x1 = info.rcWindow.left;
int y1 = info.rcWindow.top;
int x2 = info.rcWindow.right - x1;
int y2 = info.rcWindow.bottom - y1;
//Win32.SetWindowLong(hwnd, Win32.GWL_STYLE, (int)info.dwStyle);
//Win32.SetWindowLong(hwnd, Win32.GWL_EXSTYLE, (int)info.dwExStyle);
Win32.SetWindowPos(hwnd, Win32.HWND_NOTOPMOST, x1, y1, x2, y2, Win32.SWP_SHOWWINDOW);
}
开发者ID:schultzisaiah,项目名称:just-gestures,代码行数:10,代码来源:WindowOptions.cs
示例20: ReadRegistryString
private static string ReadRegistryString(Win32.RegistryKey key, string path, string registryValue)
{
RegistryKey subKey = key.OpenSubKey(path, false);
object oValue = subKey?.GetValue(registryValue);
if (oValue != null && subKey.GetValueKind(registryValue) == RegistryValueKind.String)
{
return (string)oValue;
}
return null;
}
开发者ID:nikson,项目名称:msbuild,代码行数:12,代码来源:Util.cs
注:本文中的System.Win32类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论