unknownr 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/DesktopGadget.rbw +25 -0
- data/lib/unknownr.rb +619 -0
- metadata +8 -3
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'unknownr'
|
2
|
+
|
3
|
+
include Unknownr::Windows
|
4
|
+
|
5
|
+
InitializeOle()
|
6
|
+
|
7
|
+
IDesktopGadget = COM::Interface[IUnknown,
|
8
|
+
GUID['c1646bc4-f298-4f91-a204-eb2dd1709d1a'],
|
9
|
+
|
10
|
+
RunGadget: [[:buffer_in], :long]
|
11
|
+
]
|
12
|
+
|
13
|
+
DesktopGadget = COM::Factory[IDesktopGadget, GUID['924ccc1b-6562-4c85-8657-d177925222b6']]
|
14
|
+
|
15
|
+
dg = DesktopGadget.new
|
16
|
+
|
17
|
+
begin
|
18
|
+
dg.RunGadget(
|
19
|
+
"#{ENV['ProgramFiles']}/Windows Sidebar/Gadgets/Clock.Gadget\0".
|
20
|
+
gsub('/', '\\').
|
21
|
+
encode('utf-16le')
|
22
|
+
)
|
23
|
+
ensure
|
24
|
+
dg.Release
|
25
|
+
end
|
data/lib/unknownr.rb
CHANGED
@@ -66,6 +66,8 @@ module Unknownr
|
|
66
66
|
}
|
67
67
|
}
|
68
68
|
end
|
69
|
+
|
70
|
+
def ==(other) Windows.memcmp(other, self, size) == 0 end
|
69
71
|
end
|
70
72
|
|
71
73
|
CLSCTX_INPROC_SERVER = 0x1
|
@@ -272,5 +274,622 @@ module Unknownr
|
|
272
274
|
]
|
273
275
|
|
274
276
|
Unknown = COM::Instance[IUnknown]
|
277
|
+
|
278
|
+
IDispatch = COM::Interface[IUnknown,
|
279
|
+
GUID['00020400-0000-0000-C000-000000000046'],
|
280
|
+
|
281
|
+
GetTypeInfoCount: [[:pointer], :long],
|
282
|
+
GetTypeInfo: [[:uint, :ulong, :pointer], :long],
|
283
|
+
GetIDsOfNames: [[:pointer, :pointer, :uint, :ulong, :pointer], :long],
|
284
|
+
Invoke: [[:long, :pointer, :ulong, :ushort, :pointer, :pointer, :pointer, :pointer], :long]
|
285
|
+
]
|
286
|
+
|
287
|
+
Dispatch = COM::Instance[IDispatch]
|
288
|
+
DCallback = COM::Callback[IDispatch]
|
289
|
+
|
290
|
+
IConnectionPointContainer = COM::Interface[IUnknown,
|
291
|
+
GUID['B196B284-BAB4-101A-B69C-00AA00341D07'],
|
292
|
+
|
293
|
+
EnumConnectionPoints: [[:pointer], :long],
|
294
|
+
FindConnectionPoint: [[:pointer, :pointer], :long]
|
295
|
+
]
|
296
|
+
|
297
|
+
ConnectionPointContainer = COM::Instance[IConnectionPointContainer]
|
298
|
+
|
299
|
+
IConnectionPoint = COM::Interface[IUnknown,
|
300
|
+
GUID['B196B286-BAB4-101A-B69C-00AA00341D07'],
|
301
|
+
|
302
|
+
GetConnectionInterface: [[:pointer], :long],
|
303
|
+
GetConnectionPointContainer: [[:pointer], :long],
|
304
|
+
Advise: [[:pointer, :pointer], :long],
|
305
|
+
Unadvise: [[:ulong], :long],
|
306
|
+
EnumConnections: [[:pointer], :long]
|
307
|
+
]
|
308
|
+
|
309
|
+
ConnectionPoint = COM::Instance[IConnectionPoint]
|
310
|
+
|
311
|
+
IObjectWithSite = COM::Interface[IUnknown,
|
312
|
+
GUID['FC4801A3-2BA9-11CF-A229-00AA003D7352'],
|
313
|
+
|
314
|
+
SetSite: [[:pointer], :long],
|
315
|
+
GetSite: [[:pointer, :pointer], :long]
|
316
|
+
]
|
317
|
+
|
318
|
+
ObjectWithSite = COM::Callback[IObjectWithSite]
|
319
|
+
|
320
|
+
attach_function :OleInitialize, [:pointer], :long
|
321
|
+
attach_function :OleUninitialize, [], :void
|
322
|
+
|
323
|
+
def InitializeOle
|
324
|
+
DetonateHresult(:OleInitialize, nil)
|
325
|
+
|
326
|
+
at_exit { OleUninitialize() }
|
327
|
+
end
|
328
|
+
|
329
|
+
module_function :InitializeOle
|
330
|
+
|
331
|
+
attach_function :CoTaskMemAlloc, [:ulong], :pointer
|
332
|
+
attach_function :CoTaskMemFree, [:pointer], :void
|
333
|
+
|
334
|
+
VT_EMPTY = 0
|
335
|
+
VT_NULL = 1
|
336
|
+
VT_I2 = 2
|
337
|
+
VT_I4 = 3
|
338
|
+
VT_R4 = 4
|
339
|
+
VT_R8 = 5
|
340
|
+
VT_CY = 6
|
341
|
+
VT_DATE = 7
|
342
|
+
VT_BSTR = 8
|
343
|
+
VT_DISPATCH = 9
|
344
|
+
VT_ERROR = 10
|
345
|
+
VT_BOOL = 11
|
346
|
+
VT_VARIANT = 12
|
347
|
+
VT_UNKNOWN = 13
|
348
|
+
VT_DECIMAL = 14
|
349
|
+
VT_I1 = 16
|
350
|
+
VT_UI1 = 17
|
351
|
+
VT_UI2 = 18
|
352
|
+
VT_UI4 = 19
|
353
|
+
VT_I8 = 20
|
354
|
+
VT_UI8 = 21
|
355
|
+
VT_INT = 22
|
356
|
+
VT_UINT = 23
|
357
|
+
VT_VOID = 24
|
358
|
+
VT_HRESULT = 25
|
359
|
+
VT_PTR = 26
|
360
|
+
VT_SAFEARRAY = 27
|
361
|
+
VT_CARRAY = 28
|
362
|
+
VT_USERDEFINED = 29
|
363
|
+
VT_LPSTR = 30
|
364
|
+
VT_LPWSTR = 31
|
365
|
+
VT_FILETIME = 64
|
366
|
+
VT_BLOB = 65
|
367
|
+
VT_STREAM = 66
|
368
|
+
VT_STORAGE = 67
|
369
|
+
VT_STREAMED_OBJECT = 68
|
370
|
+
VT_STORED_OBJECT = 69
|
371
|
+
VT_BLOB_OBJECT = 70
|
372
|
+
VT_CF = 71
|
373
|
+
VT_CLSID = 72
|
374
|
+
VT_VECTOR = 0x1000
|
375
|
+
VT_ARRAY = 0x2000
|
376
|
+
VT_BYREF = 0x4000
|
377
|
+
VT_RESERVED = 0x8000
|
378
|
+
VT_ILLEGAL = 0xffff
|
379
|
+
VT_ILLEGALMASKED = 0xfff
|
380
|
+
VT_TYPEMASK = 0xff
|
381
|
+
|
382
|
+
class PROPERTYKEY < FFI::Struct
|
383
|
+
layout \
|
384
|
+
:fmtid, GUID,
|
385
|
+
:pid, :ulong
|
386
|
+
|
387
|
+
def self.[](type, index)
|
388
|
+
new.tap { |key|
|
389
|
+
key[:fmtid].tap { |guid|
|
390
|
+
guid[:Data1] = 0x00000000 + index
|
391
|
+
guid[:Data2] = 0x7363
|
392
|
+
guid[:Data3] = 0x696e
|
393
|
+
[0x84, 0x41, 0x79, 0x8a, 0xcf, 0x5a, 0xeb, 0xb7].each_with_index { |part, i|
|
394
|
+
guid[:Data4][i] = part
|
395
|
+
}
|
396
|
+
}
|
397
|
+
|
398
|
+
key[:pid] = type
|
399
|
+
}
|
400
|
+
end
|
401
|
+
|
402
|
+
def ==(other) Windows.memcmp(other, self, size) == 0 end
|
403
|
+
end
|
404
|
+
|
405
|
+
module AnonymousSupport
|
406
|
+
def [](k)
|
407
|
+
if members.include?(k)
|
408
|
+
super
|
409
|
+
elsif self[:_].members.include?(k)
|
410
|
+
self[:_][k]
|
411
|
+
else
|
412
|
+
self[:_][:_][k]
|
413
|
+
end
|
414
|
+
end
|
415
|
+
|
416
|
+
def []=(k, v)
|
417
|
+
if members.include?(k)
|
418
|
+
super
|
419
|
+
elsif self[:_].members.include?(k)
|
420
|
+
self[:_][k] = v
|
421
|
+
else
|
422
|
+
self[:_][:_][k] = v
|
423
|
+
end
|
424
|
+
end
|
425
|
+
end
|
426
|
+
|
427
|
+
class LARGE_INTEGER < FFI::Union
|
428
|
+
include AnonymousSupport
|
429
|
+
|
430
|
+
layout \
|
431
|
+
:_, Class.new(FFI::Struct) {
|
432
|
+
layout \
|
433
|
+
:LowPart, :ulong,
|
434
|
+
:HighPart, :long
|
435
|
+
},
|
436
|
+
|
437
|
+
:QuadPart, :long_long
|
438
|
+
end
|
439
|
+
|
440
|
+
class ULARGE_INTEGER < FFI::Union
|
441
|
+
include AnonymousSupport
|
442
|
+
|
443
|
+
layout \
|
444
|
+
:_, Class.new(FFI::Struct) {
|
445
|
+
layout \
|
446
|
+
:LowPart, :ulong,
|
447
|
+
:HighPart, :ulong
|
448
|
+
},
|
449
|
+
|
450
|
+
:QuadPart, :ulong_long
|
451
|
+
end
|
452
|
+
|
453
|
+
class FILETIME < FFI::Struct
|
454
|
+
layout \
|
455
|
+
:dwLowDateTime, :ulong,
|
456
|
+
:dwHighDateTime, :ulong
|
457
|
+
end
|
458
|
+
|
459
|
+
class BSTRBLOB < FFI::Struct
|
460
|
+
layout \
|
461
|
+
:cbSize, :ulong,
|
462
|
+
:pData, :pointer
|
463
|
+
end
|
464
|
+
|
465
|
+
class BLOB < FFI::Struct
|
466
|
+
layout \
|
467
|
+
:cbSize, :ulong,
|
468
|
+
:pBlobData, :pointer
|
469
|
+
end
|
470
|
+
|
471
|
+
class CA < FFI::Struct
|
472
|
+
layout \
|
473
|
+
:cElems, :ulong,
|
474
|
+
:pElems, :pointer
|
475
|
+
end
|
476
|
+
|
477
|
+
class DECIMAL < FFI::Struct
|
478
|
+
layout \
|
479
|
+
:wReserved, :ushort,
|
480
|
+
:scale, :uchar,
|
481
|
+
:sign, :uchar,
|
482
|
+
:Hi32, :ulong,
|
483
|
+
:Lo64, :ulong_long
|
484
|
+
end
|
485
|
+
|
486
|
+
class VARIANT < FFI::Union
|
487
|
+
include AnonymousSupport
|
488
|
+
|
489
|
+
layout \
|
490
|
+
:_, Class.new(FFI::Struct) {
|
491
|
+
layout \
|
492
|
+
:vt, :ushort,
|
493
|
+
:wReserved1, :ushort,
|
494
|
+
:wReserved2, :ushort,
|
495
|
+
:wReserved3, :ushort,
|
496
|
+
:_, Class.new(FFI::Union) {
|
497
|
+
layout \
|
498
|
+
:llVal, :long_long,
|
499
|
+
:lVal, :long,
|
500
|
+
:bVal, :uchar,
|
501
|
+
:iVal, :short,
|
502
|
+
:fltVal, :float,
|
503
|
+
:dblVal, :double,
|
504
|
+
:boolVal, :short,
|
505
|
+
:bool, :short,
|
506
|
+
:scode, :long,
|
507
|
+
:cyVal, :ulong_long,
|
508
|
+
:date, :double,
|
509
|
+
:bstrVal, :pointer,
|
510
|
+
:punkVal, :pointer,
|
511
|
+
:pdispVal, :pointer,
|
512
|
+
:parray, :pointer,
|
513
|
+
:pbVal, :pointer,
|
514
|
+
:piVal, :pointer,
|
515
|
+
:plVal, :pointer,
|
516
|
+
:pllVal, :pointer,
|
517
|
+
:pfltVal, :pointer,
|
518
|
+
:pdblVal, :pointer,
|
519
|
+
:pboolVal, :pointer,
|
520
|
+
:pbool, :pointer,
|
521
|
+
:pscode, :pointer,
|
522
|
+
:pcyVal, :pointer,
|
523
|
+
:pdate, :pointer,
|
524
|
+
:pbstrVal, :pointer,
|
525
|
+
:ppunkVal, :pointer,
|
526
|
+
:ppdispVal, :pointer,
|
527
|
+
:pparrayv, :pointer,
|
528
|
+
:pvarVal, :pointer,
|
529
|
+
:byref, :pointer,
|
530
|
+
:cVal, :char,
|
531
|
+
:uiVal, :ushort,
|
532
|
+
:ulVal, :ulong,
|
533
|
+
:ullVal, :ulong_long,
|
534
|
+
:intVal, :int,
|
535
|
+
:uintVal, :uint,
|
536
|
+
:pdecVal, :pointer,
|
537
|
+
:pcVal, :pointer,
|
538
|
+
:puiVal, :pointer,
|
539
|
+
:pulVal, :pointer,
|
540
|
+
:pullVal, :pointer,
|
541
|
+
:pintVal, :pointer,
|
542
|
+
:puintVal, :pointer,
|
543
|
+
:BRECORD, Class.new(FFI::Struct) {
|
544
|
+
layout \
|
545
|
+
:pvRecord, :pointer,
|
546
|
+
:pRecInfo, :pointer
|
547
|
+
}
|
548
|
+
}
|
549
|
+
},
|
550
|
+
|
551
|
+
:decVal, DECIMAL
|
552
|
+
end
|
553
|
+
|
554
|
+
class PROPVARIANT < FFI::Union
|
555
|
+
include AnonymousSupport
|
556
|
+
|
557
|
+
layout \
|
558
|
+
:_, Class.new(FFI::Struct) {
|
559
|
+
layout \
|
560
|
+
:vt, :ushort,
|
561
|
+
:wReserved1, :ushort,
|
562
|
+
:wReserved2, :ushort,
|
563
|
+
:wReserved3, :ushort,
|
564
|
+
:_, Class.new(FFI::Union) {
|
565
|
+
layout \
|
566
|
+
:cVal, :char,
|
567
|
+
:bVal, :uchar,
|
568
|
+
:iVal, :short,
|
569
|
+
:uiVal, :ushort,
|
570
|
+
:lVal, :long,
|
571
|
+
:ulVal, :ulong,
|
572
|
+
:intVal, :int,
|
573
|
+
:uintVal, :uint,
|
574
|
+
:hVal, LARGE_INTEGER,
|
575
|
+
:uhVal, ULARGE_INTEGER,
|
576
|
+
:fltVal, :float,
|
577
|
+
:dblVal, :double,
|
578
|
+
:boolVal, :short,
|
579
|
+
:bool, :short,
|
580
|
+
:scode, :long,
|
581
|
+
:cyVal, :long_long,
|
582
|
+
:date, :double,
|
583
|
+
:filetime, FILETIME,
|
584
|
+
:puuid, :pointer,
|
585
|
+
:pclipdata, :pointer,
|
586
|
+
:bstrVal, :pointer,
|
587
|
+
:bstrblobVal, BSTRBLOB,
|
588
|
+
:blob, BLOB,
|
589
|
+
:pszVal, :pointer,
|
590
|
+
:pwszVal, :pointer,
|
591
|
+
:punkVal, :pointer,
|
592
|
+
:pdispVal, :pointer,
|
593
|
+
:pStream, :pointer,
|
594
|
+
:pStorage, :pointer,
|
595
|
+
:pVersionedStream, :pointer,
|
596
|
+
:parray, :pointer,
|
597
|
+
:cac, CA,
|
598
|
+
:caub, CA,
|
599
|
+
:cai, CA,
|
600
|
+
:caui, CA,
|
601
|
+
:cal, CA,
|
602
|
+
:caul, CA,
|
603
|
+
:cah, CA,
|
604
|
+
:cauh, CA,
|
605
|
+
:caflt, CA,
|
606
|
+
:cadbl, CA,
|
607
|
+
:cabool, CA,
|
608
|
+
:cascode, CA,
|
609
|
+
:cacy, CA,
|
610
|
+
:cadate, CA,
|
611
|
+
:cafiletime, CA,
|
612
|
+
:cauuid, CA,
|
613
|
+
:caclipdata, CA,
|
614
|
+
:cabstr, CA,
|
615
|
+
:cabstrblob, CA,
|
616
|
+
:calpstr, CA,
|
617
|
+
:calpwstr, CA,
|
618
|
+
:capropvar, CA,
|
619
|
+
:pcVal, :pointer,
|
620
|
+
:pbVal, :pointer,
|
621
|
+
:piVal, :pointer,
|
622
|
+
:puiVal, :pointer,
|
623
|
+
:plVal, :pointer,
|
624
|
+
:pulVal, :pointer,
|
625
|
+
:pintVal, :pointer,
|
626
|
+
:puintVal, :pointer,
|
627
|
+
:pfltVal, :pointer,
|
628
|
+
:pdblVal, :pointer,
|
629
|
+
:pboolVal, :pointer,
|
630
|
+
:pdecVal, :pointer,
|
631
|
+
:pscode, :pointer,
|
632
|
+
:pcyVal, :pointer,
|
633
|
+
:pdate, :pointer,
|
634
|
+
:pbstrVal, :pointer,
|
635
|
+
:ppunkVal, :pointer,
|
636
|
+
:ppdispVal, :pointer,
|
637
|
+
:pparray, :pointer,
|
638
|
+
:pvarVal, :pointer
|
639
|
+
}
|
640
|
+
},
|
641
|
+
|
642
|
+
:decVal, DECIMAL
|
643
|
+
|
644
|
+
def self.[](t, *v) new.tap { |var| var.send("#{t}=", *v) } end
|
645
|
+
|
646
|
+
def bool; raise 'Wrong type tag.' unless self[:vt] == VT_BOOL; self[:boolVal] != 0 end
|
647
|
+
def bool=(bool) self[:vt] = VT_BOOL; self[:boolVal] = (bool) ? -1 : 0 end
|
648
|
+
|
649
|
+
def int; raise 'Wrong type tag.' unless self[:vt] == VT_I4; self[:intVal] end
|
650
|
+
def int=(int) self[:vt] = VT_I4; self[:intVal] = int end
|
651
|
+
|
652
|
+
def uint; raise 'Wrong type tag.' unless self[:vt] == VT_UI4; self[:uintVal] end
|
653
|
+
def uint=(uint) self[:vt] = VT_UI4; self[:uintVal] = uint end
|
654
|
+
|
655
|
+
def unknown
|
656
|
+
raise 'Wrong type tag.' unless self[:vt] == VT_UNKNOWN
|
657
|
+
|
658
|
+
yield Unknown.new(self[:punkVal])
|
659
|
+
ensure
|
660
|
+
Windows.PropVariantClear(self)
|
661
|
+
end
|
662
|
+
|
663
|
+
def unknown=(unknown) self[:vt] = VT_UNKNOWN; self[:punkVal] = unknown.pointer; unknown.AddRef end
|
664
|
+
|
665
|
+
def wstring; raise 'Wrong type tag.' unless self[:vt] == VT_LPWSTR; Windows.WCSTOMBS(self[:pwszVal]) end
|
666
|
+
|
667
|
+
def wstring=(string)
|
668
|
+
self[:vt] = VT_LPWSTR
|
669
|
+
|
670
|
+
FFI::MemoryPointer.new(:pointer) { |p|
|
671
|
+
Windows.DetonateHresult(:SHStrDup, string, p)
|
672
|
+
|
673
|
+
self[:pwszVal] = p.read_pointer
|
674
|
+
}
|
675
|
+
end
|
676
|
+
|
677
|
+
def decimal
|
678
|
+
raise 'Wrong type tag.' unless self[:vt] == VT_DECIMAL
|
679
|
+
|
680
|
+
Rational(self[:decVal][:Lo64], 10 ** self[:decVal][:scale]) + self[:decVal][:Hi32]
|
681
|
+
end
|
682
|
+
|
683
|
+
def decimal=(decimal) self[:vt] = VT_DECIMAL; self[:decVal][:Lo64] = decimal end
|
684
|
+
end
|
685
|
+
|
686
|
+
attach_function :PropVariantClear, [:pointer], :long
|
687
|
+
|
688
|
+
class SAFEARRAYBOUND < FFI::Struct
|
689
|
+
layout \
|
690
|
+
:cElements, :ulong,
|
691
|
+
:lLbound, :long
|
692
|
+
end
|
693
|
+
|
694
|
+
class SAFEARRAY < FFI::Struct
|
695
|
+
layout \
|
696
|
+
:cDims, :ushort,
|
697
|
+
:fFeatures, :ushort,
|
698
|
+
:cbElements, :ulong,
|
699
|
+
:cLocks, :ulong,
|
700
|
+
:pvData, :pointer,
|
701
|
+
:rgsabound, [SAFEARRAYBOUND, 1]
|
702
|
+
end
|
703
|
+
|
704
|
+
ffi_lib 'oleaut32'
|
705
|
+
ffi_convention :stdcall
|
706
|
+
|
707
|
+
attach_function :SysAllocString, [:buffer_in], :pointer
|
708
|
+
attach_function :SysFreeString, [:pointer], :void
|
709
|
+
attach_function :SysStringLen, [:pointer], :uint
|
710
|
+
|
711
|
+
attach_function :SafeArrayCreateVector, [:ushort, :long, :uint], :pointer
|
712
|
+
attach_function :SafeArrayDestroy, [:pointer], :long
|
713
|
+
attach_function :SafeArrayAccessData, [:pointer, :pointer], :long
|
714
|
+
attach_function :SafeArrayUnaccessData, [:pointer], :long
|
715
|
+
|
716
|
+
OLEIVERB_PRIMARY = 0
|
717
|
+
OLEIVERB_SHOW = -1
|
718
|
+
OLEIVERB_OPEN = -2
|
719
|
+
OLEIVERB_HIDE = -3
|
720
|
+
OLEIVERB_UIACTIVATE = -4
|
721
|
+
OLEIVERB_INPLACEACTIVATE = -5
|
722
|
+
OLEIVERB_DISCARDUNDOSTATE = -6
|
723
|
+
|
724
|
+
IOleWindow = COM::Interface[IUnknown,
|
725
|
+
GUID['00000114-0000-0000-C000-000000000046'],
|
726
|
+
|
727
|
+
GetWindow: [[:pointer], :long],
|
728
|
+
ContextSensitiveHelp: [[:int], :long]
|
729
|
+
]
|
730
|
+
|
731
|
+
OleWindow = COM::Instance[IOleWindow]
|
732
|
+
|
733
|
+
IOleInPlaceObject = COM::Interface[IOleWindow,
|
734
|
+
GUID['00000113-0000-0000-C000-000000000046'],
|
735
|
+
|
736
|
+
InPlaceDeactivate: [[], :long],
|
737
|
+
UIDeactivate: [[], :long],
|
738
|
+
SetObjectRects: [[:pointer, :pointer], :long],
|
739
|
+
ReactivateAndUndo: [[], :long]
|
740
|
+
]
|
741
|
+
|
742
|
+
OleInPlaceObject = COM::Instance[IOleInPlaceObject]
|
743
|
+
|
744
|
+
IOleInPlaceSite = COM::Interface[IOleWindow,
|
745
|
+
GUID['00000119-0000-0000-C000-000000000046'],
|
746
|
+
|
747
|
+
CanInPlaceActivate: [[], :long],
|
748
|
+
OnInPlaceActivate: [[], :long],
|
749
|
+
OnUIActivate: [[], :long],
|
750
|
+
GetWindowContext: [[:pointer, :pointer, :pointer, :pointer, :pointer], :long],
|
751
|
+
Scroll: [[:long_long], :long],
|
752
|
+
OnUIDeactivate: [[:int], :long],
|
753
|
+
OnInPlaceDeactivate: [[], :long],
|
754
|
+
DiscardUndoState: [[], :long],
|
755
|
+
DeactivateAndUndo: [[], :long],
|
756
|
+
OnPosRectChange: [[:pointer], :long]
|
757
|
+
]
|
758
|
+
|
759
|
+
OleInPlaceSite = COM::Callback[IOleInPlaceSite]
|
760
|
+
|
761
|
+
IOleClientSite = COM::Interface[IUnknown,
|
762
|
+
GUID['00000118-0000-0000-C000-000000000046'],
|
763
|
+
|
764
|
+
SaveObject: [[], :long],
|
765
|
+
GetMoniker: [[:ulong, :ulong, :pointer], :long],
|
766
|
+
GetContainer: [[:pointer], :long],
|
767
|
+
ShowObject: [[], :long],
|
768
|
+
OnShowWindow: [[:int], :long],
|
769
|
+
RequestNewObjectLayout: [[], :long]
|
770
|
+
]
|
771
|
+
|
772
|
+
OleClientSite = COM::Callback[IOleClientSite]
|
773
|
+
|
774
|
+
OLEGETMONIKER_ONLYIFTHERE = 1
|
775
|
+
OLEGETMONIKER_FORCEASSIGN = 2
|
776
|
+
OLEGETMONIKER_UNASSIGN = 3
|
777
|
+
OLEGETMONIKER_TEMPFORUSER = 4
|
778
|
+
|
779
|
+
OLEWHICHMK_CONTAINER = 1
|
780
|
+
OLEWHICHMK_OBJREL = 2
|
781
|
+
OLEWHICHMK_OBJFULL = 3
|
782
|
+
|
783
|
+
USERCLASSTYPE_FULL = 1
|
784
|
+
USERCLASSTYPE_SHORT = 2
|
785
|
+
USERCLASSTYPE_APPNAME = 3
|
786
|
+
|
787
|
+
OLEMISC_RECOMPOSEONRESIZE = 0x00000001
|
788
|
+
OLEMISC_ONLYICONIC = 0x00000002
|
789
|
+
OLEMISC_INSERTNOTREPLACE = 0x00000004
|
790
|
+
OLEMISC_STATIC = 0x00000008
|
791
|
+
OLEMISC_CANTLINKINSIDE = 0x00000010
|
792
|
+
OLEMISC_CANLINKBYOLE1 = 0x00000020
|
793
|
+
OLEMISC_ISLINKOBJECT = 0x00000040
|
794
|
+
OLEMISC_INSIDEOUT = 0x00000080
|
795
|
+
OLEMISC_ACTIVATEWHENVISIBLE = 0x00000100
|
796
|
+
OLEMISC_RENDERINGISDEVICEINDEPENDENT = 0x00000200
|
797
|
+
OLEMISC_INVISIBLEATRUNTIME = 0x00000400
|
798
|
+
OLEMISC_ALWAYSRUN = 0x00000800
|
799
|
+
OLEMISC_ACTSLIKEBUTTON = 0x00001000
|
800
|
+
OLEMISC_ACTSLIKELABEL = 0x00002000
|
801
|
+
OLEMISC_NOUIACTIVATE = 0x00004000
|
802
|
+
OLEMISC_ALIGNABLE = 0x00008000
|
803
|
+
OLEMISC_SIMPLEFRAME = 0x00010000
|
804
|
+
OLEMISC_SETCLIENTSITEFIRST = 0x00020000
|
805
|
+
OLEMISC_IMEMODE = 0x00040000
|
806
|
+
OLEMISC_IGNOREACTIVATEWHENVISIBLE = 0x00080000
|
807
|
+
OLEMISC_WANTSTOMENUMERGE = 0x00100000
|
808
|
+
OLEMISC_SUPPORTSMULTILEVELUNDO = 0x00200000
|
809
|
+
|
810
|
+
OLECLOSE_SAVEIFDIRTY = 0
|
811
|
+
OLECLOSE_NOSAVE = 1
|
812
|
+
OLECLOSE_PROMPTSAVE = 2
|
813
|
+
|
814
|
+
IOleObject = COM::Interface[IUnknown,
|
815
|
+
GUID['00000112-0000-0000-C000-000000000046'],
|
816
|
+
|
817
|
+
SetClientSite: [[:pointer], :long],
|
818
|
+
GetClientSite: [[:pointer], :long],
|
819
|
+
SetHostNames: [[:pointer, :pointer], :long],
|
820
|
+
Close: [[:ulong], :long],
|
821
|
+
SetMoniker: [[:ulong, :pointer], :long],
|
822
|
+
GetMoniker: [[:ulong, :ulong, :pointer], :long],
|
823
|
+
InitFromData: [[:pointer, :int, :ulong], :long],
|
824
|
+
GetClipboardData: [[:ulong, :pointer], :long],
|
825
|
+
DoVerb: [[:long, :pointer, :pointer, :long, :pointer, :pointer], :long],
|
826
|
+
EnumVerbs: [[:pointer], :long],
|
827
|
+
Update: [[], :long],
|
828
|
+
IsUpToDate: [[], :long],
|
829
|
+
GetUserClassID: [[:pointer], :long],
|
830
|
+
GetUserType: [[:ulong, :pointer], :long],
|
831
|
+
SetExtent: [[:ulong, :pointer], :long],
|
832
|
+
GetExtent: [[:ulong, :pointer], :long],
|
833
|
+
Advise: [[:pointer, :pointer], :long],
|
834
|
+
Unadvise: [[:ulong], :long],
|
835
|
+
EnumAdvise: [[:pointer], :long],
|
836
|
+
GetMiscStatus: [[:ulong, :pointer], :long],
|
837
|
+
SetColorScheme: [[:pointer], :long]
|
838
|
+
]
|
839
|
+
|
840
|
+
OleObject = COM::Instance[IOleObject]
|
841
|
+
|
842
|
+
class PARAMDATA < FFI::Struct
|
843
|
+
layout \
|
844
|
+
:szName, :pointer,
|
845
|
+
:vt, :ushort
|
846
|
+
end
|
847
|
+
|
848
|
+
CC_FASTCALL = 0
|
849
|
+
CC_CDECL = 1
|
850
|
+
CC_MSCPASCAL = CC_CDECL + 1
|
851
|
+
CC_PASCAL = CC_MSCPASCAL
|
852
|
+
CC_MACPASCAL = CC_PASCAL + 1
|
853
|
+
CC_STDCALL = CC_MACPASCAL + 1
|
854
|
+
CC_FPFASTCALL = CC_STDCALL + 1
|
855
|
+
CC_SYSCALL = CC_FPFASTCALL + 1
|
856
|
+
CC_MPWCDECL = CC_SYSCALL + 1
|
857
|
+
CC_MPWPASCAL = CC_MPWCDECL + 1
|
858
|
+
CC_MAX = CC_MPWPASCAL + 1
|
859
|
+
|
860
|
+
DISPATCH_METHOD = 0x1
|
861
|
+
DISPATCH_PROPERTYGET = 0x2
|
862
|
+
DISPATCH_PROPERTYPUT = 0x4
|
863
|
+
DISPATCH_PROPERTYPUTREF = 0x8
|
864
|
+
|
865
|
+
class METHODDATA < FFI::Struct
|
866
|
+
layout \
|
867
|
+
:szName, :pointer,
|
868
|
+
:ppdata, :pointer,
|
869
|
+
:dispid, :long,
|
870
|
+
:iMeth, :uint,
|
871
|
+
:cc, :uint,
|
872
|
+
:cArgs, :uint,
|
873
|
+
:wFlags, :ushort,
|
874
|
+
:vtReturn, :ushort
|
875
|
+
end
|
876
|
+
|
877
|
+
class INTERFACEDATA < FFI::Struct
|
878
|
+
layout \
|
879
|
+
:pmethdata, :pointer,
|
880
|
+
:cMembers, :uint
|
881
|
+
end
|
882
|
+
|
883
|
+
attach_function :CreateDispTypeInfo, [:pointer, :ulong, :pointer], :long
|
884
|
+
|
885
|
+
class DISPPARAMS < FFI::Struct
|
886
|
+
layout \
|
887
|
+
:rgvarg, :pointer,
|
888
|
+
:rgdispidNamedArgs, :pointer,
|
889
|
+
:cArgs, :uint,
|
890
|
+
:cNamedArgs, :uint
|
891
|
+
end
|
892
|
+
|
893
|
+
attach_function :DispInvoke, [:pointer, :pointer, :long, :ushort, :pointer, :pointer, :pointer, :pointer], :long
|
275
894
|
end
|
276
895
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unknownr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
|
-
-
|
8
|
+
- 2
|
8
9
|
- 0
|
9
|
-
version: 0.
|
10
|
+
version: 0.2.0
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Radoslav Peev
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-10-08 00:00:00 +03:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
@@ -25,6 +26,7 @@ dependencies:
|
|
25
26
|
requirements:
|
26
27
|
- - ~>
|
27
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 1
|
28
30
|
segments:
|
29
31
|
- 0
|
30
32
|
- 6
|
@@ -42,6 +44,7 @@ extra_rdoc_files: []
|
|
42
44
|
|
43
45
|
files:
|
44
46
|
- lib/unknownr.rb
|
47
|
+
- examples/DesktopGadget.rbw
|
45
48
|
- LICENSE
|
46
49
|
has_rdoc: true
|
47
50
|
homepage:
|
@@ -57,6 +60,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
57
60
|
requirements:
|
58
61
|
- - ">="
|
59
62
|
- !ruby/object:Gem::Version
|
63
|
+
hash: 3
|
60
64
|
segments:
|
61
65
|
- 0
|
62
66
|
version: "0"
|
@@ -65,6 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
69
|
requirements:
|
66
70
|
- - ">="
|
67
71
|
- !ruby/object:Gem::Version
|
72
|
+
hash: 3
|
68
73
|
segments:
|
69
74
|
- 0
|
70
75
|
version: "0"
|