c0ldfyr3
asked on
EM_GETEVENTMASK and WM_SETREDRAW on a Visual Basic 6 form not working.
Howdy folks,
I've been trying to stop a form from updating while it loads and filters a set of record sets.
The code I'm using is as follows...
Dim iEventMask as Integer
iEventMask = SendMessage(frmGeneric.hwn d, EM_GETEVENTMASK, 0, 0&)
Call SendMessage(frmGeneric.hwn d, WM_SETREDRAW, 0, 0&)
'DO STUFF
Call SendMessage(frmGeneric.hwn d, EM_SETEVENTMASK, 0, iEventMask)
Call SendMessage(frmGeneric.hwn d, WM_SETREDRAW, 1, 0&)
All of my declarations are correct, I tried using the last param of SendMessage as both Long and Any and both have the same results which are iEventMask being 0 after the get and the form not re-painting after the last statement. The only way I can refresh it is by dragging it off the screen and back on again. frmGeneric.Refresh doesn't work.
Any help would be gratefully appreciated!
I've been trying to stop a form from updating while it loads and filters a set of record sets.
The code I'm using is as follows...
Dim iEventMask as Integer
iEventMask = SendMessage(frmGeneric.hwn
Call SendMessage(frmGeneric.hwn
'DO STUFF
Call SendMessage(frmGeneric.hwn
Call SendMessage(frmGeneric.hwn
All of my declarations are correct, I tried using the last param of SendMessage as both Long and Any and both have the same results which are iEventMask being 0 after the get and the form not re-painting after the last statement. The only way I can refresh it is by dragging it off the screen and back on again. frmGeneric.Refresh doesn't work.
Any help would be gratefully appreciated!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I found this http://www.vbaccelerator.com/home/vb/Tips/Force_An_Area_of_a_Window_To_Repaint/article.asp
So I called RepaintWindow frmGenric after I unsuccesfully set redraw 1 and it still doesn't repaint it >.<
So I called RepaintWindow frmGenric after I unsuccesfully set redraw 1 and it still doesn't repaint it >.<
ASKER
Thanks Idle_Mind, worked like a charm :)
But if you are using the API, I'd suggest you try using InvalidateRect to ask windows to repaint the form.