Created
March 29, 2011 12:28
-
-
Save vabock/892273 to your computer and use it in GitHub Desktop.
BooでP/Invokeテスト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace getwr | |
import System | |
import System.Runtime.InteropServices | |
[StructLayout(LayoutKind.Sequential)] | |
struct RECT: | |
public Left as int | |
public Top as int | |
public Right as int | |
public Bottom as int | |
[DllImport("user32.dll")] | |
def GetWindowRect(hwnd as IntPtr, ref lpRect as RECT) [MarshalAs(UnmanagedType.Bool)] as bool: | |
pass | |
[DllImport("user32.dll")] | |
def GetDesktopWindow() as IntPtr: | |
pass | |
print "Hello, World!" | |
w = GetDesktopWindow() | |
r = RECT() | |
print GetWindowRect(w, r) // refはいらない | |
print r.Left, r.Top, r.Right, r.Bottom | |
// TODO: Implement Functionality Here | |
print "Press any key to continue . . . " | |
Console.ReadKey(true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment