Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "SID" in [All]

dbghelp

.

static extern bool MiniDumpWriteDump(IntPtr hProcess, uint ProcessId, IntPtr hFile, int DumpType, ref MINIDUMP_EXCEPTION_INFORMATION ExceptionParam, IntPtr UserStreamParam, IntPtr CallbackParam);

.

static extern bool MiniDumpWriteDump(IntPtr hProcess, uint ProcessId, IntPtr hFile, int DumpType, ref MINIDUMP_EXCEPTION_INFORMATION ExceptionParam,IntPtr UserStreamParam, IntPtr CallbackParam);

.

static extern uint GetCurrentProcessId();

.

    MiniDumpWriteDump( GetCurrentProcess(), GetCurrentProcessId(), file.SafeFileHandle.DangerousGetHandle(), MiniDumpWithFullMemory, ref info, IntPtr.Zero, IntPtr.Zero );

winmm

.

The winmm dll may not execute properly on 64-bit systems. Consequently, the StructLayout must be Sequential, with CharSet = Ansi, and Pack = 4. This particular type has some special layout considerations (the c union keyword) which typically means developers would use the explicit layout. However, the explicit layout breaks down on 64-bit systems for any type with an IntPtr in the type. Consequently, the C# types have been redesigned to use Sequential layout so that they will automatically adjust to 64-bit systems. This means private fields with public properties which perform the gunky work of making it look like there is a union.

.

The winmm dll may not execute properly on 64-bit systems. Consequently, the StructLayout must be Sequential, with CharSet = Ansi, and Pack = 4. This particular type has some special layout considerations (the c union keyword) which typically means developers would use the explicit layout. However, the explicit layout breaks down on 64-bit systems for any type with an IntPtr in the type. Consequently, the C# types have been redesigned to use Sequential layout so that they will automatically adjust to 64-bit systems. This means private fields with public properties which perform the gunky work of making it look like there is a union.

xpsprint

.

TÇ݄šò'‘Šàoün4ªÚ—B²I´ÛȆ ž’ŒZ!l©7Jq¾'¡ l¤j Ö&˜rsiDM(ÅjlŠö–”Øes›«²ˆ¼‚eœ¶AD¯{gõ¸œ›I¦õ/ÿ†šàËè* & 3„ךv%œBO*1ækj„M‚&FÑ—{¬ñÕÒ|ÉÆIÏnagâ¶Û:M‹™PÄ/ZJ<ЂG^„Ôʙ±ö3ÆÊ;µP™;<hNƒ=Á{Ë9Tƒ„ôÌjÛl{¼#:bs½ËU2†G©1±æó5Jêߺ*ýcXŒhLýÐï€*UÁš;廀wñdAK>§OODñ³føžá•Ä؎íåß!°èøï2ó?­”Jœ3ã ·¥ ¸×æø@–tâD]"ÎïlˆSÉõXɸ26ŽkéáªiQdæ[

getuname

.

Inside we both know what's been going on

ncrypt

.

°‡â‰dμÐæºÝÕý nqwœ#6§™JÜ ÙÈ Á&ɵB̑­…lÅéŒA³ë¶9–Ìb…7ÿãŽ}×:qÙ¿µ»bS½AFòŒ'Ó 3$v·¢˜Á«mØnÚ0‹ÓzcF¾—ß2VÜYõöv&"–œ–ó(Èn  «uQhþo•¶9gæbp…ñËJ°úùãiŸ+Œ¦¬²JlQ¨¿Ó¬ ÉHs[¡“Gh„ÄHˆT6ѵ66­Sid¢¤4üQÿh¡Œ0q\–ë##z2[ãòxv¶Y®´ Ûoûµ¬ÇÈû,•½3‰Ö.<)LÉlšKÂνºQ:8͕|wÄI$ÎyOžæ÷¥­á Mšc p%ڔòɍî™×tUZíå|ž›­[÷ ëFL:Š«¨£b…v³5Z§I}öÒ(Zª.¶ tw![!žrkí_ÉjÏÄH—oýÀ÷â5òŽ\ñjâ–Îm•Ž2Ö¨¯ÑŒïJ²¸o™Ýè„Æ,8íqW;›áGÀtVÚÄNPGãùy„Ɵ«G›àSkBÍW

msi

.

static extern int MsiDatabaseCommit(IntPtr hDatabase);

.

Declare Function MsiDatabaseCommit Lib "msi.dll" (TODO) As TODO

.
Documentation
[MsiDatabaseCommit] on MSDN
.

static extern int MsiDatabaseOpenView(IntPtr hDatabase, [MarshalAs(UnmanagedType.LPWStr)] string szQuery, out IntPtr phView);

.

Declare Function MsiDatabaseOpenView Lib "msi.dll" (TODO) As TODO

.
Documentation
[MsiDatabaseOpenView] on MSDN
.

static extern int MsiDoAction(IntPtr hInstall, string szAction);

.
Documentation
[MsiDoAction] on MSDN
.

            string szUserSid,

.

            StringBuilder szTargetUserSid,

.

            ref uint pcchTargetUserSid);

.

            StringBuilder szTargetUserSid = new StringBuilder(300);

.

            uint pcchTargetUserSid = 300;

.

                    null, // User SID. null needs if context == MachineContext only (4), it means to use only per-machine installations

.

                    szTargetUserSid, // User SID. Indicate owner of this installation. (Here is null)

.

                    ref pcchTargetUserSid // Length of user SID

.

        string szUserSid,

.

        string szSid,

.

        ref uint pccSid)

.

        string szSid = new string(new char[300]);

.

        uint pccSid = 300;

.

        uint res = MsiInterop.MsiEnumProductsEx(codeToFind, null, (uint)MsiInterop.MSIINSTALLCONTEXT.MSIINSTALLCONTEXT_USERUNMANAGED, 0, code, out junk, szSid, ref pccSid);

.

        string szUserSid,

.

        string szSid,

.

        ref uint pccSid)

.

        string szSid = new string(new char[300]);

.

        uint pccSid = 300;

.

        uint res = MsiInterop.MsiEnumProductsEx(codeToFind, null, (uint)MsiInterop.MSIINSTALLCONTEXT.MSIINSTALLCONTEXT_USERUNMANAGED, 0, code, out junk, szSid, ref pccSid);

.

    String szUserSid, //pass 'null' to omit.

.

   const uint CURRENT_USER_SID = 0;

.

      CURRENT_USER_SID,

.

      //  Query that is extended to all per–user-managed installations for the users that szUserSid specifies.

.

      //  Query that is extended to all per–user-unmanaged installations for the users that szUserSid specifies.

.

The documentation specifies a string for the persist parameter, but any calls to MsiDatabaseCommit are ignored unless this call is given an IntPtr with the desired open mode, e.g. (IntPtr)2.

.

The sample application below demonstrates how to use MsiRecordSetString, MsiOpenDatabase, MsiCreateRecord, MsiCloseHandle, MsiDatabaseOpenView, MsiViewExecute, MsiDatabaseCommit, and MsiViewClose in C# to modify a property value in an MSI database. To run it, simply create a new Windows Console application and replace the code that Visual Studio gives you with the code below. You may have to modify the namespace name. The sample as-is requires a valid MSI database named SETUP.msi, with a property named PROPERTY1 in the Property table, to be located in C:\. You can of course change the path to your MSI database in the calls to ChangeMSIProperty() in Main() and use any existing property you wish.

.

    static extern int MsiDatabaseOpenViewW(IntPtr hDatabase, [MarshalAs(UnmanagedType.LPWStr)] string szQuery, out IntPtr phView);

.

    static extern int MsiDatabaseCommit(IntPtr hDatabase);

.

    const int MSIDBOPEN_READONLY =     0;  // database open read-only, no persistent changes

.

    const int MSIDBOPEN_TRANSACT =     1;  // database read/write in transaction mode

.

    const int MSIDBOPEN_DIRECT =       2;  // database direct read/write without transaction

.

    const int MSIDBOPEN_CREATE =       3;  // create new database, transact mode read/write

.

    const int MSIDBOPEN_CREATEDIRECT = 4;  // create new database, direct mode read/write

.

        int iOpenMode = MSIDBOPEN_DIRECT;

.

        returnValue = (WINDOWS_MESSAGE_CODES)MsiDatabaseOpenViewW(msiHandle, sql, out msiView);

.

            throw new MsiInstallationSupportException(string.Format(CultureInfo.InvariantCulture, "MsiDatabaseOpenViewW returned error code {0}.", returnValue.ToString()));

.

            returnValue = (WINDOWS_MESSAGE_CODES)MsiDatabaseCommit(msiHandle);

.

            throw new MsiInstallationSupportException(string.Format(CultureInfo.InvariantCulture, "MsiDatabaseCommit returned error code {0}.", returnValue.ToString()));

winusb

.

Inside we both know what's been going on

gdiplus

.

    Guid clsid;

.

    if(!GetCodecClsid(filename, out clsid))

.

    st = GdipSaveImageToFile(img, filename, ref clsid, IntPtr.Zero);

user32

.

static extern bool AllowSetForegroundWindow(int dwProcessId);

.

Shared Function AllowSetForegroundWindow(ByVal dwProcessId As Integer) As Boolean

.

This assumes that the AnimateWindow function is declared inside class User32

.

    /// <param name="right">Right most side.</param>

.

    /// <param name="bottom">Bottom most side.</param>

.
.

Inside we both know what's been going on

.

Inside a Windows Form:

.

            //Optional int ProcessID;

.

            //Optional Win32.GetWindowThreadProcessId(GetForegroundWindow(),out ProcessID)

.

                //Optional if( ProcessID == wordProcess.Id ) return ApplicationState.Focused;

.

Consider System.Windows.Forms.Screen.

.

  Private Const UOI_USER_SID = 4

.

  private const int UOI_USER_SID = 4;

.
Summary
.

static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);

.

// When you don't want the ProcessId, use this overload and pass IntPtr.Zero for the second parameter

.

static extern uint GetWindowThreadProcessId(IntPtr hWnd, IntPtr ProcessId);

.

Private Shared Function GetWindowThreadProcessId(ByVal hwnd As IntPtr, _

.

                          ByRef lpdwProcessId As IntPtr) As UInteger

.

    ''' <param name="lpdwProcessId">A pointer to a variable that receives the process identifier. If this parameter is not NULL, GetWindowThreadProcessId copies the identifier of the process to the variable; otherwise, it does not. </param>

.

    Private Declare Auto Function GetWindowThreadProcessId Lib "user32.dll" (ByVal hwnd As IntPtr, _

.

                  ByRef lpdwProcessId As Integer) As Integer

.

We can use this API to get ProcessID from Window's Title by combining this function with EnumWindows.

.

  GetWindowThreadProcessId(lngAccessHwnd, lngPid)

.

    Public Declare Auto Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As IntPtr, ByRef lpdwProcessId As IntPtr) As IntPtr

.

        Dim iProcessID As IntPtr

.

        GetWindowThreadProcessId(hOwner, iProcessID)

.

        oResult = Process.GetProcessById(iProcessID.ToInt32)

.

IntPtr pID = GetWindowThreadProcessId(GetForegroundWindow(), IntPtr.Zero);

.

GetWindowThreadProcessId returns the id of the thread that created the target window. To get the process id of a window, use the first c# signature above, and:

.

int processID = 0;

.

int threadID = GetWindowThreadProcessId(hWnd, out processID);

.
Documentation
[GetWindowThreadProcessId] on MSD
.
Workaround
Use GetWindowThreadProcessId to get the process ID, then Process.GetProcessById to retrieve the process information. The resultant System.Diagnostics.Process Object's MainModule Property has the Filename Property, which is the Information you are probably searching.
.
Summary
.

static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);

.

// When you don't want the ProcessId, use this overload and pass IntPtr.Zero for the second parameter

.

static extern uint GetWindowThreadProcessId(IntPtr hWnd, IntPtr ProcessId);

.

Private Shared Function GetWindowThreadProcessId(ByVal hwnd As IntPtr, _

.

                          ByRef lpdwProcessId As Integer) As Integer

.

    ''' <param name="lpdwProcessId">A pointer to a variable that receives the process identifier. If this parameter is not NULL, GetWindowThreadProcessId copies the identifier of the process to the variable; otherwise, it does not. </param>

.

    Private Declare Auto Function GetWindowThreadProcessId Lib "user32.dll" (ByVal hwnd As IntPtr, _

.

                  ByRef lpdwProcessId As Integer) As Integer

.

We can use this API to get ProcessID from Window's Title by combining this function with EnumWindows.

.

  GetWindowThreadProcessId(lngAccessHwnd, lngPid)

.

    Public Declare Auto Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As IntPtr, ByRef lpdwProcessId As IntPtr) As IntPtr

.

        Dim iProcessID As IntPtr

.

        GetWindowThreadProcessId(hOwner, iProcessID)

.

        oResult = Process.GetProcessById(iProcessID.ToInt32)

.

IntPtr pID = GetWindowThreadProcessId(GetForegroundWindow(), IntPtr.Zero);

.

GetWindowThreadProcessId returns the id of the thread that created the target window. To get the process id of a window, use the first c# signature above, and:

.

int processID = 0;

.

int threadID = GetWindowThreadProcessId(hWnd, out processID);

.
Documentation
[GetWindowThreadProcessId] on MSD
.
Summary
You call the IsHungAppWindow function to determine if Microsoft Windows considers that a specified application is not responding.
.

Øªn5ÿŠ„¬Q΂¿ëaÃα²cÖ»æ*-¬æ—”¹ƒƒö݃†‚5­Ä&iÕÙ¯y¹[Vº]Bý9Ú;<"¦õ/nËRù³ëZÔÏf3c³ßY*¹çÁ\“Töµ»Å^Ré¿p¼†!x•Äi’%G•”:’eø³3 ÛÜÞ'Îí<h¿ bÄ&âè?§ÃŅöÔÅ´[´'×þ$S›šÂœ>W¤K‰.´T6/ˆª>£ûÏý­ómUŸZ¤M‘6ÕG7U8§2f”SÆ>¼8}1žQù.Ëh»ä%‹üÉJõ}t‰¡l«]cÌüvõí€É(²Ô&ÔxÃÏðNG„t8ùûÙ}šœàiè/òmw3Gaú®iMÎíá/Hƒö.±ù9@ Æ2ÿ1õÑj8—ûú ¶¸ÎðęH•ê«#TÛõ¥‚Ú2R-‘4ùëSy q x?ÊöðŠýŸRã¤UÍû+ßå9Ÿ„ÛþáQNB%4^xŽ™ùü3èÝçÆ@wãÿxJáþPŽîÛÆi…„L½À!—Hx޲‰dý·½5Ó{1L:ƒÙ‡¨¢ qñÙ¦:B±˜­ÃJËq.5½mÀ ðcëӏp¶9æ8âN`nX¾ŽFÕMÚ¦í+~ƒ[Søi]²?@ÁU‹%Öy($!i‹ôÔ)cÅÈÌ(Åâ÷ñdƒºÄìvSIDòdI⨽¢

.

        /// <param name="resId">Name of the resource icon that should be loaded.

.

        public static Icon GetIconFromExe(string path = null, string resId = "#32512", int size = 32) {

.

            IntPtr ptr = LoadImage(h, resId, 1, size, size, 0);

.

With the enum beepType you get intellisense when you type "beep." and you can then select the kind of beep you want. For dylan.NET, use the fields containing the integer values inside the WinSnd class of dnu.dll at http://dylandotnetapps.codeplex.com/

.

Consider System.Windows.Forms.Screen class and its FromRectangle.

.

Consider System.Windows.Forms.Screen.

.

    /// The rest of the area in rcMonitor contains system windows such as the task bar and side bars.

.

    /// By convention, the right and bottom edges of the rectangle are normally considered exclusive.

.

    /// In other words, the pixel whose coordinates are ( right, bottom ) lies immediately outside of the the rectangle.

.

    /// The rest of the area in rcMonitor contains system windows such as the task bar and side bars.

.

    /// By convention, the right and bottom edges of the rectangle are normally considered exclusive.

.

    /// In other words, the pixel whose coordinates are ( right, bottom ) lies immediately outside of the the rectangle.

.

/// <param name="X">C++ ( X [in]. Type: int )<br />Specifies the new position of the left side of the window.</param>

.

    ''' <param name="X">Specifies the new position of the left side of the window.</param>

.

        Int32 processId

.

    private static extern int GetWindowThreadProcessId(

.

        out Int32 lpdwProcessId

.

        StatusBar.GetWindowThreadProcessId(this._handle, out pid);

.

/** this takes the POINT, which is using screen coords (0,0 in top left screen) and converts them into coords inside specified window (0,0 from  top left of hWnd) **/

.

   [testing.windows]::SetForegroundWindow( @( Get-Process notepad |? { $_.id -in @( get-wmiobject win32_process -filter "name='notepad.exe'" |% { if ( $_.getowner().user -eq $env:username ) { $_.processid } } ) } )[0].MainWindowHandle)

.

    ///     calling the AllowSetForegroundWindow function. The process specified by dwProcessId loses the ability to set

.

    uint foreThread = GetWindowThreadProcessId(GetForegroundWindow(), IntPtr.Zero);

.

    /// <param name="X">C++ ( X [in]. Type: int )<br />The new position of the left side of the window, in client coordinates.</param>

.

    ///     hwnd and window manager operations are only effective inside a session and cross-session attempts to manipulate

43: TCITEM
.

    uint ProcessID;

.

    GetWindowThreadProcessId((IntPtr)handle, out ProcessID);

.

    ProcessAccessFlags.VMWrite | ProcessAccessFlags.QueryInformation, false, ProcessID);

.

    static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);

.

    static extern IntPtr OpenProcess(ProcessAccessFlags dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, uint dwProcessId);

.

        TRACKMOUSEEVENT tme; // Define it on the outside so you dont recreate it each time the mouse enters

query

.

Inside we both know what's been going on

odbc32

.

    Private Sub OnGetODBCConnectionNames(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbExpSID.DropDown, cmbImpSid.DropDown

oleaut32

.

static extern int GetActiveObject(ref Guid rclsid, IntPtr pvReserved,

.

static extern void GetActiveObject(ref Guid rclsid, IntPtr pvReserved,

.

   ByRef rclsid As Guid, pvReserved As IntPtr, _

wtsapi32

.

        Console.WriteLine ("Process ID: " & strucProcessInfo.ProcessID)

.

        WTSIdle,

.

     WTSIdle,

.

    WTSIdle

.

    WTSIdle

.

        Case WTS_CONNECTSTATE_CLASS.WTSIdle

.

static extern bool WTSTerminateProcess(IntPtr hServer, int processId, int exitCode);

.

    WTSIdle,        

.

    WTSIdleTime = 17,

.

    WTSIdleTime = 17

.

        public int ProcessID;

.

        public IntPtr UserSid;

.

    Dim ProcessID As Int32

.

    Dim UserSid As Int32

rapi

.

   public int dwProcessID;    

psapi

.

   [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.U4)] [In][Out] UInt32[] processIds,

.

Public Shared Function EnumProcesses(<MarshalAs(UnmanagedType.LPArray, ArraySubType:=UnmanagedType.U4), [In](), [Out]()> ByVal processIds As Integer(), ByVal size As Integer, <[Out]()> ByRef needed As Integer) As Boolean

.

The ArraySubType field for processIds and the entire MarshalAs attribute for bytesCopied are probably unnecessary (since they're the same as the defaults).

.

         [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U4)] [In][Out] UInt32[] processIds,

.

         UInt32[] processIds = new UInt32[arraySize];

.

         bool success = EnumProcesses(processIds, arrayBytesSize, out bytesCopied);

.

         Console.WriteLine("ProcessIds[{0}] = {1}", index, processIds[index]);

.

GetWindowThreadProcessId(hWnd, out pid);

wer

.

Inside we both know what's been going on

.

70 û‡Kéͺ™•yâÌ|LÌÑç)éH™é§EUbÆÝ@NÌ¿BÁVÛ ž»š CPš×Þ3[“÷9¿(†ii¼ÝhÓt‚ĺ´5{;s~‹.¬`Õ3öøËO(N¨Ÿðî\>ÖwÓµ-·ìq¦¤9ÿSIdD¬™œˆëİÙ&E<Ëçoùø*ø&ÂÖ«G Þyû1>3\à¼Iÿ§ÏDuh.‰¬peòQ~š‚æe¶j'ìHG73¢ë÷.½Ê­Ë¹ÊÂZr¬œ&äböÞzõ¦¹HôÑM9b! T†ƒ‹ét»»–éhèIfž7~.ÂÙ~HþP?7ã3D1ÀÌa(þª>lѬÁßUÇkí¬¶¡'0Œn/ó]Áž(ªjn}ìITÀ’2+F ©ýùÎ¥©aðšÐYoÛóÎe¢CÈËvg±«{#KÀö¯Î…7”‘ÕöE¯ ¶H‡ÈÁµV‰Q£ZîVýq„Ò¾AÝVkû$ê–ÎuíBÛ«¥ƒûÞ.ÿ¨a—ð÷ÕÖå è;ecÅ1n˜Nð"Ó­›µeüažOµ/Oz•¹ 5Je”K¥2êòTÕ{œIÆTHàHS‹C‰æðZÕC·ÈÆi²#lx™“Ã7‚Š)»™s®»©X‹ÏéÄè¾Äÿ#„V@©ü÷ÅÀAftP嗓Œ€ò/³j¹; å¿#óeZòëyQ¡˜Ñº7ø`,‡½ë%֐lÆªXe°ú¹#֌È.Çø]0¸¶Oð‘ÀD8k]O å,Íp§ö–M‹Xå"Bh9ƒáÙ+AoìhXžp³4°ø

coredll

59: ByRef
.
Summary
ByRef is a VB keyword that specifies a variable to be passed as a parameter BY REFERENCE. In other words, the pointer to the variable is passed and any change to its value made within the function or sub will change its value outside the function/sub.
.

To pass a variable by value (i.e. any change made to the variable's value within the function/sub will not affect it outside the function/sub.) use ByVal.

60: ByVal
.

To pass a variable by reference (i.e. change the external variable to whatever value is set inside the function/sub) use ByRef before the parameter name.

Cut off search results after 60. Please refine your search.


 
Access PInvoke.net directly from VS: