May 21, 2024, 06:32:31 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


SetClipboardViewer & ChangeClipboardChain, how to code ?

Started by vmars316, July 31, 2012, 03:28:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vmars316

Greetings,
I didn't really get an answer on these 2 APIs:

DECLARE FUNCTION SetClipboardViewer LIB "USER32" _
       (hWndNewViewerVm AS LONG) AS LONG

DECLARE FUNCTION ChangeClipboardChain LIB "USER32" _
       (hWndNewViewerVm AS LONG, hWndNextViewerVm AS LONG) AS LONG

I notice they aren't available in iwb users guide.
How would I code these in iwb ?

Thanks...Vernon
- www.vmars316.com
"All things in moderation, except for love and forgiveness."

LarryMc

They are declared in the same format as other API functions

DECLARE IMPORT, SetClipboardViewer(hwnd:INT),INT
DECLARE IMPORT, ChangeClipboardChain(hwnd:INT, hWndNext:INT),INT

when you see hwnd in a declare statement it is referring to Windows handle to an IWB window.

WINDOW MyWin
OPENWINDOW MyWin......

...
...
SetClipboardViewer(MyWin.hwnd)
ChangeClipboardChain(MyWin.hwnd, hWndNext)

I couldn't find an actual IWB example that uses those functions.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

vmars316

Thanks Larry,
This part I understand:
DECLARE IMPORT, SetClipboardViewer(hwnd:INT),INT
DECLARE IMPORT, ChangeClipboardChain(hwnd:INT, hWndNext:INT),INT

hwndNextViewer = SetClipboardViewer(hwndMyViewer)

I am confused with:
SetClipboardViewer(MyWin.hwnd)
Shouldn't it return a value ?

and same with:
  ChangeChainReturn = ChangeClipboardChain(hwndMyViewer, hwndNextViewer)
I am confused with:
ChangeClipboardChain(MyWin.hwnd, hWndNext)
Shouldn't it return a value ?

Or is this your shorthand, where a return is understood?

Also, is INT in iwb actually LONG ?

Thanks...Vernon
- www.vmars316.com
"All things in moderation, except for love and forgiveness."

LarryMc

QuoteOr is this your shorthand, where a return is understood?

Also, is INT in iwb actually LONG ?
yes and yes

SetClipboardViewer(MyWin.hwnd)
ChangeClipboardChain(MyWin.hwnd, hWndNext)

should be more like this:

int h1,h2

h1 = SetClipboardViewer(MyWin.hwnd)
h2= ChangeClipboardChain(MyWin.hwnd, hWndNext)
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

vmars316

- www.vmars316.com
"All things in moderation, except for love and forgiveness."