|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
Problems in porting Win32 API in PowerShell Hi, I encounter the problem of adapting such a port on Win32 API in PowerShell (type. NET + P / Invoke). Default PowerShell a number is considered a signed integer (System.Int32). I just installed the SDK 6.1 for access to statements in the file WinUser.h, but I do not know how to interpret the different types of declared values. Finally, the more precisely: -what is the default on the directive define next? Code: ICON_SMALL = 0 # define ICON_SMALL 0 Code: 0x00000400L # define MF_BYPOSITION Namely, if such a constant is declared as a signed integer, will always regarded as such even if several APIs use this constant? |
#2
| |||
| |||
Re: Problems in porting Win32 API in PowerShell Hello,
|
#3
| |||
| |||
Re: Problems in porting Win32 API in PowerShell This is what I understood, for some constant I do not know if I have to use IntPtr or System.int32/64 For example 2 for these constants: Code: ICON_SMALL = [UInt32] 0 # API SendMessage: # Typedef UINT wParam; from? # Or UINT_PTR typedef wParam;? from WTypes.h sdk 6.21 BS_PUSHBUTTON = 0 # # API?: # Typedef LONG LPARAM; = [IntPtr]? Int64 (signed)? |
#4
| |||
| |||
Re: Problems in porting Win32 API in PowerShell For all handles and pointers, in the corresponding type. Net and Powershell is System.IntPtr, and nothing else. The good wParam typedef C UINT_PTR is therefore in System.IntPtr. Net and Powershell (or UIntPtr, but use of unsigned types is not recommended as non-CLS-compliant). The proper C typedef LPARAM and lResult LONG_PTR is therefore also System.IntPtr. SetWindowLongPtr () is for the 64bit compatibility, but can and should be used in 32 bits. Unfortunately, C and C + +, how it is when you set compiles 32 (a simple macro) poses some problems to be solved fairly easily. BS_PUSHBUTTON is a style, a DWORD (System.UInt32 or System.Int32) |
![]() |
|
Tags: powershell, sdk, win32 api |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
MIUI v4 porting to Mobile Device | Anuja Darzi | Software Development | 1 | 06-09-2012 01:50 PM |
Is it possible to Porting Android OS to Sony Ericsson Satio? | Graduated | Portable Devices | 7 | 06-01-2012 10:42 PM |
Porting request for new mobile network | Tyrone | India BroadBand | 3 | 09-03-2011 04:48 AM |
Porting Android on Samsung Omnia smartphone | Vedic | Portable Devices | 4 | 31-01-2011 11:14 PM |