IonicWind Software

IWBasic => General Questions => Topic started by: vmars316 on July 31, 2012, 03:28:09 PM

Title: SetClipboardViewer & ChangeClipboardChain, how to code ?
Post by: vmars316 on July 31, 2012, 03:28:09 PM
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
Title: Re: SetClipboardViewer & ChangeClipboardChain, how to code ?
Post by: LarryMc on July 31, 2012, 07:38:20 PM
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.
Title: Re: SetClipboardViewer & ChangeClipboardChain, how to code ?
Post by: vmars316 on July 31, 2012, 09:20:26 PM
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
Title: Re: SetClipboardViewer & ChangeClipboardChain, how to code ?
Post by: LarryMc on July 31, 2012, 09:26:27 PM
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)
Title: Re: SetClipboardViewer & ChangeClipboardChain, how to code ?
Post by: vmars316 on August 01, 2012, 11:03:52 AM
Ah yes, I see.
Thank you very much...Vernon