kan ikke få det til at virke i VB, kan godt få det til at virke i C#..
VB
Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("user32.dll")> _
Public Shared Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
End Function
<DllImport("user32.dll")> _
Public Shared Function SendMessage(ByVal hWnd As Integer, ByVal Msg As UInteger, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
End Function
<DllImport("User32.dll", ExactSpelling:=True, CharSet:=System.Runtime.InteropServices.CharSet.Auto)> _
Private Shared Function MoveWindow(ByVal hWnd As IntPtr, ByVal x As Integer, ByVal y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal repaint As Boolean) As Boolean
End Function
Public Const WM_COMMAND As Integer = &H112
Public Const WM_CLOSE As Integer = &HF060
Dim handel As Integer = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
handel = Shell("notepad.exe")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
MoveWindow(CType(handel, IntPtr), 40, 500, 20, 100, True)
End Sub
End Class
men det kan kun movewindow, jeg vil godt kunne skive og resize osse.. nogen ider?