thenetfreaker has asked for the wisdom of the Perl Monks concerning the following question:
ApiLink( 'user32.dll', 'Private Declare Sub keybd_event Lib "user32" ( +ByVal bVk As Byte, _ ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As L +ong)' ) or die $^E; ApiLink( 'user32.dll', 'Private Const KEYEVENTF_KEYUP = &H2' ) or +die $^E; ApiLink( 'user32.dll', 'Function GetScreenBitmap() As Picture' ) o +r die $^E; ApiLink( 'user32.dll', 'Dim pic As StdPicture' ) or die $^E; ApiLink( 'user32.dll', 'Set pic = Clipboard.GetData(vbCFBitmap)' ) + or die $^E; ApiLink( 'user32.dll', 'keybd_event vbKeySnapshot, 0, 0, 0' ) or d +ie $^E; ApiLink( 'user32.dll', 'DoEvents' ) or die $^E; ApiLink( 'user32.dll', 'keybd_event vbKeySnapshot, 0, KEYEVENTF_KE +YUP, 0' ) or die $^E; ApiLink( 'user32.dll', 'DoEvents' ) or die $^E; ApiLink( 'user32.dll', 'Set GetScreenBitmap = Clipboard.GetData(vb +CFBitmap)' ) or die $^E; ApiLink( 'user32.dll', 'Clipboard.SetData pic, vbCFBitmap' ) or di +e $^E; ApiLink( 'user32.dll', 'End Function' ) or die $^E; ApiLink( 'user32.dll', 'Set Picture1.Picture = GenScreenBitmap()' +) or die $^E; ApiLink( 'user32.dll', 'this.Size = new System.Drawing.Size(width, + height)' ) or die $^E; ApiLink( 'user32.dll', 'this.Setstyle(Controlstyles.DoubleBuffer | + Controlstyles.UserPaint |Controlstyles.AllPaintingInWmPaint | Contro +lstyles.FixedWidth |Controlstyles.FixedHeight, true)' ) or die $^E; ApiLink( 'user32.dll', 'this.Updatestyles()' ) or die $^E; ApiLink( 'user32.dll', 'this.FormBorderstyle = FormBorderstyle.Non +e' ) or die $^E; ApiLink( 'user32.dll', 'this.TopMost = true' ) or die $^E; ApiLink( 'user32.dll', 'this.StartPosition = FormStartPosition.Cen +terScreen' ) or die $^E; ApiLink( 'user32.dll', 'this.ClientSize = new System.Drawing.Size( +width, height)' ) or die $^E; ApiLink( 'user32.dll', 'this.Location = this.DesktopLocation = new + System.Drawing.Point(0, 0)' ) or die $^E; ApiLink( 'user32.dll', 'public void bitBlt(Picture1, 0, 0)' ) or d +ie $^E;
Therefore the first question is if i'm using Win32::API correctly ?
The second question would be - if it's possible to join all these lines into one code (VB / .Net / C++) ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multiple API calls
by Corion (Patriarch) on Oct 25, 2007 at 09:17 UTC | |
|
Re: Multiple API calls
by almut (Canon) on Oct 25, 2007 at 09:50 UTC | |
by thenetfreaker (Friar) on Oct 25, 2007 at 10:19 UTC |