Access Violation while trying to code-complete (with patch)


<h3><details><summary>Original Reporter info from Mantis: <small>alexionne</small></summary><small>

- **Reporter name:** Aleksa Todorovic
</small></details></h3>

## Description:

I get AV when I try to code complete in my project. Unfortunately, I am not able to reproduce the problem with small project, but here is stack trace of exception.

```
#0 TSYNBASECOMPLETIONFORM__DOONRESIZE(0x97eb920) at syncompletion.pas:841
#1 TCONTROL__RESIZE(0x97eb920) at .\include\control.inc:2986
#2 TWINCONTROL__INITIALIZEWND(0x97eb920) at .\include\wincontrol.inc:7176
#3 TCUSTOMFORM__INITIALIZEWND(0x97eb920) at .\include\customform.inc:926
#4 TWINCONTROL__CREATEWND(0x97eb920) at .\include\wincontrol.inc:7054
#5 TSCROLLINGWINCONTROL__CREATEWND(0x97eb920) at .\include\scrollingwincontrol.inc:32
#6 TCUSTOMFORM__CREATEWND(0x97eb920) at .\include\customform.inc:2134
#7 TFORM__CREATEWND(0x97eb920) at .\include\customform.inc:2535
#8 TWINCONTROL__CREATEHANDLE(0x97eb920) at .\include\wincontrol.inc:6934
#9 TWINCONTROL__HANDLENEEDED(0x97eb920) at .\include\wincontrol.inc:7412
#10 TWINCONTROL__GETHANDLE(0x97eb920) at .\include\wincontrol.inc:6222
#11 TWINCONTROL__GETDEVICECONTEXT(0, 0x97eb920) at .\include\wincontrol.inc:7821
#12 TCONTROLCANVAS__CREATEHANDLE(0x8dbbd98) at .\include\controlcanvas.inc:90
#13 TCANVAS__REQUIREDSTATE([CSHANDLEVALID..CSBRUSHVALID], 0x8dbbd98) at .\include\canvas.inc:1550
#14 TCANVAS__GETHANDLE(0x8dbbd98) at .\include\canvas.inc:1450
#15 TSYNBASECOMPLETIONFORM__FONTCHANGED(0x7918dd0, 0x97eb920) at syncompletion.pas:862
#16 TSYNBASECOMPLETIONFORM__CREATE(0x9319118, 0xc6b968, 0x97eb920) at syncompletion.pas:426
#17 TSYNBASECOMPLETION__CREATE(0x7452688, 0x0, 0x9319118) at syncompletion.pas:927
#18 TSYNCOMPLETION__CREATE(0x7452688, 0xc6c36c, 0x9319118) at syncompletion.pas:1390
#19 TSOURCENOTEBOOK__CREATECOMPLETIONFORM(0x7452688) at sourceeditor.pp:3732
#20 TSOURCEEDITOR__STARTIDENTCOMPLETIONBOX(true, 0x787f360) at sourceeditor.pp:2806
#21 TSOURCEEDITOR__PROCESSUSERCOMMAND(0x91a1088, 1103, '', 0x0, 0x787f360) at sourceeditor.pp:1729
#22 TCUSTOMSYNEDIT__DOONPROCESSCOMMAND(1103, '', 0x0, 0x91a1088) at synedit.pp:6294
#23 TCUSTOMSYNEDIT__COMMANDPROCESSOR(1103, '', 0x0, 0x91a1088) at synedit.pp:5662
#24 TCUSTOMSYNEDIT__KEYDOWN(0, [SSCTRL], 0x91a1088) at synedit.pp:2234
#25 TWINCONTROL__KEYDOWNBEFOREINTERFACE(0, [SSCTRL], 0x91a1088) at .\include\wincontrol.inc:5364
#26 TWINCONTROL__DOKEYDOWNBEFOREINTERFACE({MSG = 48384, CHARCODE = 0, UNUSED = 1792, KEYDATA = 3735553, RESULT = 0}, 0x91a1088) at .\include\wincontrol.inc:5501
#27 TWINCONTROL__CNKEYDOWN({MSG = 48384, CHARCODE = 0, UNUSED = 1792, KEYDATA = 3735553, RESULT = 0}, 0x91a1088) at .\include\wincontrol.inc:6691
#28 SYSTEM_TOBJECT_$__DISPATCH$formal at :0
#29 TWINCONTROL__WMSIZE({MSG = 48384, SIZETYPE = 117440512, WIDTH = 1, HEIGHT = 57, RESULT = 0}, 0x91a1088) at .\include\wincontrol.inc:6679
#30 TWINCONTROL__WNDPROC({MSG = 48384, WPARAM = 117440512, LPARAM = 3735553, RESULT = 0, WPARAMLO = 0, WPARAMHI = 1792, LPARAMLO = 1, LPARAMHI = 57, RESULTLO = 0, RESULTHI = 0}, 0x91a1088) at .\include\wincontrol.inc:5130
#31 TCUSTOMSYNEDIT__WNDPROC({MSG = 48384, WPARAM = 117440512, LPARAM = 3735553, RESULT = 0, WPARAMLO = 0, WPARAMHI = 1792, LPARAMLO = 1, LPARAMHI = 57, RESULTLO = 0, RESULTHI = 0}, 0x91a1088) at synedit.pp:5223
#32 DELIVERMESSAGE(0x91a1088, void) at lclmessageglue.pas:111
#33 WINDOWPROC(11209350, 256, 32, 3735553) at win32callback.inc:2417
```

## Mantis conversion info:

- **Mantis ID:** 15964
- **OS:** XP
- **Platform:** Windows
- **Version:** 0.9.29 (SVN)
- **Fixed in version:** 0.9.29 (SVN)
- **Fixed in revision:** 23948 (#2749b31b1e013f4ccd69fbeabfe935ba68dd1d17)
- **Target version:** 0.9.30

Story points: 200.0