本文整理汇总了C#中System.Win32类的典型用法代码示例。如果您正苦于以下问题:C# Win32类的具体用法?C# Win32怎么用?C# Win32使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Win32类属于System命名空间,在下文中一共展示了Win32类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SearchResult
public SearchResult(Win32.UsnEntry usnEntry, UsnJournal journal)
{
UsnEntry = usnEntry;
_journal = journal;
_driveName = journal.RootDirectory.FullName;
}
示例2: DeviceDetectorEventArgs
public DeviceDetectorEventArgs(Win32.DBT changeType, Win32.DBCH_DEVICETYPE? deviceType, object deviceInfo)
{
Cancel = false;
_ChangeType = changeType;
_DeviceInfo = deviceInfo;
_DeviceType = deviceType;
}
示例3: DataBase
public DataBase( Win32.USER32.TBBUTTON tbButton, string buttonText, IntPtr windowHandle, int imageIndex )
{
_TBButton = tbButton;
_ButtonText = buttonText;
_WindowHandle = windowHandle;
_ImageIndex = imageIndex;
}
示例4: AddBubbleEvent
public void AddBubbleEvent(Func<BubbleEventArgs, bool> handleEvent, Win32.WM message)
{
messages.Add((int)message, new BubbleEvent
{
Message = message,
HandleEvent = handleEvent
});
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例9: SetWindowsHookEx
public static extern IntPtr SetWindowsHookEx(Win32.HookType code, HookProc func, IntPtr hInstance, int threadID);
示例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;
}
示例11: GetClipBox
public static extern int GetClipBox(IntPtr hDC, ref Win32.RECT rectBox);
示例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;
}
}
示例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);
}
}
示例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);
}
示例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);
}