-
Notifications
You must be signed in to change notification settings - Fork 2
/
DLGMAIN1.BI
1222 lines (1126 loc) · 37.8 KB
/
DLGMAIN1.BI
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Function FileFound(mes As String) As Integer
Dim As Integer myHandle , fileSize, result
If mes = "" Then Return 0
myHandle = Freefile()
result = Open (mes For Binary Access Read As #myHandle )
If result <> 0 Then
Close #myHandle
Function = 0
Exit Function
End If
fileSize = LOF(myHandle)
Close #myHandle
If fileSize=0 Then
Function = 0
kill mes
Sleep 10
Exit Function
End If
Sleep 50
Function = 1
End Function
function idem_prefix(hwin as hwnd) as integer
dim prefix1 as zstring *11,prefix0 as zstring *11
dim as integer i1=0
getwindowtext getdlgitem(hwin, idc_edt1), prefix1, 10
prefix0=prefix
prefix1=trim(prefix1)
if LEN(SelPath) > 0 Then
if prefix1 = prefix0 THEN i1 = 1
end if
prefix=prefix1
function= i1
'print "function= " & i1 & " prefix0 >" & prefix0 & "< prefix >" & prefix1 & "<"
END FUNCTION
Function FF_ClipboardSetText(ByVal Text As String) As Long
Var hGlobalClip = GlobalAlloc(GMEM_MOVEABLE Or GMEM_SHARE, Len(Text) + 1)
If OpenClipboard(0) Then
EmptyClipboard()
Var lpMem = GlobalLock(hGlobalClip)
If lpMem Then
CopyMemory(lpMem, StrPtr(Text), Len(text))
GlobalUnlock(lpMem)
Function = cast(long, SetClipboardData(CF_TEXT, hGlobalClip))
End If
CloseClipboard()
else
Function = 0
End If
End Function
Sub mkInit()
sevent=""
sreport = Ini_templ()
showinfo
END SUB
Sub mkvident
Dim b As zString Ptr
sevent=""
sreport= Ini_templ()
b = EnumCoClass1(cast(long, htree), hparent(), 0, "", "")
sreport &= *b :sysfreestring(cast(BSTR, b))
if xret1=0 then
' b = EnumModel(cast(long, htree), hparent())
' sreport &= *b :sysfreestring(cast(BSTR, b))
end if
xret1=0
xfull=0
showinfo
End Sub
Sub mkuOcx1
Dim b As zString Ptr
sevent=""
b = EnumCoClass3(cast(long, htree), hparent())
sreport = *b :sysfreestring(cast(BSTR, b))
xret1=0
xfull=0
showinfo
End Sub
Sub mkuOcx2
Dim b As zString Ptr
sevent=""
b = EnumCoClass3(cast(long, htree), hparent())
sreport = *b :sysfreestring(cast(BSTR, b))
xret1=0
xfull=0
showinfo
End Sub
Sub mkConstant
Dim b As zString Ptr
sevent=""
b = EnumEnum(cast(long, htree), hparent())
sreport = *b :sysfreestring(cast(BSTR, b))
b = EnumUnion(cast(long, htree), hparent())
sreport &= *b :sysfreestring(cast(BSTR, b))
b = EnumAlias(cast(long, htree), hparent())
sreport &= *b :sysfreestring(cast(BSTR, b))
b = EnumRecord(cast(long, htree), hparent())
sreport &= *b :sysfreestring(cast(BSTR, b))
showinfo
End Sub
function verif(s1 as string) as string
dim as integer i1, i2
notsure = 0
i1 = instr(s1, "_Events_Disconnect")
if i1 = 0 THEN
function = ""
exit function
END IF
i2 = InStrRev(s1, "Function ", i1)
if i2 = 0 THEN
function = ""
exit function
END IF
if instr(i1 + 18, s1, "_Events_Disconnect") THEN
function = mid(s1, i2 + 9, i1 - (i2 + 9))
notsure = 1
exit function
END IF
function = mid(s1, i2 + 9, i1 - (i2 + 9))
END Function
'Sub mkFull2
' Dim b As zString Ptr
' dim as string s1, s2, s3
' xfull = 1
' 'print "EnumEvent xfull = " & xfull
' b = EnumEvent(cast(long, htree), hparent())
' s1 = *b :sysfreestring(cast(BSTR, b))
' s2 = verif(s1)
' 'print "EnumModel"
' 'b = EnumModel(cast(long, htree), hparent())
' 's3= *b :sysfreestring(cast(BSTR, b))
' if s1 = "" or s2 = "" THEN
' s1 = ""
' 'print "EnumCoClass1 _1"
' b = EnumCoClass1(cast(long, htree), hparent(), 0, "", "")
' else
' 'print "EnumCoClass1 _2"
' b = EnumCoClass1(cast(long, htree), hparent(), 1 , s2 & "_Events_Connect", s2 & "_Events_Disconnect")
' END IF
' sreport = "'===== classe(s)" & chr(13, 10) & chr(13, 10) & *b :sysfreestring(cast(BSTR, b))
' sreport &= s3
' sreport &= s1
' showinfo
' xfull = 0
'End sub
Sub mkFull
Dim b As zString Ptr
dim as string s1, s2, s3
sevent=""
EnumCoClassB (cast(long, htree), hparent())
sreport= Ini_templ()
b = EnumEvent(cast(long, htree), hparent())
s1 = *b :sysfreestring(cast(BSTR, b))
s2 = verif(s1)
'b = EnumModel(cast(long, htree), hparent())
's3= *b :sysfreestring(cast(BSTR, b))
if s1 = "" or s2 = "" THEN
s1 = ""
b = EnumCoClass1(cast(long, htree), hparent(), 0, "", "")
else
if xret2=0 then
b = EnumCoClass1(cast(long, htree), hparent(), 1 , s2 & "_Events_Connect", s2 & "_Events_Disconnect")
else
b = EnumCoClass1(cast(long, htree), hparent(), 0, "", "")
end if
END IF
sreport &= *b :sysfreestring(cast(BSTR, b))
if xret1=0 then
sreport &= s3
if s2<>"" and xret2=0 then
sreport &= s1
elseif s2<>"" then
sreport &= crlf & "' Events are not shown, you must select the only Interface : CoClass you need" & crlf & crlf
end if
end if
xret2=0
xret1=0
showinfo
End sub
Sub mkModule
Dim b As zString Ptr
sevent=""
b = EnumModule(cast(long, htree), hparent())
sreport = *b :sysfreestring(cast(BSTR, b))
showinfo
end sub
Sub kDisp
Dim b As zString Ptr
sevent=""
sreport= Ini_templ()
b = EnumCoClass1(cast(long, htree), hparent(), 0, "", "")
sreport &= *b :sysfreestring(cast(BSTR, b))
if xret1=0 then
'b = EnumInvoke1(cast(long, htree), hparent())
'sreport &= *b :sysfreestring(cast(BSTR, b))
end if
xret1=0
xfull=0
showinfo
End Sub
Sub kDisp2
Dim b As zString Ptr
dim as string s1, s2, s3
sevent=""
EnumCoClassB (cast(long, htree), hparent())
sreport= Ini_templ()
b = EnumEvent(cast(long, htree), hparent())
s1 = *b :sysfreestring(cast(BSTR, b))
s2 = verif(s1)
'b = EnumInvoke1(cast(long, htree), hparent())
's3= *b :sysfreestring(cast(BSTR, b))
if s1 = "" or s2 = "" THEN
s1 = ""
b = EnumCoClass1(cast(long, htree), hparent(), 0, "", "")
else
if xret2=0 then
b = EnumCoClass1(cast(long, htree), hparent(), 1 , s2 & "_Events_Connect", s2 & "_Events_Disconnect")
else
b = EnumCoClass1(cast(long, htree), hparent(), 0, "", "")
end if
END IF
sreport &= *b :sysfreestring(cast(BSTR, b))
if xret1=0 then
sreport &= s3
if s2<>"" and xret2=0 then
sreport &= s1
elseif s2<>"" then
sreport &= crlf & "' Events are not shown, you must select the only Interface : CoClass you need" & crlf & crlf
end if
end if
xret2=0
xret1=0
showinfo
End sub
'Sub mkDisp2
' Dim b As zString Ptr
' dim as string s1, s2, s3
' xfull = 1
' b = EnumEvent(cast(long, htree), hparent())
' s1 = *b :sysfreestring(cast(BSTR, b))
' s2 = verif(s1)
' 'b = EnumInvoke1(cast(long, htree), hparent())
' 's3= *b :sysfreestring(cast(BSTR, b))
' if s1 = "" or s2 = "" THEN
' s1 = ""
' 'print "EnumCoClass1 _1"
' b = EnumCoClass1(cast(long, htree), hparent(), 0, "", "")
' else
' 'print "EnumCoClass1 _2"
' b = EnumCoClass1(cast(long, htree), hparent(), 1 , s2 & "_Events_Connect", s2 & "_Events_Disconnect")
' END IF
' sreport = "'===== classe(s)" & chr(13, 10) & chr(13, 10) & *b :sysfreestring(cast(BSTR, b))
' sreport &= s3
' sreport &= s1
' showinfo
' xfull = 0
'end sub
Sub mkvtable
Dim b As zString Ptr
sevent=""
b = EnumCoClass(cast(long, htree), hparent())
sreport = *b :sysfreestring(cast(BSTR, b))
b = EnumvTable(cast(long, htree), hparent())
sreport &= *b :sysfreestring(cast(BSTR, b))
showinfo
End Sub
Sub mkInvoke
Dim b As zString Ptr
sevent=""
b = EnumCoClass(cast(long, htree), hparent())
sreport = *b :sysfreestring(cast(BSTR, b))
b = EnumInvoke(cast(long, htree), hparent())
sreport &= *b :sysfreestring(cast(BSTR, b))
showinfo
End Sub
Sub mkEvent
Dim b As zString Ptr
sevent=""
b = EnumEvent(cast(long, htree), hparent())
sreport = *b :sysfreestring(cast(BSTR, b))
showinfo
End Sub
sub dlgMain_IDC_TAB1_Sample(byval hWin as hwnd, byval CTLID as integer)
dim hCTLID as hwnd
dim ts as TCITEM
'Creating Tab
hCTLID = GetDlgItem(hWin, CTLID)
ts.mask = TCIF_TEXT
ts.pszText = StrPtr( "Registered")
SendMessage(hCTLID, TCM_INSERTITEM, 0, cast(lparam, @ts))
ts.pszText = StrPtr( "Tree ")
SendMessage(hCTLID, TCM_INSERTITEM, 1, cast(lparam, @ts))
ts.pszText = StrPtr( "Code ")
SendMessage(hCTLID, TCM_INSERTITEM, 2, cast(lparam, @ts))
hTab0 = CreateDialogParam(hinstance, cast(LPCTSTR, dlgList), hCTLID, @dlgList_DlgProc, 0)
hTab1 = CreateDialogParam(hinstance, cast(LPCTSTR, dlgTree), hCTLID, @dlgTree_DlgProc, 0)
hTab2 = CreateDialogParam(hinstance, cast(LPCTSTR, dlgCode), hCTLID, @dlgCode_dlgProc, 0)
ShowWindow(hTab0, SW_SHOW)
ShowWindow(hTab1, SW_HIDE)
ShowWindow(hTab2, SW_HIDE)
end sub
Function dlgMain_Init(Byval hWin as hwnd, Byval wParam as wParam, Byval lParam as lParam) as Integer
Dim hicon As Integer
hinstance = cast(hinstance, getwindowlong(hwin, gwl_hInstance))
hmain = hwin
hIcon = cast(integer, LoadIcon(hinstance, cast(LPCTSTR, 100)))
SendMessage hwin, WM_SETICON, ICON_SMALL, hIcon
dlgMain_IDC_TAB1_Sample(hWin, IDC_TAB1)
TabCtrl_GetItemRect(getdlgitem(hwin, idc_tab1), 2, @rtab)
movewindow(getdlgitem(hwin, idc_stc3), rtab.right + 25, rtab.top, 40, 18, TRUE)
movewindow(getdlgitem(hwin, idc_edt1), rtab.right + 68, rtab.top, 100, 18, TRUE)
SearchTypeLibs
' InvalidateRect hmain, ByVal 0, True
' UpdateWindow hmain
listview_setcolumnwidth(hlist, 1, LVSCW_AUTOSIZE)
function = 0
End Function
Function dlgMain_OnSize(Byval hWin as hwnd, Byval lState as long, Byval cx as long, Byval cy as long) as Integer
movewindow(getdlgitem(hwin, idc_tab1), 0, 0, cx, cy, TRUE)
movewindow(htab0, 0, 22, cx, cy - 43, TRUE)
movewindow(htab1, 0, 22, cx, cy - 43, TRUE)
movewindow(htab2, 0, 22, cx, cy - 43, TRUE)
movewindow(getdlgitem(hwin, IDC_SBR1), 6 , cy-12, cx-20, 12, TRUE)
function = 0
End Function
Function dlgMain_OnClose(Byval hWin as hwnd) as Integer
function = 0
End Function
Function dlgMain_OnDestroy(Byval hWin as hwnd) as Integer
function = 0
End Function
Function dlgMain_OnNotify(Byval hWin as hwnd, Byval lCtlID as long, Byval lpNMHDR as NMHDR ptr, Byref lresult as long) as Integer
function = 0
End Function
Function dlgMain_OnTimer(Byval hWin as hwnd, Byval wTimerID as word) as Integer
function = 0
End Function
Function dlgMain_IDC_TAB1_SelChange(byval hWin as hwnd, byval lpNMHDR as NMHDR ptr, Byref lresult as long) as long
dim TabID as Long
dim hIDC_TAB1 as hwnd
hIDC_TAB1 = getdlgitem(hWin, IDC_TAB1)
TabID = SendMessage(hIDC_TAB1, TCM_GETCURSEL, 0, 0)
select case TabID
case 0
ShowWindow(hTab0, SW_SHOW)
ShowWindow(hTab1, SW_HIDE)
ShowWindow(hTab2, SW_HIDE)
ShowWindow(GetDlgItem(hWin, IDC_STC31), SW_SHOW)
ShowWindow(GetDlgItem(hWin, IDC_EDT31), SW_SHOW)
setfocus hlist
exit function
Case 1
ShowWindow(hTab0, SW_HIDE)
ShowWindow(hTab1, SW_SHOW)
ShowWindow(hTab2, SW_HIDE)
ShowWindow(GetDlgItem(hWin, IDC_STC31), SW_HIDE)
ShowWindow(GetDlgItem(hWin, IDC_EDT31), SW_HIDE)
setfocus htree
exit function
Case 2
ShowWindow(hTab0, SW_HIDE)
ShowWindow(hTab1, SW_HIDE)
ShowWindow(hTab2, SW_SHOW)
ShowWindow(GetDlgItem(hWin, IDC_STC31), SW_HIDE)
ShowWindow(GetDlgItem(hWin, IDC_EDT31), SW_HIDE)
setfocus hcode
exit function
end select
function = 0
End function
Function dlgMain_IDC_TAB1_SelChanging(byval hWin as hwnd, byval lpNMHDR as NMHDR ptr, Byref lresult as long) as long
dim TabID as Long
dim hIDC_TAB1 as hwnd
hIDC_TAB1 = getdlgitem(hWin, IDC_TAB1)
TabID = SendMessage(hIDC_TAB1, TCM_GETCURSEL, 0, 0)
select case TabID
case 0
'ShowWindow(hTabDlg0,SW_HIDE)
case 1
'ShowWindow(hTabDlg1,SW_HIDE)
end select
function = 0
End Function
Sub chgtab(ByVal p As Integer)
Dim nmh As nmhdr
nmh.hwndfrom = getdlgitem(hmain, idc_tab1)
nmh.idfrom = idc_tab1
nmh.code = TCN_SELCHANGE
sendmessage getdlgitem(hmain, idc_tab1), TCM_SETCURSEL, p, 0
sendmessage getdlgitem(hmain, idc_tab1), WM_NOTIFY, idc_tab1, cast(lparam, @nmh)
If p = 1 Then
treeview_setcheckstate(cast(long, htree), cast(long, TreeView_GetChild(hTree, 0)), 1)
treeview_changechildstate(cast(long, htree), cast(long, TreeView_GetChild(hTree, 0)), 1)
End If
End Sub
Sub chgtab1()
treeview_setcheckstate(cast(long, htree), cast(long, TreeView_GetChild(hTree, 0)), 1)
treeview_changechildstate(cast(long, htree), cast(long, TreeView_GetChild(hTree, 0)), 1)
End Sub
Function dlgMain_IDR_MENU1_menu(byval hwin as hwnd, byval id as long) as Long
dim as OPENFILENAME ofn
dim as zstring*max_path pathfilename
dim as zstring * max_path fstatic1,fstatic2
dim as string fsave
Dim dllpath As String
dim as string str1
dim as string sitem,Newvar
dim as integer r1
Select Case id
Case regf
ofn.lStructSize = sizeof(OPENFILENAME)
ofn.hwndOwner = hwin
ofn.hInstance = cast(hinstance, GetWindowLong(hwin, GWL_HINSTANCE))
ofn.lpstrFile = @pathFileName
ofn.nMaxFile = 260
ofn.lpstrFilter = @szOpen
ofn.Flags = OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST
if GetOpenFileName(@ofn) Then sitem = pathfilename
IF LEN(sitem) Then
r1=RegisterServer(hwin, sitem, 1)
if r1 <> 0 then
MessageBox getactiveWindow(), "Unable to Register " & crlf & crlf & sitem, _
"Error", MB_OK OR MB_ICONERROR OR MB_TASKMODAL
else
MessageBox getactiveWindow(), "Registered ! " & crlf & crlf & sitem, _
"Done", MB_OK OR MB_ICONINFORMATION OR MB_TASKMODAL
SearchTypeLibs
searching = str_parse(sitem, "\", str_numparse(sitem, "\"))
SetWindowText GetDlgItem(hWin, IDC_EDT31),searching
if searching <> "" THEN search1()
setfocus GetDlgItem(hWin, IDC_EDT31)
End If
End If
exit function
Case unregl
chgtab(0)
dim as integer irow = FF_ListView_GetSelectedItem(hList)
'messagebox 0 , "selected pos = " & str(irow),"Warning",mb_ok
if irow > - 1 THEN
sitem = FF_ListView_GetItemText(hList, irow, 3)
IF LEN(sitem) Then
r1=MessageBox (getactiveWindow(), "Are you sure, you want to unregister : " & crlf & crlf _
& sitem, "Confirmation", MB_YESNO OR MB_ICONWARNING OR MB_TASKMODAL )
if r1= IDYES THEN
r1=RegisterServer(hwin, sitem, 0)
if r1 <> 0 then
MessageBox getactiveWindow(), "Unable to Unregister " & crlf & crlf & sitem, _
"Error", MB_OK OR MB_ICONERROR OR MB_TASKMODAL
else
MessageBox getactiveWindow(), "Unregistered ! " & crlf & crlf & sitem, _
"Done", MB_OK OR MB_ICONINFORMATION OR MB_TASKMODAL
cleartli
selpath=""
SearchTypeLibs
searching=""
sendmessage GetDlgItem(hmain, IDC_SBR1),WM_SETTEXT ,0,cast(lparam,strptr("Nothing selected"))
SetWindowText GetDlgItem(hWin, IDC_EDT31), ""
setfocus GetDlgItem(hWin, IDC_EDT31)
End If
end if
End If
else
MessageBox getactiveWindow(), "Nothing selected " & crlf & crlf & "Selec a line, please" , _
"Error", MB_OK OR MB_ICONERROR OR MB_TASKMODAL
End If
exit function
case tlb_reged
SearchTypeLibs
' InvalidateRect hmain, ByVal 0, True
' UpdateWindow hmain
exit function
Case tlb_libfile
ofn.lStructSize = sizeof(OPENFILENAME)
ofn.hwndOwner = hwin
ofn.hInstance = cast(hinstance, GetWindowLong(hwin, GWL_HINSTANCE))
ofn.lpstrFile = @pathFileName
ofn.nMaxFile = 260
ofn.lpstrFilter = @szOpen
ofn.Flags = OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST
if GetOpenFileName(@ofn) Then selpath = pathfilename
IF LEN(SelPath) Then
clsids = ""
tldesc = ""
cleartli
IF LoadtypeLib(stringtobstr(selpath), @ptli) Then
MessageBox BYVAL NULL, "Unable to load " & SelPath, _
"Error", MB_OK OR MB_ICONERROR OR MB_TASKMODAL
Else
LoadTLI
chgtab(1)
treeview_select(htree, hparent(0), TVGN_CARET)
End If
End If
exit function
case tlb_exit
EndDialog(hWin, 0)
exit function
Case code_init
' if idem_prefix(hWin)= 0 then
' r1=force_click(hWin)
' if r1=0 THEN exit Function
' END IF
savepath = "Init"
sinfcode = "Init Code"
mkInit()
chgtab(2)
gene1 = code_init
exit function
Case uOcx1 '10020
iscod=0
if idem_prefix(hWin) = 0 then
r1 = force_click(hWin)
if r1 = 0 THEN exit Function
END IF
savepath = "Unreg_Win"
sinfcode = "Unregistered Visual Control"
nowin=0
mkuOcx2
chgtab(2)
gene1 = uOcx1
exit function
Case uOcx2 '10021
iscod=0
if idem_prefix(hWin) = 0 then
r1 = force_click(hWin)
if r1 = 0 THEN exit Function
END IF
savepath = "Unreg_NoWin"
sinfcode = "Unregistered Not-Visual Control"
nowin=1
mkuOcx2
chgtab(2)
gene1 = uOcx2
exit function
Case code_ident
iscod=0
if idem_prefix(hWin) = 0 then
r1 = force_click(hWin)
if r1 = 0 THEN exit Function
END IF
savepath = "Win_noEv"
sinfcode = "Visual Control"
nowin=0
mkvident
chgtab(2)
gene1 = code_ident
exit function
case code_const
iscod=0
if idem_prefix(hWin) = 0 then
r1 = force_click(hWin)
if r1 = 0 THEN exit Function
END IF
savepath = "Constant"
sinfcode = "Constants Code"
mkconstant
chgtab(2)
gene1 = code_const
exit function
Case code_Disp
iscod=0
if idem_prefix(hWin) = 0 then
r1 = force_click(hWin)
if r1 = 0 THEN exit Function
END IF
savepath = "noWin_noEv"
sinfcode = "Not-Visual Control"
nowin=1
kDisp
chgtab(2)
gene1 = code_Disp
exit function
Case code_Disp2
iscod=0
if idem_prefix(hWin) = 0 then
r1 = force_click(hWin)
if r1 = 0 THEN exit Function
END IF
savepath = "noWin_Ev"
sinfcode = "Not-Visual Control + Events"
nowin=1
kDisp2
chgtab(2)
gene1 = code_Disp2
exit function
' Case code_mkDisp2
' if idem_prefix(hWin) = 0 then
' r1 = force_click(hWin)
' if r1 = 0 THEN exit Function
' END IF
' savepath = "Inv-Full_disp"
' mkDisp2
' chgtab(2)
' gene1 = code_mkDisp2
Case code_full
iscod=0
if idem_prefix(hWin) = 0 then
r1 = force_click(hWin)
if r1 = 0 THEN exit Function
END IF
savepath = "Win_Ev"
sinfcode = "Visual Control + Events"
nowin=0
mkFull
chgtab(2)
gene1 = code_full
exit function
' Case code_full2
' if idem_prefix(hWin) = 0 then
' r1 = force_click(hWin)
' if r1 = 0 THEN exit Function
' END IF
' savepath = "vt_Full_disp"
' mkFull2
' chgtab(2)
' gene1 = code_full2
Case code_Module
iscod=0
if idem_prefix(hWin) = 0 then
r1 = force_click(hWin)
if r1 = 0 THEN exit Function
END IF
savepath = "Module"
sinfcode = "Module Code"
mkModule
chgtab(2)
gene1 = code_Module
exit function
Case code_vTable
iscod=0
if idem_prefix(hWin) = 0 then
r1 = force_click(hWin)
if r1 = 0 THEN exit Function
END IF
savepath = "vTable"
sinfcode = "vTable Code"
mkvtable
chgtab(2)
gene1 = code_vTable
exit function
case code_Invoke
iscod=0
if idem_prefix(hWin) = 0 then
r1 = force_click(hWin)
if r1 = 0 THEN exit Function
END IF
savepath = "Invoke"
sinfcode = "Invoke Code"
mkInvoke
chgtab(2)
gene1 = code_Invoke
exit function
case code_event
iscod=0
if idem_prefix(hWin) = 0 then
r1 = force_click(hWin)
if r1 = 0 THEN exit Function
END IF
savepath = "Event"
sinfcode = "Events Code"
mkEvent
chgtab(2)
gene1 = code_event
exit function
Case code_save
if sreport <> "" then
str1 = trim(prefix, any "-_ ")
if str1 <> "" THEN
str1 = trim(str1, any "-_ ")
if str1 <> "" THEN str1 = str1 & "_"
END IF
pathfilename = str1 & str_parse(str_parse(selpath, "\", str_numparse(selpath, "\")), ".", 1)
pathfilename &= "_" & savepath & ".bi"
ofn.lStructSize = sizeof(OPENFILENAME)
ofn.hwndOwner = hwin
ofn.hInstance = cast(hinstance, GetWindowLong(hwin, GWL_HINSTANCE))
ofn.lpstrFile = @pathFileName
ofn.nMaxFile = 260
ofn.lpstrFilter = @szSave
ofn.Flags = OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST
if GetSaveFileName(@ofn) Then savepath = pathfilename
IF LEN(SavePath) Then
Open savepath for Binary As #1
Put #1,, sreport
Close #1
End If
End if
exit function
' Case Static1
' fstatic1="libAx_Disp.a"
' fstatic2="Static lib Ax_Disp" & szNULL & "*.a" & szNULL
' ofn.lStructSize = sizeof(OPENFILENAME)
' ofn.hwndOwner = hwin
' ofn.hInstance = cast(hinstance, GetWindowLong(hwin, GWL_HINSTANCE))
' ofn.lpstrFile = @fstatic1
' ofn.nMaxFile = 260
' ofn.lpstrFilter = @fstatic2
' ofn.Flags = OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST
' if GetSaveFileName(@ofn) Then fsave=fstatic1
' 'print " fsave "; fsave
' IF LEN(fsave) Then
' 'print " MakeFile "; fsave
' MakeFileImport_(inc4, inc4_len, fsave)
' End If
' Case Static2
' fstatic1="Ax_Disp_lib.bi"
' fstatic2="Include file Ax_Disp_Lib" & szNULL & "*.bi" & szNULL
' ofn.lStructSize = sizeof(OPENFILENAME)
' ofn.hwndOwner = hwin
' ofn.hInstance = cast(hinstance, GetWindowLong(hwin, GWL_HINSTANCE))
' ofn.lpstrFile = @fstatic1
' ofn.nMaxFile = 260
' ofn.lpstrFilter = @fstatic2
' ofn.Flags = OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST
' if GetSaveFileName(@ofn) Then fsave=fstatic1
' 'print " fsave "; fsave
' IF LEN(fsave) Then
' 'print " MakeFile "; fsave
' MakeFileImport_(inc3, inc3_len, fsave)
' End If
' Case Static3
' fstatic1="libAx_Lite.a"
' fstatic2="Static lib Ax_Lite" & szNULL & "*.a" & szNULL
' ofn.lStructSize = sizeof(OPENFILENAME)
' ofn.hwndOwner = hwin
' ofn.hInstance = cast(hinstance, GetWindowLong(hwin, GWL_HINSTANCE))
' ofn.lpstrFile = @fstatic1
' ofn.nMaxFile = 260
' ofn.lpstrFilter = @fstatic2
' ofn.Flags = OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST
' if GetSaveFileName(@ofn) Then fsave=fstatic1
' 'print " fsave "; fsave
' IF LEN(fsave) Then
' 'print " MakeFile "; fsave
' MakeFileImport_(inc8, inc8_len, fsave)
' End If
' Case Static4
' fstatic1="Ax_Lite_Lib.bi"
' fstatic2="Include file Ax_Lite_Lib" & szNULL & "*.bi" & szNULL
' ofn.lStructSize = sizeof(OPENFILENAME)
' ofn.hwndOwner = hwin
' ofn.hInstance = cast(hinstance, GetWindowLong(hwin, GWL_HINSTANCE))
' ofn.lpstrFile = @fstatic1
' ofn.nMaxFile = 260
' ofn.lpstrFilter = @fstatic2
' ofn.Flags = OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST
' if GetSaveFileName(@ofn) Then fsave=fstatic1
' 'print " fsave "; fsave
' IF LEN(fsave) Then
' 'print " MakeFile "; fsave
' MakeFileImport_(inc7, inc7_len, fsave)
' End If
Case Static5
fstatic1="Ax_Lite.bi"
fstatic2="Include file Ax_Lite" & szNULL & "*.bi" & szNULL
ofn.lStructSize = sizeof(OPENFILENAME)
ofn.hwndOwner = hwin
ofn.hInstance = cast(hinstance, GetWindowLong(hwin, GWL_HINSTANCE))
ofn.lpstrFile = @fstatic1
ofn.nMaxFile = 260
ofn.lpstrFilter = @fstatic2
ofn.Flags = OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST
if GetSaveFileName(@ofn) Then fsave=fstatic1
'print " fsave "; fsave
IF LEN(fsave) Then
'print " MakeFile "; fsave
MakeFileImport_(inc9, inc9_len, fsave)
End If
exit function
Case Static6
mem_ClipboardSetText(inc9, inc9_len)
exit function
' Case Static6
' fstatic1="libAtl.dll.a"
' fstatic2="Static lib libAtl.dll.a" & szNULL & "*.a" & szNULL
' ofn.lStructSize = sizeof(OPENFILENAME)
' ofn.hwndOwner = hwin
' ofn.hInstance = cast(hinstance, GetWindowLong(hwin, GWL_HINSTANCE))
' ofn.lpstrFile = @fstatic1
' ofn.nMaxFile = 260
' ofn.lpstrFilter = @fstatic2
' ofn.Flags = OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST
' if GetSaveFileName(@ofn) Then fsave=fstatic1
' 'print " fsave "; fsave
' IF LEN(fsave) Then
' 'print " MakeFile "; fsave
' MakeFileImport_(inc10, inc10_len, fsave)
' fsave=left(fsave,len(fsave)-6) & "71.dll.a"
' MakeFileImport_(inc11, inc11_len, fsave)
' End If
Case codll
fstatic1="ATL.DLL"
fstatic2="Atl Dll file " & szNULL & "*.dll" & szNULL
ofn.lStructSize = sizeof(OPENFILENAME)
ofn.hwndOwner = hwin
ofn.hInstance = cast(hinstance, GetWindowLong(hwin, GWL_HINSTANCE))
ofn.lpstrFile = @fstatic1
ofn.nMaxFile = 260
ofn.lpstrFilter = @fstatic2
ofn.Flags = OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST
if GetSaveFileName(@ofn) Then fsave=fstatic1
'print " fsave "; fsave
IF LEN(fsave) Then
'print " MakeFile "; fsave
MakeFileImport_(inc1, inc1_len, fsave)
End If
exit function
Case codll71
fstatic1="ATL71.DLL"
fstatic2="Atl71 Dll file " & szNULL & "*.dll" & szNULL
ofn.lStructSize = sizeof(OPENFILENAME)
ofn.hwndOwner = hwin
ofn.hInstance = cast(hinstance, GetWindowLong(hwin, GWL_HINSTANCE))
ofn.lpstrFile = @fstatic1
ofn.nMaxFile = 260
ofn.lpstrFilter = @fstatic2
ofn.Flags = OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST
if GetSaveFileName(@ofn) Then fsave=fstatic1
'print " fsave "; fsave
IF LEN(fsave) Then
'print " MakeFile "; fsave
MakeFileImport_(inc2, inc2_len, fsave)
End If
exit function
Case aodll
fstatic1="atlCtl.dll"
fstatic2="Atl FbEdit Addin " & szNULL & "*.dll" & szNULL
ofn.lStructSize = sizeof(OPENFILENAME)
ofn.hwndOwner = hwin
ofn.hInstance = cast(hinstance, GetWindowLong(hwin, GWL_HINSTANCE))
ofn.lpstrFile = @fstatic1
ofn.nMaxFile = 260
ofn.lpstrFilter = @fstatic2
ofn.Flags = OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST
if GetSaveFileName(@ofn) Then fsave=fstatic1
'print " fsave "; fsave
IF LEN(fsave) Then
'print " MakeFile "; fsave
MakeFileImport_(inc5, inc5_len, fsave)
End If
exit function
Case aodll71
fstatic1="atl71Ctl.dll"
fstatic2="Atl71 FbEdit Addin " & szNULL & "*.dll" & szNULL
ofn.lStructSize = sizeof(OPENFILENAME)
ofn.hwndOwner = hwin
ofn.hInstance = cast(hinstance, GetWindowLong(hwin, GWL_HINSTANCE))
ofn.lpstrFile = @fstatic1
ofn.nMaxFile = 260
ofn.lpstrFilter = @fstatic2
ofn.Flags = OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST
if GetSaveFileName(@ofn) Then fsave=fstatic1
'print " fsave "; fsave
IF LEN(fsave) Then
'print " MakeFile "; fsave
MakeFileImport_(inc6, inc6_len, fsave)
End If
exit function
Case code_codegen
if sreport <> "" then
FF_ClipboardSetText(sreport)
End if
exit function
case hlp_axsuite
pathfilename = ExePath & "\axsuite3.chm"
if FileFound(pathfilename)= 0 then
messagebox (getactivewindow(), "File : AxSuite3.Chm not found ", "Error",MB_ICONERROR or MB_SYSTEMMODAL)
else
shellexecute 0, strptr( "Open"), @pathfilename, NULL, NULL, SW_SHOWNORMAL
end if
exit function
case hlp_About
DialogBoxParam(GetModuleHandle(NULL), cast(LPCTSTR, dlgAbout), hwin, @dlgAbout_DlgProc, NULL)
exit function
case As_AxSuite
pathfilename = ExePath & "\axsuite3.pdf"
if FileFound(pathfilename)= 0 then
messagebox (getactivewindow(), "File : AxSuite3.Pdf not found ", "Error",MB_ICONERROR or MB_SYSTEMMODAL)
else
shellexecute 0, strptr( "Open"), @pathfilename, NULL, NULL, SW_SHOWNORMAL
end if
exit function
' case As_DispHelper
' pathfilename = ExePath & "\DispHelper.pdf"
' shellexecute 0, strptr( "Open"), @pathfilename, NULL, NULL, SW_SHOWNORMAL
End Select
function = 0
End Function
Function FF_ListView_GetSelectedItem(ByVal hWndControl As hWnd) As Integer
' Do a check to ensure that this is actually a window handle
If IsWindow(hWndControl) Then
Function = SendMessage(hWndControl, LVM_GETSELECTIONMARK, 0, 0)
End If
End Function
Function FF_ListView_GetItemText(ByVal hWndControl As hWnd, ByVal iRow As Integer, ByVal iColumn As Integer ) As String
Dim tlv_item As LV_ITEM
Dim zText As ZString * MAX_PATH
Dim Text1 as string
' Do a check to ensure that this is actually a window handle
If IsWindow(hWndControl) Then
tlv_item.mask = LVIF_TEXT
tlv_item.iItem = iRow
tlv_item.iSubItem = iColumn
tlv_item.pszText = VarPtr(zText)
tlv_item.cchTextMax = SizeOf(zText)
If SendMessage(hWndControl, LVM_GETITEM, 0, Cast(LPARAM, VarPtr(tlv_item))) Then
Text1 = zText
Function = Text1
End If
End If
End Function
Function FF_ListView_SetSelectedItem(ByVal hWndControl As hWnd, ByVal nIndex As Integer ) As Integer
' Do a check to ensure that this is actually a window handle
If IsWindow(hWndControl) Then
Function = SendMessage(hWndControl, LVM_SETSELECTIONMARK, 0, nIndex)
'ensure that the item is set visually as well
Dim tItem As LVITEM
tItem.mask = LVIF_STATE
tItem.iItem = nIndex
tItem.iSubItem = 0
tItem.State = LVIS_FOCUSED Or LVIS_SELECTED
tItem.statemask = LVIS_FOCUSED Or LVIS_SELECTED
SendMessage hWndControl, LVM_SETITEMSTATE, nIndex, Cast(LPARAM, VarPtr(tItem))
End If
End Function
Function FF_ListView_GetTopIndex(ByVal hWndControl As hWnd) As Integer
' Do a check to ensure that this is actually a window handle
If IsWindow(hWndControl) Then
Function = SendMessage(hWndControl, LVM_GETTOPINDEX, 0, 0)
End If
End Function
Sub FF_Control_Redraw(ByVal hWndControl As hWnd)
' Do a check to ensure that this is actually a window handle
If IsWindow(hWndControl) Then
' Signal the Control to be redrawn.
InvalidateRect hWndControl, ByVal 0, True
UpdateWindow hWndControl
End If
End Sub
sub show_line(ret1 As integer)