Ga naar inhoud

(VB) formulier op klembord plaatsen


anoniem

Aanbevolen berichten

  • 2 weken later...
Probeer het volgende maar eens : Naar clipboard : Option Explicit Dim Invoer, oIE, oData, sText Invoer = InputBox("Voer uw gegevens voor clipboard in",, "Uw input ") Set oIE= CreateObject("InternetExplorer.Application") With oIE .Navigate("about:clipdata") Do While oIE.ReadyState<>4: wscript.sleep 100: Loop Set oData= .Document.ParentWindow.ClipboardData End With oData.SetData "Text", Invoer sText= oData.getData("Text") oIE.Quit Set oIE=Nothing WScript.Echo "Opgeslagen is " & VbCRLF & sText Van clipboard : Set oHtml = CreateObject("htmlfile") sClipText = oHtml.ParentWindow.ClipboardData.GetData("text") WScript.Echo "In clipboard staat :" & VbCRLF & sClipText (Bron : een zekere Zachary) Laat maar weten of het lukt.
Link naar reactie
Ik heb op [url]http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarvbtips/html/msdn_msdn98.asp[/url] een code gevonden die ik zou kunnen ombouwen tot wat ik wil, maar nu heb ik alle aanwijzingen precies opgevolgd en nu krijg ik de foutmelding: File not found: User De (hoofd)code (er hangt namelijk nog een module aan vast) is als volgt: [code:1:efae9226b1] Option Explicit Private Declare Function GetActiveWindow Lib "User" () As Integer Private Declare Function GetWindowDC Lib "User" (ByVal hWnd As Integer) As Integer Private Declare Sub GetWindowRect Lib "User" (ByVal hWnd As Integer, lpRect As RECT) Private Declare Function ReleaseDC Lib "User" (ByVal hWnd As Integer, ByVal hDC As Integer) As Integer Private Declare Function BitBlt% Lib "GDI" (ByVal hDestDC%, ByVal X%, ByVal Y%, ByVal nWidth%, ByVal nHeight%, ByVal hSrcDC%, ByVal XSrc%, ByVal YSrc%, ByVal dwRop&) Const SRCCOPY = &HCC0020 Private Sub Command1_Click() SaveToPicture End Sub Sub SaveToPicture() Dim hDCCur As Long Dim hWndCur As Long Dim HWndOld As Long Dim Tim As Double Dim ThisRect As RECT Dim DX As Long Dim DY As Long HWndOld = GetActiveWindow() Form2.Show hWndCur = Form2.hWnd Tim = Timer + 0.5 Do DoEvents Loop Until Timer >= Tim hDCCur = GetWindowDC(hWndCur) Call GetWindowRect(hWndCur, ThisRect) DX = ThisRect.Right - ThisRect.Left + 2: DY = ThisRect.Bottom - ThisRect.Top + 2 With Picture1 .Width = Screen.TwipsPerPixelX * DX .Height = Screen.TwipsPerPixelY * DY Call BitBlt(.hDC, 0, 0, DX, DY, hDCCur, 0, 0, SRCCOPY) .Picture = .Image End With Call ReleaseDC(hWndCur, hDCCur) Form2.Hide CommonDialog1.DefaultExt = "BMP" CommonDialog1.DialogTitle = "Save Window As" CommonDialog1.FileName = "*.BMP" CommonDialog1.Action = 2 If CommonDialog1.FileName <> Empty Then SavePicture Picture1.Picture, CommonDialog1.FileName End If End Sub [/code:1:efae9226b1] Als ik die foutmelding krijg dan komt de cursor op de regel: HWndOld = GetActiveWindow() Weet iemand wat hieraan te doen is??
Link naar reactie

Om een reactie te plaatsen, moet je eerst inloggen

Gast
Reageer op dit topic

×   Geplakt als verrijkte tekst.   Herstel opmaak

  Er zijn maximaal 75 emoji toegestaan.

×   Je link werd automatisch ingevoegd.   Tonen als normale link

×   Je vorige inhoud werd hersteld.   Leeg de tekstverwerker

×   Je kunt afbeeldingen niet direct plakken. Upload of voeg afbeeldingen vanaf een URL in

×
×
  • Nieuwe aanmaken...