-
Notifications
You must be signed in to change notification settings - Fork 3
/
RCDialogs.asm
4058 lines (3555 loc) · 110 KB
/
RCDialogs.asm
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
EnableControlsOnToolBox PROTO :DWORD
.DATA?
hTempFind DWORD ?
SelRect RECT <?>
.DATA
szTab0 DB "Tab0",0
szTab1 DB "Tab1",0
bSelecting DD 0
szCONTROL DB 'CONTROL',0
szEDITTEXT DB 'EDITTEXT',0
szLTEXT DB 'LTEXT',0
szCTEXT DB 'CTEXT',0
szRTEXT DB 'RTEXT',0
szGROUPBOX DB 'GROUPBOX',0
szPUSHBUTTON DB 'PUSHBUTTON',0
szDEFPUSHBUTTON DB 'DEFPUSHBUTTON',0
szAUTOCHECKBOX DB 'AUTOCHECKBOX',0
szCHECKBOX DB 'CHECKBOX',0
szAUTORADIOBUTTON DB 'AUTORADIOBUTTON',0
szCOMBOBOX DB 'COMBOBOX',0
szLISTBOX DB 'LISTBOX',0
szSCROLLBAR DB 'SCROLLBAR',0
szENDSHORT DB '}',0
szEND DB 'END',0
Comment $
szFW_DONTCARE DB "FW_DONTCARE",0
szFW_THIN DB "FW_THIN",0
szFW_EXTRALIGHT DB "FW_EXTRALIGHT",0
szFW_ULTRALIGHT DB "FW_ULTRALIGHT",0
szFW_LIGHT DB "FW_LIGHT",0
szFW_NORMAL DB "FW_NORMAL",0
szFW_REGULAR DB "FW_REGULAR",0
szFW_MEDIUM DB "FW_MEDIUM",0
szFW_SEMIBOLD DB "FW_SEMIBOLD",0
szFW_DEMIBOLD DB "FW_DEMIBOLD",0
szFW_BOLD DB "FW_BOLD",0
szFW_EXTRABOLD DB "FW_EXTRABOLD",0
szFW_ULTRABOLD DB "FW_ULTRABOLD",0
szFW_HEAVY DB "FW_HEAVY",0
szFW_BLACK DB "FW_BLACK",0
$
.CODE
GetRCFileLineNumber Proc WordPositionInBlock:DWORD
MOV EAX,1 ;EAX Counts LineNumber
MOV ECX,StartOfBlock
.While BYTE PTR [ECX] && ECX < WordPositionInBlock
.If BYTE PTR [ECX]==0Dh; || BYTE PTR [EAX]==0Ah
INC EAX
.EndIf
INC ECX
.EndW
RET
GetRCFileLineNumber EndP
NonCompatibleScriptMessage Proc WordPositionInBlock:DWORD
Local Buffer[512]:BYTE
Invoke lstrcpy,ADDR Buffer,Offset szLine
Invoke GetRCFileLineNumber,WordPositionInBlock
PUSH EAX
Invoke lstrlen,Offset szLine
LEA ECX,Buffer
ADD ECX,EAX ;"Line "=???? characters
POP EDX
Invoke BinToDec,EDX,ECX
Invoke lstrcat,ADDR Buffer,Offset szComma
Invoke lstrcat,ADDR Buffer,Offset szSpc
Invoke GetWindowLong,hRCEditorWindow,0
Invoke lstrcat,ADDR Buffer,ADDR CHILDWINDOWDATA.szFileName[EAX]
Invoke lstrcat,ADDR Buffer,Offset szLineNotCompatible
Invoke MessageBox,NULL,ADDR Buffer,Offset szAppName,MB_OK+MB_ICONINFORMATION+MB_TASKMODAL
RET
NonCompatibleScriptMessage EndP
SetClipChildren Proc bFlag:DWORD
Invoke GetWindowLong,hADialog,GWL_STYLE
.If !bFlag
MOV ECX,WS_CLIPCHILDREN
NOT ECX
AND EAX,ECX
.Else
OR EAX,WS_CLIPCHILDREN
.EndIf
Invoke SetWindowLong,hADialog,GWL_STYLE,EAX
RET
SetClipChildren EndP
CreateDialogClass Proc
Local wc :WNDCLASSEX
;This is the class for the dialogs of the resource file
MOV wc.cbSize,SizeOf WNDCLASSEX
MOV wc.style,0;CS_HREDRAW OR CS_VREDRAW;CS_DBLCLKS ;
MOV wc.lpfnWndProc,Offset RCDlgProc
MOV wc.cbClsExtra,0
MOV wc.cbWndExtra,0;4
PUSH hInstance
POP wc.hInstance
MOV wc.hbrBackground,COLOR_3DFACE+1
MOV wc.lpszMenuName,NULL
MOV wc.lpszClassName,Offset szRCDlgClass
MOV EAX,hMainIcon
MOV wc.hIcon,EAX
MOV wc.hIconSm,NULL;EAX
Invoke LoadCursor,NULL,IDC_ARROW
MOV wc.hCursor,EAX
Invoke RegisterClassEx,ADDR wc
;-------------------------------------------------
MOV wc.lpfnWndProc,Offset TestDialogProc
MOV wc.lpszClassName,Offset szRCTestDlgClass
Invoke RegisterClassEx,ADDR wc
;-------------------------------------------------
Invoke RegisterClipboardFormat,Offset szRCDlgClass
MOV hClipFormat,EAX
RET
CreateDialogClass EndP
GetClosestPointOnGrid Proc
;;EBX=X
;;ESI=Y
Invoke MulDiv,EBX,1,GridSize
Invoke MulDiv,EAX,GridSize,1
;Now EAX==X on the grid
;INC EAX
MOV EBX,EAX
Invoke MulDiv,ESI,1,GridSize
Invoke MulDiv,EAX,GridSize,1
;Now EAX==Y on the grid
;INC EAX
MOV ESI,EAX
RET
GetClosestPointOnGrid EndP
DeSelectWindow Proc hSel:HWND
.If hSel
MOV EAX,8
.While EAX
PUSH EAX
Invoke GetWindowLong,hSel,GWL_USERDATA
PUSH EAX
Invoke DestroyWindow,hSel
POP hSel
POP EAX
DEC EAX
.EndW
.EndIf
MOV EAX,hSel
RET
DeSelectWindow EndP
;Upon Completion hSelection should always be zero
DeMultiSelect Proc
.If hSelection
@@:
Invoke DeSelectWindow,hSelection
MOV hSelection,EAX
.If EAX
JMP @B
.EndIf
.EndIf
RET
DeMultiSelect EndP
;Returns the handle of the Select Static Control
CreateOneSelection Proc Uses EBX xP:DWORD,yP:DWORD,hPar:HWND,fActive:DWORD,hPrv:HWND
.If fActive
MOV EDX,WS_CHILD or WS_VISIBLE OR WS_BORDER; OR SS_WHITERECT ;OR WS_CLIPSIBLINGS
.Else
MOV EDX,WS_CHILD or WS_VISIBLE OR SS_GRAYRECT OR WS_BORDER;OR WS_CLIPSIBLINGS
.EndIf
Invoke CreateWindowEx,0,ADDR szStaticClass,0,EDX,xP,yP,6,6,hPar,0,hInstance,0
MOV EBX,EAX
Invoke SetWindowLong,EBX,GWL_USERDATA,hPrv
Invoke SetWindowPos,EBX,HWND_TOP,0,0,0,0,SWP_NOMOVE OR SWP_NOSIZE
MOV EAX,EBX
RET
CreateOneSelection EndP
SelectWindow Proc Uses EBX hWin:HWND,fActive:DWORD
Local Rect :RECT
Local Pt :POINT
Local hSel :HWND
.If fActive
Invoke GetParent,hWin
MOV EBX,EAX
Invoke GetWindowRect,hWin,ADDR Rect
Invoke MapWindowPoints,NULL,EBX,ADDR Rect,2
MOV EAX,Rect.right
SUB EAX,Rect.left
SHR EAX,1
MOV ECX,Rect.left
ADD ECX,EAX
SUB ECX,3
MOV Pt.x,ECX
MOV EAX,Rect.bottom
SUB EAX,Rect.top
SHR EAX,1
MOV ECX,Rect.top
ADD ECX,EAX
SUB ECX,3
MOV Pt.y,ECX
SUB Rect.left,6;7;6
SUB Rect.top,6;7;6
.Else
MOV EAX,hWin
MOV EBX,EAX
Invoke GetClientRect,hWin,ADDR Rect
MOV EAX,Rect.right
SUB EAX,Rect.left
SHR EAX,1
MOV ECX,Rect.left
ADD ECX,EAX
SUB ECX,3
MOV Pt.x,ECX
MOV EAX,Rect.bottom
SUB EAX,Rect.top
SHR EAX,1
MOV ECX,Rect.top
ADD ECX,EAX
SUB ECX,3
MOV Pt.y,ECX
SUB Rect.right,6
SUB Rect.bottom,6
.EndIf
Invoke CreateOneSelection,Rect.left,Rect.top,EBX,fActive,hSelection
Invoke CreateOneSelection,Pt.x,Rect.top,EBX,fActive,EAX
Invoke CreateOneSelection,Rect.right,Rect.top,EBX,fActive,EAX
Invoke CreateOneSelection,Rect.right,Pt.y,EBX,fActive,EAX
Invoke CreateOneSelection,Rect.right,Rect.bottom,EBX,fActive,EAX
Invoke CreateOneSelection,Pt.x,Rect.bottom,EBX,fActive,EAX
Invoke CreateOneSelection,Rect.left,Rect.bottom,EBX,fActive,EAX
Invoke CreateOneSelection,Rect.left,Pt.y,EBX,fActive,EAX
MOV hSelection,EAX
RET
SelectWindow EndP
ConvertSelection Proc Uses EDI hSel:HWND
Local tvi:TVITEM
Invoke SendMessage,hDialogsTree,TVM_GETNEXTITEM,TVGN_CARET,0
.If EAX
MOV tvi._mask,TVIF_PARAM
MOV tvi.hItem,EAX
Invoke SendMessage,hDialogsTree,TVM_GETITEM,0,ADDR tvi
;tvi.lParam holds the handle of a Dialog
MOV EDI,tvi.lParam
.If hSel
MOV EAX,8
.While EAX
PUSH EAX
Invoke GetWindowLong,hSel,GWL_USERDATA
PUSH EAX
Invoke DestroyWindow,hSel
POP hSel
POP EAX
DEC EAX
.EndW
.EndIf
MOV EAX,hSel
MOV hSelection,EAX
Invoke SelectWindow,[EDI].CONTROLDATA.hWnd,FALSE
.EndIf
RET
ConvertSelection EndP
SetImageOfStaticControl Proc Uses ESI EDI lpWindowData:DWORD
Local Buffer[256] :BYTE
.If lpResourcesMem
MOV EDI,lpWindowData
MOV ESI,lpResourcesMem
.While [ESI].RESOURCEMEM.Value
.If [ESI].RESOURCEMEM.nType==0 || [ESI].RESOURCEMEM.nType==2 ;i.e. bitmap or icon
MOV Buffer,'#'
Invoke BinToDec,[ESI].RESOURCEMEM.Value,ADDR Buffer[1]
Invoke lstrcmp,ADDR Buffer,ADDR [EDI].CONTROLDATA.Caption
.If EAX
Invoke lstrcmp,ADDR Buffer[1],ADDR [EDI].CONTROLDATA.Caption
.If !EAX
CALL ImgFound
.Break
.EndIf
.Else
CALL ImgFound
.Break
.EndIf
.EndIf
LEA ESI,[ESI+SizeOf RESOURCEMEM]
.EndW
.If [ESI].RESOURCEMEM.nType==0
MOV ECX,IMAGE_BITMAP
.Else
MOV ECX,IMAGE_ICON
.EndIf
Invoke SendMessage,[EDI].CONTROLDATA.hChild,STM_SETIMAGE,ECX,[EDI].CONTROLDATA.hImg
.EndIf
RET
;-----------------------------------------------------------------------
ImgFound:
;--------
MOV ECX,LR_LOADFROMFILE OR LR_DEFAULTSIZE
MOV EDX,[EDI].CONTROLDATA.Style
AND EDX,SS_REALSIZEIMAGE
.If EDX==SS_REALSIZEIMAGE
MOV ECX,LR_LOADFROMFILE
.EndIf
.If [ESI].RESOURCEMEM.nType==0 ;Bitmap
Invoke LoadImage,NULL,ADDR [ESI].RESOURCEMEM.szFile,IMAGE_BITMAP,NULL,NULL,ECX
.Else
Invoke LoadImage,NULL,ADDR [ESI].RESOURCEMEM.szFile,IMAGE_ICON,NULL,NULL,ECX; or LR_DEFAULTSIZE
.EndIf
MOV [EDI].CONTROLDATA.hImg,EAX
RETN
SetImageOfStaticControl EndP
ReCreateControl Proc Uses EDI lpControlData:DWORD
Local Buffer[256] :BYTE
Local hCtl :DWORD
Local TabItem :TC_ITEM
MOV EDI,lpControlData
.If [EDI].CONTROLDATA.ntype==21 || [EDI].CONTROLDATA.ntype==22
Invoke DestroyWindow,[EDI].CONTROLDATA.hChild
.Else
Invoke DestroyWindow,[EDI].CONTROLDATA.hWnd
.EndIf
;Look!!!!!!!! (handle \t, \n, \\, "")
Invoke TranformText,ADDR [EDI].CONTROLDATA.Caption,ADDR Buffer
MOV ECX,[EDI].CONTROLDATA.Style
AND ECX,-1 XOR (WS_POPUP)
OR ECX,WS_ALLCHILDS
.If [EDI].CONTROLDATA.ntype==2 ;Edit
LEA EDX,szEditClass
Invoke CreateWindowEx,[EDI].CONTROLDATA.ExStyle,EDX,ADDR Buffer,ECX,[EDI].CONTROLDATA.x,[EDI].CONTROLDATA.y,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,hADialog,NULL,hInstance,NULL
MOV hCtl,EAX
MOV [EDI].CONTROLDATA.hWnd,EAX
.ElseIf [EDI].CONTROLDATA.ntype==13 ;StatusBar
LEA EDX,szStatusBarClass
Invoke CreateWindowEx,[EDI].CONTROLDATA.ExStyle,EDX,ADDR Buffer,ECX,[EDI].CONTROLDATA.x,[EDI].CONTROLDATA.y,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,hADialog,NULL,hInstance,NULL
MOV hCtl,EAX
MOV [EDI].CONTROLDATA.hWnd,EAX
.ElseIf [EDI].CONTROLDATA.ntype==9 || [EDI].CONTROLDATA.ntype==10 ;scrollbar
LEA EDX,szScrollBarClass
Invoke CreateWindowEx,[EDI].CONTROLDATA.ExStyle,EDX,ADDR Buffer,ECX,[EDI].CONTROLDATA.x,[EDI].CONTROLDATA.y,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,hADialog,NULL,hInstance,NULL
MOV hCtl,EAX
MOV [EDI].CONTROLDATA.hWnd,EAX
.ElseIf [EDI].CONTROLDATA.ntype==7
OR ECX,CBS_NOINTEGRALHEIGHT
LEA EDX,szComboBoxClass
Invoke CreateWindowEx,[EDI].CONTROLDATA.ExStyle,EDX,ADDR Buffer,ECX,[EDI].CONTROLDATA.x,[EDI].CONTROLDATA.y,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,hADialog,NULL,hInstance,NULL
MOV hCtl,EAX
MOV [EDI].CONTROLDATA.hWnd,EAX
.ElseIf [EDI].CONTROLDATA.ntype==11 ;TabControl
LEA EDX,szTabControlClass
Invoke CreateWindowEx,[EDI].CONTROLDATA.ExStyle,EDX,ADDR Buffer,ECX,[EDI].CONTROLDATA.x,[EDI].CONTROLDATA.y,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,hADialog,NULL,hInstance,NULL
MOV hCtl,EAX
MOV [EDI].CONTROLDATA.hWnd,EAX
MOV TabItem.imask,TCIF_TEXT
MOV TabItem.pszText, Offset szTab1
Invoke SendMessage,hCtl,TCM_INSERTITEM,0,ADDR TabItem
MOV TabItem.pszText, Offset szTab0
Invoke SendMessage,hCtl,TCM_INSERTITEM,0,ADDR TabItem
Invoke SendMessage,hCtl,TCM_SETCURSEL,0,NULL
.ElseIf [EDI].CONTROLDATA.ntype==22 || [EDI].CONTROLDATA.ntype==21 ;shape or image
MOV EAX,[EDI].CONTROLDATA.hWnd
MOV hCtl,EAX
LEA EDX,szStaticClass
Invoke CreateWindowEx,[EDI].CONTROLDATA.ExStyle,EDX,ADDR Buffer,ECX,0,0,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,EAX,NULL,hInstance,NULL
MOV [EDI].CONTROLDATA.hChild,EAX
Invoke SetWindowPos,EAX,HWND_TOP,0,0,0,0,SWP_NOMOVE OR SWP_NOSIZE; OR SWP_NOOWNERZORDER
Invoke SendMessage,[EDI].CONTROLDATA.hChild,WM_SETFONT,[EDI].CONTROLDATA.hFont,TRUE
.ElseIf [EDI].CONTROLDATA.ntype==23
PUSH EBX
PUSH ECX
LEA EBX,[EDI].CONTROLDATA.Class
Invoke IsThereSuchAClass,EBX
.If !EAX
LEA EBX,szStaticClass
.EndIf
POP ECX
Invoke CreateWindowEx,[EDI].CONTROLDATA.ExStyle,EBX,ADDR Buffer,ECX,[EDI].CONTROLDATA.x,[EDI].CONTROLDATA.y,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,hADialog,NULL,hInstance,NULL
MOV hCtl,EAX
MOV [EDI].CONTROLDATA.hWnd,EAX
POP EBX
.EndIf
Invoke SetWindowLong,hCtl,GWL_USERDATA,EDI
;Retrieve handle of next sibling item
Invoke SendMessage,hDialogsTree,TVM_GETNEXTITEM,TVGN_NEXT,[EDI].CONTROLDATA.hTreeItem
.If EAX
Invoke GetTreeItemParameter,hDialogsTree,EAX
MOV EDX,[EAX].CONTROLDATA.hWnd
.Else
MOV EDX,HWND_TOP
.EndIf
Invoke SetWindowPos,hCtl,EDX,0,0,0,0,SWP_NOMOVE OR SWP_NOSIZE
LEA ECX,[EDI].CONTROLDATA.IDName
.If BYTE PTR [ECX]==0
MOV ECX,[EDI].CONTROLDATA.ID
Invoke BinToDec,ECX,ADDR Buffer
LEA ECX,Buffer
.EndIf
.If [EDI].CONTROLDATA.ntype==7
Invoke SendMessage,hCtl,CB_ADDSTRING,0,ECX
Invoke SendMessage,hCtl,CB_SETCURSEL,0,0
.ElseIf [EDI].CONTROLDATA.ntype==21
LEA EAX,[EDI].CONTROLDATA.Caption
.If BYTE PTR [EAX]
Invoke DeleteObject,[EDI].CONTROLDATA.hImg
Invoke SetImageOfStaticControl,EDI
.EndIf
.EndIf
RET
ReCreateControl EndP
CreateControl Proc Uses EBX EDI ESI lpDialogData:DWORD, hPar:HWND
Local tvinsert :TV_INSERTSTRUCT
Local TabItem :TC_ITEM
Local rbi :REBARBANDINFO
Local lvi :LVITEM
Local Buffer[256] :BYTE
MOV EDI,lpDialogData
MOV EAX,[EDI].CONTROLDATA.ID
.If EAX<=7FFFFFFFh && EAX>HighestWindowDialogID
MOV HighestWindowDialogID,EAX
.EndIf
MOV EBX,[EDI].CONTROLDATA.ntype
.If EBX==1 ;Static
LEA ESI,szStaticClass
CALL CreateTheControl
.ElseIf EBX==2 ;Edit
LEA ESI,szEditClass
CALL CreateTheControl
.ElseIf EBX==3 ;GroupBox
Invoke CreateWindowEx,0,ADDR szStaticClass,NULL,WS_CHILD OR WS_VISIBLE OR SS_LEFT OR WS_CLIPSIBLINGS,[EDI].CONTROLDATA.x,[EDI].CONTROLDATA.y,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,hPar,NULL,hInstance,NULL
PUSH hPar
MOV hPar,EAX
MOV [EDI].CONTROLDATA.hWnd,EAX
Invoke SetWindowPos,hPar,HWND_TOP,0,0,0,0,SWP_NOMOVE OR SWP_NOSIZE
;---------------------------------------------------------------------
;Look!!!!!!!! (handle \t, \n, \\, "")
Invoke TranformText,ADDR [EDI].CONTROLDATA.Caption,ADDR Buffer
LEA EDX,szButtonClass
MOV ECX,[EDI].CONTROLDATA.Style
AND ECX,-1 XOR (WS_POPUP)
OR ECX,WS_ALLCHILDS
Invoke CreateWindowEx,[EDI].CONTROLDATA.ExStyle,EDX,ADDR Buffer,ECX,0,0,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,hPar,NULL,hInstance,NULL
MOV [EDI].CONTROLDATA.hChild,EAX
Invoke SetWindowPos,[EDI].CONTROLDATA.hChild,HWND_TOP,0,0,0,0,SWP_NOMOVE OR SWP_NOSIZE; OR SWP_NOOWNERZORDER
Invoke SendMessage,[EDI].CONTROLDATA.hChild,WM_SETFONT,[EDI].CONTROLDATA.hFont,TRUE
MOV EAX,hPar
POP hPar
.ElseIf EBX==4 ;BS_PUSHBUTTON & BS_DEFPUSHBUTTON
LEA ESI,szButtonClass
CALL CreateTheControl
.ElseIf EBX==5 ;BS_AUTOCHECKBOX
LEA ESI,szButtonClass
CALL CreateTheControl
.ElseIf EBX==6 ;BS_RADIOBUTTON
LEA ESI,szButtonClass
CALL CreateTheControl
.ElseIf EBX==7 ;ComboBox
LEA ESI,szComboBoxClass
CALL CreateTheControl
LEA ECX,[EDI].CONTROLDATA.IDName
.If BYTE PTR [ECX]==0
MOV ECX,[EDI].CONTROLDATA.ID
Invoke BinToDec,ECX,ADDR Buffer
LEA ECX,Buffer
.EndIf
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,CB_ADDSTRING,0,ECX
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,CB_SETCURSEL,0,0
.ElseIf EBX==8 ;ListBox
LEA ESI,szListBoxClass
CALL CreateTheControl
LEA ECX,[EDI].CONTROLDATA.IDName
.If BYTE PTR [ECX]==0
MOV ECX,[EDI].CONTROLDATA.ID
Invoke BinToDec,ECX,ADDR Buffer
LEA ECX,Buffer
.EndIf
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,LB_ADDSTRING,0,ECX
.ElseIf EBX==9 ;Horizontal Scrollbar
LEA ESI,szScrollBarClass
CALL CreateTheControl
.ElseIf EBX==10 ;Vertical Scrollbar
LEA ESI,szScrollBarClass
CALL CreateTheControl
.ElseIf EBX==11 ;TabControl
LEA ESI,szTabControlClass
CALL CreateTheControl
MOV TabItem.imask,TCIF_TEXT
MOV TabItem.pszText,Offset szTab1
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,TCM_INSERTITEM,0,ADDR TabItem
MOV TabItem.pszText,Offset szTab0
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,TCM_INSERTITEM,0,ADDR TabItem
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,TCM_SETCURSEL,0,NULL
.ElseIf EBX==12 ;ToolBar
LEA ESI,szToolBarClass
CALL CreateTheControl
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,TB_BUTTONSTRUCTSIZE,SizeOf TBBUTTON,0
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,TB_ADDBUTTONS,5,ADDR tbResource
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,TB_SETIMAGELIST,0,hImlNormal
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,TB_SETDISABLEDIMAGELIST,0,hImlNormal
.ElseIf EBX==13 ;StatusBar
LEA ESI,szStatusBarClass
CALL CreateTheControl
.ElseIf EBX==14 ;ProgressBar
LEA ESI,szProgressBarClass
CALL CreateTheControl
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,PBM_STEPIT,0,0
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,PBM_STEPIT,0,0
.ElseIf EBX==15 ;Rebar
LEA ESI,szReBarClass
CALL CreateTheControl
Invoke CreateWindowEx,0,ADDR szStaticClass,ADDR [EDI].CONTROLDATA.IDName,WS_CHILD OR WS_VISIBLE OR SS_LEFT OR WS_CLIPSIBLINGS,0,0,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,[EDI].CONTROLDATA.hWnd,NULL,hInstance,NULL
MOV rbi.hwndChild,EAX
MOV [EDI].CONTROLDATA.hChild,EAX
;Invoke SendMessage,EAX,WM_SETFONT,hFontTahoma,FALSE
MOV rbi.cbSize, SizeOf REBARBANDINFO
MOV rbi.fMask,RBBIM_STYLE or RBBIM_CHILD or RBBIM_SIZE or RBBIM_CHILDSIZE
MOV rbi.fStyle,RBBS_GRIPPERALWAYS or RBBS_CHILDEDGE
MOV EAX,[EDI].CONTROLDATA.ccx
MOV rbi.lx,EAX
MOV EAX,[EDI].CONTROLDATA.ccx
MOV rbi.cxMinChild,EAX
MOV EAX,[EDI].CONTROLDATA.ccy
MOV rbi.cyMinChild,EAX
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,RB_INSERTBAND,0,ADDR rbi
.ElseIf EBX==16 ;UpDown
LEA ESI,szUpDownClass
CALL CreateTheControl
.ElseIf EBX==17 ;TreeView
LEA ESI,szTreeViewClass
CALL CreateTheControl
MOV tvinsert.item._mask,TVIF_TEXT
LEA EAX,[EDI].CONTROLDATA.IDName
MOV tvinsert.item.pszText,EAX
MOV tvinsert.item.cchTextMax,256
MOV tvinsert.hParent,NULL
MOV tvinsert.hInsertAfter,TVI_ROOT
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,TVM_INSERTITEM,0,ADDR tvinsert
PUSH EAX
MOV tvinsert.hParent,EAX
MOV tvinsert.item.pszText,CTEXT("ChildItem")
MOV tvinsert.hInsertAfter,TVI_LAST
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,TVM_INSERTITEM,0,ADDR tvinsert
POP EAX
Invoke SendMessage, [EDI].CONTROLDATA.hWnd, TVM_EXPAND, TVE_EXPAND, EAX
.ElseIf EBX==18 ;ListView
LEA ESI,szListViewClass
CALL CreateTheControl
MOV lvi.imask, LVIF_TEXT
MOV lvi.iSubItem, 0
MOV lvi.cchTextMax,256
MOV lvi.iItem,0
LEA EAX,[EDI].CONTROLDATA.IDName
MOV lvi.pszText,EAX
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,LVM_INSERTITEM,0,ADDR lvi
.ElseIf EBX==19 ;TrackBar
LEA ESI,szTrackBarClass
CALL CreateTheControl
.ElseIf EBX==20 ;RichEdit
LEA ESI,szRichEditClass
CALL CreateTheControl
.ElseIf EBX==21 || EBX==22 ;Image OR Shape
;Create The PARENT Of the Control
Invoke CreateWindowEx,NULL,ADDR szStaticClass,NULL,WS_CHILD OR WS_VISIBLE OR WS_CLIPSIBLINGS,[EDI].CONTROLDATA.x,[EDI].CONTROLDATA.y,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,hPar,NULL,hInstance,NULL
PUSH hPar
MOV hPar,EAX
;MOV hCtl,EAX
MOV [EDI].CONTROLDATA.hWnd,EAX
Invoke SetWindowPos,hPar,HWND_TOP,0,0,0,0,SWP_NOMOVE OR SWP_NOSIZE
LEA EDX,szStaticClass
;---------------------------------------------------------------------
;Create The Control
MOV ECX,[EDI].CONTROLDATA.Style
AND ECX,-1 XOR (WS_POPUP)
OR ECX,WS_ALLCHILDS
Invoke CreateWindowEx,[EDI].CONTROLDATA.ExStyle,EDX,NULL,ECX,0,0,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,hPar,NULL,hInstance,NULL
MOV [EDI].CONTROLDATA.hChild,EAX
Invoke SetWindowPos,EAX,HWND_TOP,0,0,0,0,SWP_NOMOVE OR SWP_NOSIZE; OR SWP_NOOWNERZORDER
MOV EAX,hPar
POP hPar
LEA EAX,[EDI].CONTROLDATA.Caption
.If BYTE PTR [EAX] && [EDI].CONTROLDATA.ntype==21
Invoke SetImageOfStaticControl,EDI
.EndIf
.ElseIf EBX==23 || EBX==24 ;Managed custom control
;CUSTOMCONTROL STRUCT
; szFriendlyName DB 24+1 DUP (?)
; szClassName DB 24+1 DUP (?)
; szDescription DB 256+1 DUP (?)
; szDLLFullPathName DB MAX_PATH+1 DUP (?)
; szStyles DB 16*(24+1) DUP (?)
;CUSTOMCONTROL ENDS
.If [EDI].CONTROLDATA.ntype==24
Invoke GetPointerToManagedControl,ADDR [EDI].CONTROLDATA.Class
MOV ESI,EAX
LEA ECX,[ESI].CUSTOMCONTROL.szDLLFullPathName
.If BYTE PTR [ECX] && [ESI].CUSTOMCONTROLEX.hLib==0
Invoke LoadLibrary,ECX
.If EAX
MOV [ESI].CUSTOMCONTROLEX.hLib,EAX
.EndIf
.EndIf
Invoke IsThereSuchAClass,ADDR [ESI].CUSTOMCONTROL.szClassName
.If !EAX
LEA ESI,szStaticClass
.Else
INC [ESI].CUSTOMCONTROLEX.ReferenceCount
LEA ESI,[ESI].CUSTOMCONTROL.szClassName
.EndIf
.Else
LEA ESI,[EDI].CONTROLDATA.Class
Invoke IsThereSuchAClass,ESI
.If !EAX
LEA ESI,szStaticClass
.EndIf
.EndIf
;Create The PARENT Of the Control
Invoke CreateWindowEx,NULL,ADDR szStaticClass,NULL,WS_CHILD OR WS_VISIBLE OR WS_CLIPSIBLINGS,[EDI].CONTROLDATA.x,[EDI].CONTROLDATA.y,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,hPar,NULL,hInstance,NULL
PUSH hPar
MOV hPar,EAX
;MOV hCtl,EAX
MOV [EDI].CONTROLDATA.hWnd,EAX
Invoke SetWindowPos,hPar,HWND_TOP,0,0,0,0,SWP_NOMOVE OR SWP_NOSIZE
;---------------------------------------------------------------------
;Create The Control
;Look!!!!!!!! (handle \t, \n, \\, "")
Invoke TranformText,ADDR [EDI].CONTROLDATA.Caption,ADDR Buffer
MOV ECX,[EDI].CONTROLDATA.Style
AND ECX,-1 XOR (WS_POPUP)
OR ECX,WS_ALLCHILDS
Invoke CreateWindowEx,[EDI].CONTROLDATA.ExStyle,ESI,ADDR Buffer,ECX,0,0,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,hPar,NULL,hInstance,NULL
MOV [EDI].CONTROLDATA.hChild,EAX
Invoke SetWindowPos,EAX,HWND_TOP,0,0,0,0,SWP_NOMOVE OR SWP_NOSIZE; OR SWP_NOOWNERZORDER
Invoke SendMessage,[EDI].CONTROLDATA.hChild,WM_SETFONT,[EDI].CONTROLDATA.hFont,TRUE
POP hPar
.EndIf
MOV tvinsert.item.iSelectedImage,EBX
MOV tvinsert.item.iImage,EBX
Invoke SetWindowLong,[EDI].CONTROLDATA.hWnd,GWL_USERDATA,EDI
Invoke SetProperties,EDI
MOV tvinsert.item.lParam,EDI
Invoke GetWindowLong,hPar,GWL_USERDATA
MOV EAX,[EAX].CONTROLDATA.hTreeItem
;Add Control To Tree
MOV tvinsert.hParent,EAX
LEA EBX,[EDI].CONTROLDATA.IDName
.If BYTE PTR [EBX]==0
MOV ECX,[EDI].CONTROLDATA.ID
Invoke BinToDec,ECX,ADDR Buffer
LEA EBX,Buffer
.EndIf
MOV tvinsert.item.pszText,EBX
MOV tvinsert.item._mask,TVIF_TEXT+TVIF_PARAM+TVIF_IMAGE+TVIF_SELECTEDIMAGE
MOV tvinsert.hInsertAfter,TVI_LAST
Invoke SendMessage,hDialogsTree,TVM_INSERTITEM,0,ADDR tvinsert
MOV [EDI].CONTROLDATA.hTreeItem,EAX
RET
;-----------------------------------------------------------------------
CreateTheControl:
;Look!!!!!!!! (handle \t, \n, \\, "")
Invoke TranformText,ADDR [EDI].CONTROLDATA.Caption,ADDR Buffer
MOV ECX,[EDI].CONTROLDATA.Style
AND ECX,-1 XOR (WS_POPUP)
OR ECX,WS_ALLCHILDS
.If [EDI].CONTROLDATA.ntype==15 ;Rebar
AND ECX,-1 XOR CCS_TOP
OR ECX,CCS_NORESIZE
.ElseIf [EDI].CONTROLDATA.ntype==7 ;ComboBox
OR ECX,CBS_NOINTEGRALHEIGHT
.EndIf
Invoke CreateWindowEx,[EDI].CONTROLDATA.ExStyle,ESI,ADDR Buffer,ECX,[EDI].CONTROLDATA.x,[EDI].CONTROLDATA.y,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,hPar,NULL,hInstance,NULL
;MOV hCtl,EAX
MOV [EDI].CONTROLDATA.hWnd,EAX
Invoke SetWindowPos,[EDI].CONTROLDATA.hWnd,HWND_TOP,0,0,0,0,SWP_NOMOVE OR SWP_NOSIZE; OR SWP_NOOWNERZORDER
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,WM_SETFONT,[EDI].CONTROLDATA.hFont,TRUE
RETN
CreateControl EndP
ConvertToDialogUnits Proc Uses ESI lpMem:DWORD
Local hDC :HDC
Local TextSize :_SIZE
Local bux :DWORD
Local buy :DWORD
Local Rect :RECT
MOV ESI,lpMem
.If [ESI].CONTROLDATA.hFont
Invoke GetDC,NULL
MOV hDC,EAX
Invoke SelectObject,hDC,[ESI].CONTROLDATA.hFont
PUSH EAX ;OldFont
Invoke GetTextExtentPoint32,hDC,Offset szAllAlphaNumeric,52,ADDR TextSize
M2M buy,TextSize.y
Invoke MulDiv,TextSize.x,1,52;4
MOV bux,EAX
POP EAX
Invoke SelectObject,hDC,EAX
Invoke ReleaseDC,NULL,hDC
.Else
Invoke GetDialogBaseUnits
MOV EDX,EAX
AND EAX,0FFFFh
MOV bux,EAX
SHR EDX,16
MOV buy,EDX
.EndIf
.If [ESI].CONTROLDATA.ntype==0
MOV EDX,[ESI].CONTROLDATA.Style
MOV EAX,[ESI].CONTROLDATA.Style
; AND EAX,(WS_POPUP OR WS_CHILD)
; .If !EAX
; OR EDX,WS_CAPTION ;(Thanks IanB)
; .Else
; MOV EAX,[ESI].CONTROLDATA.Style
AND EAX,DS_CONTROL
.If EAX
AND EDX,-1 XOR WS_CAPTION
.EndIf
; .EndIf
MOV Rect.left,0
MOV Rect.top,0
MOV Rect.right,0
MOV Rect.bottom,0
; LEA EAX,[ESI].CONTROLDATA.MenuID
MOV ECX,FALSE
; .If BYTE PTR [EAX]
; MOV ECX,TRUE
; .EndIf
Invoke AdjustWindowRectEx,ADDR Rect,EDX,ECX,[ESI].CONTROLDATA.ExStyle
MOV EAX,Rect.bottom
SUB EAX,Rect.top ;These are pixels
SUB [ESI].CONTROLDATA.duccy,EAX ;These are pixels
MOV EAX,Rect.right
SUB EAX,Rect.left ;These are pixels
SUB [ESI].CONTROLDATA.duccx,EAX ;These are pixels
.EndIf
;Convert them to Dialog Units
Invoke MulDiv,[ESI].CONTROLDATA.duy,8,buy
MOV [ESI].CONTROLDATA.duy,EAX
Invoke MulDiv,[ESI].CONTROLDATA.duccy,8,buy
MOV [ESI].CONTROLDATA.duccy,EAX
Invoke MulDiv,[ESI].CONTROLDATA.duccx,4,bux
MOV [ESI].CONTROLDATA.duccx,EAX
Invoke MulDiv,[ESI].CONTROLDATA.dux,4,bux
MOV [ESI].CONTROLDATA.dux,EAX
RET
ConvertToDialogUnits EndP
ConvertToPixels Proc Uses ESI lpMem:DWORD
Local hDC :HDC
Local TextSize :_SIZE
Local bux :DWORD
Local buy :DWORD
Local Rect :RECT
MOV ESI,lpMem
.If [ESI].CONTROLDATA.hFont
Invoke GetDC,NULL
MOV hDC,EAX
Invoke SelectObject,hDC,[ESI].CONTROLDATA.hFont
PUSH EAX ;OldFont
Invoke GetTextExtentPoint32,hDC,Offset szAllAlphaNumeric,52,ADDR TextSize
M2M buy,TextSize.y
Invoke MulDiv,TextSize.x,1,52;54
MOV bux,EAX
POP EAX
Invoke SelectObject,hDC,EAX
Invoke ReleaseDC,NULL,hDC
.Else
Invoke GetDialogBaseUnits
MOV EDX,EAX
AND EAX,0FFFFh
MOV bux,EAX
SHR EDX,16
MOV buy,EDX
.EndIf
;PrintDec bux
;MOV EAX,[ESI].CONTROLDATA.ccx
;PrintDec eax
Invoke MulDiv,[ESI].CONTROLDATA.y,buy,8
MOV [ESI].CONTROLDATA.y,EAX
Invoke MulDiv,[ESI].CONTROLDATA.ccy,buy,8
MOV [ESI].CONTROLDATA.ccy,EAX
Invoke MulDiv,[ESI].CONTROLDATA.ccx,bux,4
MOV [ESI].CONTROLDATA.ccx,EAX
;PrintDec eax
Invoke MulDiv,[ESI].CONTROLDATA.x,bux,4
MOV [ESI].CONTROLDATA.x,EAX
.If [ESI].CONTROLDATA.ntype==0
MOV EDX,[ESI].CONTROLDATA.Style
MOV EAX,[ESI].CONTROLDATA.Style
; AND EAX,(WS_POPUP OR WS_CHILD)
; .If !EAX
; OR EDX,WS_CAPTION ;(Thanks IanB)
; .Else
; MOV EAX,[ESI].CONTROLDATA.Style
AND EAX,DS_CONTROL
.If EAX
AND EDX,-1 XOR WS_CAPTION
.EndIf
; .EndIf
MOV Rect.left,0
MOV Rect.top,0
MOV Rect.right,0
MOV Rect.bottom,0
; LEA EAX,[ESI].CONTROLDATA.MenuID
MOV ECX,FALSE
; .If BYTE PTR [EAX]
; MOV ECX,TRUE
; .EndIf
Invoke AdjustWindowRectEx,ADDR Rect,EDX,ECX,[ESI].CONTROLDATA.ExStyle
MOV EAX,Rect.bottom
SUB EAX,Rect.top
ADD [ESI].CONTROLDATA.ccy,EAX
MOV EAX,Rect.right
SUB EAX,Rect.left
ADD [ESI].CONTROLDATA.ccx,EAX
.EndIf
RET
ConvertToPixels EndP
PrepareAndConvertToPixels Proc Uses EDI lpWindowData:DWORD
MOV EDI,lpWindowData
M2M [EDI].CONTROLDATA.x,[EDI].CONTROLDATA.dux
M2M [EDI].CONTROLDATA.y,[EDI].CONTROLDATA.duy
M2M [EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.duccx
M2M [EDI].CONTROLDATA.ccy,[EDI].CONTROLDATA.duccy
Invoke ConvertToPixels,EDI
;|| [EDI].CONTROLDATA.ntype==15
.If [EDI].CONTROLDATA.ntype==3 || [EDI].CONTROLDATA.ntype==21 || [EDI].CONTROLDATA.ntype==22 || [EDI].CONTROLDATA.ntype==23 || [EDI].CONTROLDATA.ntype==24;i.e. GroupBox,image,shape
Invoke MoveWindow,[EDI].CONTROLDATA.hChild,0,0,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,TRUE
Invoke InvalidateRect,[EDI].CONTROLDATA.hWnd,NULL,TRUE
; .ElseIf [EDI].CONTROLDATA.ntype==15 ;Rebar
; Invoke SetWindowPos,[EDI].CONTROLDATA.hChild,0,[EDI].CONTROLDATA.x,[EDI].CONTROLDATA.y,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,SWP_SHOWWINDOW
; Invoke InvalidateRect,[EDI].CONTROLDATA.hWnd,NULL,TRUE
.EndIf
RET
PrepareAndConvertToPixels EndP
PrepareAndConvertToDialogUnits Proc Uses EDI lpWindowData:DWORD
Local rbi :REBARBANDINFO
MOV EDI,lpWindowData
M2M [EDI].CONTROLDATA.dux,[EDI].CONTROLDATA.x
M2M [EDI].CONTROLDATA.duy,[EDI].CONTROLDATA.y
M2M [EDI].CONTROLDATA.duccx,[EDI].CONTROLDATA.ccx
M2M [EDI].CONTROLDATA.duccy,[EDI].CONTROLDATA.ccy
Invoke ConvertToDialogUnits,EDI
.If [EDI].CONTROLDATA.ntype==3 || [EDI].CONTROLDATA.ntype==21 || [EDI].CONTROLDATA.ntype==22 || [EDI].CONTROLDATA.ntype==23 || [EDI].CONTROLDATA.ntype==24;i.e. GroupBox,image,shape
Invoke MoveWindow,[EDI].CONTROLDATA.hChild,0,0,[EDI].CONTROLDATA.ccx,[EDI].CONTROLDATA.ccy,TRUE
Invoke InvalidateRect,[EDI].CONTROLDATA.hWnd,NULL,TRUE
.ElseIf [EDI].CONTROLDATA.ntype==15
MOV rbi.cbSize, SizeOf REBARBANDINFO
MOV rbi.fMask,RBBIM_STYLE or RBBIM_CHILD or RBBIM_SIZE or RBBIM_CHILDSIZE
MOV rbi.fStyle,RBBS_GRIPPERALWAYS or RBBS_CHILDEDGE
MOV EAX,[EDI].CONTROLDATA.ccx
MOV rbi.lx,EAX
MOV EAX,[EDI].CONTROLDATA.ccx
MOV rbi.cxMinChild,EAX
MOV EAX,[EDI].CONTROLDATA.ccy
MOV rbi.cyMinChild,EAX
MOV EAX,[EDI].CONTROLDATA.hChild
MOV rbi.hwndChild,EAX
Invoke SendMessage,[EDI].CONTROLDATA.hWnd,RB_SETBANDINFO,0,ADDR rbi
.EndIf
RET
PrepareAndConvertToDialogUnits EndP
MultiAlignLefts Proc Uses EDI lpWindowData:DWORD, hFirstStatic:DWORD
MOV EDI,lpWindowData
.If !hFirstStatic
PUSH [EDI].CONTROLDATA.x
POP xLeft
.Else
PUSH xLeft
POP [EDI].CONTROLDATA.x
Invoke SetWindowPos,[EDI].CONTROLDATA.hWnd,0,[EDI].CONTROLDATA.x,[EDI].CONTROLDATA.y,0,0,SWP_NOSIZE or SWP_NOZORDER or SWP_NOOWNERZORDER
Invoke PrepareAndConvertToDialogUnits,EDI