Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default WM_SETREDRAW doesn't work unless...what?

RM Smissaert kindly replied to my recent Q of how to disable screen
updating in a TreeView:

Private Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal HWND As Long, ByVal wMsg _
As Long, ByVal wParam As Long, lParam As Any) As Long

Private Const WM_SETREDRAW = &HB

***

SendMessage TreeView1.HWND, WM_SETREDRAW, IIf(EnableTheBugger, 1, 0),
0

(The 1 and 0 in my IIf are reversed from his example, which I presume
is correct, 'cause it seems to work for me.)

But this call fails, UNLESS (I found empirically) I, like, make the
call, then show a MsgBox (which interrupts processing and "seeds" the
screen first...?) Sort of like having to turn off the pilot before
turning off your stove.

What additional API call must I make if any to make WM_SETREDRAW work?

***

Better yet, how do you do this in a native VBA way?

What I'm doing is cleaning & pruning the tree--deleting & moving
hundreds or even thousands of nodes. Each operation of which has to
wait for my ancient video card, which I inherited from Johannes
Vermeer, to repaint (in slow-to-dry Old Master oils) my screen.

Thanks much.

***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default WM_SETREDRAW doesn't work unless...what?

Try a DoEvents in a few places.
Will need a bit of experimenting.

RBS


wrote in message
...
RM Smissaert kindly replied to my recent Q of how to disable screen
updating in a TreeView:

Private Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal HWND As Long, ByVal wMsg _
As Long, ByVal wParam As Long, lParam As Any) As Long

Private Const WM_SETREDRAW = &HB

***

SendMessage TreeView1.HWND, WM_SETREDRAW, IIf(EnableTheBugger, 1, 0),
0

(The 1 and 0 in my IIf are reversed from his example, which I presume
is correct, 'cause it seems to work for me.)

But this call fails, UNLESS (I found empirically) I, like, make the
call, then show a MsgBox (which interrupts processing and "seeds" the
screen first...?) Sort of like having to turn off the pilot before
turning off your stove.

What additional API call must I make if any to make WM_SETREDRAW work?

***

Better yet, how do you do this in a native VBA way?

What I'm doing is cleaning & pruning the tree--deleting & moving
hundreds or even thousands of nodes. Each operation of which has to
wait for my ancient video card, which I inherited from Johannes
Vermeer, to repaint (in slow-to-dry Old Master oils) my screen.

Thanks much.

***


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
flash object dont work in my excel work sheet Nitn Excel Discussion (Misc queries) 0 July 4th 09 08:00 AM
HOW TO MAKE A LIST OF WORK SHEET IN WORK BOOK IN EXCEL 2007 goutam Excel Programming 1 February 1st 08 07:40 AM
If I have a work sheet protected and try to run a macro to hide rows or columns it won't work. Correct? Marc Excel Programming 2 July 12th 06 04:10 AM
Counting dates in multiple work sheets and work books Savage Excel Discussion (Misc queries) 0 December 19th 05 11:41 PM
Is there away to keep "auto save" from jumping to the first work sheet in the work book? Marc New Users to Excel 2 April 21st 05 01:27 AM


All times are GMT +1. The time now is 01:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"