Toon posts:

VB - DrawClipboard

Pagina: 1
Acties:

Verwijderd

Topicstarter
Hallo, Iemand wees me op een programma dat de clipboard text weergeeft als er iets naar het clipboard wordt gekopieerd.
Dat programma maakt gebruikt van :

Case WM_DRAWCLIPBOARD
If Clipboard.GetFormat(vbCFText) Then textbox1= Clipboard.GetText

Ook maakt het gebruikt van "ChangeClipboardChain"
Ik wil mijn programma zo simpel mogelijk houden, en vraag me daarom ook af of iets dergelijks als "ChangeClipboardChain" wel noodzakelijk is voor een programma die iets uit het clipboard wil lezen zodra er iets naar gekopieerd wordt.

Op het web is hier zo goed als niets over te vinden, en van de help file word ik ook al niet veel wijzer.

Zou iemand me een heel klein voorbeeldje willen geven waarin het programma niets doet, totdat er iets in het clipboard komt (drawclipboard) en vervolgens kijkt of het 1000 tekens of meer zijn? (zoiets ik onderaan heb gezet)

tekens = Len(TextBox1)
If Not tekens > 1000 Then goto einde

Alvast Bedankt.

Verwijderd

Topicstarter
Ik ben vergeten te vermelden dat ik ook nog iets had gevonden met
"SetClipboardViewer" maar dit was me ook onduidelijk.

  • Alarmnummer
  • Registratie: Juli 2001
  • Laatst online: 09-07-2024

Alarmnummer

-= Tja =-

Op de hoogeschool van enschede is het toegestaan dat je goto`s gebruikt?

Verwijderd

Topicstarter
Ik doe een economische opleiding, en programmeer voor de fun. Sorry als t nergens naar lijkt.

Verwijderd

Het idee op zich zal wel gewoon op een API van windows gebaseerd zijn, maar je uitleg is niet echt ... volledig te noemen vrees ik.
probeer het eens op planet-source-code.com, misschien staan er wel voorbeelden en anders is er zeker wel info te vinden op google als je zoekt naar iets als : +"VB Clipboard" eventueel met +API

Verwijderd

Je zou eventueel, maar dat is een laatste oplossing, met een timer kunnen controleren of de inhoud verandert is.

  • Sponge
  • Registratie: Januari 2002
  • Laatst online: 28-08 17:06

Sponge

Serious Game Developer

Van andere site:
When you select Watch Clipboard for URLs in the Project Options dialog, HandsDown monitors the clipboard for valid URLs (text that begins with either ftp:// or http://). It doesn't need to examine the Clipboard periodically to do this, because Windows can notify an application when new data is copied to the Clipboard. Windows does this by sending WM_DRAWCLIPBOARD messages to the Clipboard notification chain. To receive these messages, an application must register with Windows to become part of the chain. HandsDown does this by calling MFC's CWnd::SetClipboardViewer() method.

HandsDown's CHDView::OnDrawClipboard() method is a handler for the WM_DRAWCLIPBOARD message. When HandsDown receives this notification, the handler queries the Clipboard to see whether the new data is in text (CF_TEXT) format. If so, HandsDown retrieves the new text and determines whether it represents a valid URL. If it is, HandsDown searches the download list to see if the list already contains this URL. If the URL is not there already, HandsDown adds it to the list.

When HandsDown no longer wishes to receive Clipboard notifications, the utility must tell Windows to remove it from the Clipboard notification chain. It's very important for an application to do this before exiting. Otherwise, the notification chain will be broken and none of the other applications in the chain will receive notification messages.
(HandsDown is een of ander programma waar het over gaat).. dit is toch de enige oplossing denk ik.

Tip: Ga eens zoeken op google.com naar: "clipboard notification" zo heb ik dus de vorige link ook gevonden (was zelfs result 1)
Pagina: 1