anoniem Geplaatst: 19 februari 2004 Delen Geplaatst: 19 februari 2004 hallo, Weet iemand of het mogelijk is om een formulier in vb op het klembord te laten plaatsen of om het op te slaan als plaatje?? Zo ja, welke code wordt hier dan voor gebruikt? Quote Link naar reactie
anoniem Geplaatst: 22 februari 2004 Auteur Delen Geplaatst: 22 februari 2004 Probeer eens iets als <ALT><Print Screen>. Dit moet met Sendkeys o.i.d te automatiseren zijn. Suc6, Quote Link naar reactie
anoniem Geplaatst: 2 maart 2004 Auteur Delen Geplaatst: 2 maart 2004 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. Quote Link naar reactie
anoniem Geplaatst: 6 maart 2004 Auteur Delen Geplaatst: 6 maart 2004 Nee, dat werkt niet, hij herkent een heleboel variablen niet. Trouwens het hoeft niet per se op het klembord geplaatst te worden, het is ook goed als je het formulier direct kan opslaan als jpeg, is dat wel makkelijker?? Quote Link naar reactie
anoniem Geplaatst: 6 maart 2004 Auteur Delen Geplaatst: 6 maart 2004 PC_Freak17, mogelijk is [url]http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/dhtml_reference_entry.asp[/url] een ingang voor je. Verder heb ik geen ervaring met Forms. :cry: Succes ! Quote Link naar reactie
anoniem Geplaatst: 7 maart 2004 Auteur Delen Geplaatst: 7 maart 2004 nee, daarmee lukt het ook niet Quote Link naar reactie
anoniem Geplaatst: 7 maart 2004 Auteur Delen Geplaatst: 7 maart 2004 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?? Quote Link naar reactie
Aanbevolen berichten
Om een reactie te plaatsen, moet je eerst inloggen