Sounds like a job for a Synchronization Object... Using a static variable to signify "busy" is not 100% bullet-proof (it's to do with the way that preemptive multi-tasking can perform context switches at inappropriate moments! (g)
Check out Michael Mattias' article in a recent issue of Basically Speaking... www.infoms.com ... It's worth a read.
Alternatively, get a copy of Rector/Newcomer's "Win32 Programming" which discusses Synchronization Objects in detail.
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Announcement
Collapse
No announcement yet.
Your basic question..
Collapse
X
-
I had disabled the button for a while, while it's processing, and that certainly works, but there are instances where I might have to reenable it in the middle of the transaction, ie if Cancel is pressed or something....that is my workaround but I hope to just find a way to make the button click once but not again until the file transfer is complete...
Ie I know the message is in for BN_CLICKED so I want to make it null...probably requires subclassing the thing...
Scott
------------------
Scott
mailto:[email protected][email protected]</A>
Leave a comment:
-
Scott --
What about EnableWindow GetDlgItem(hDlg, xxx), %False - for button; EnableMenuItem ... %MF_GRAYED and DrawMenuBar for menu ?
------------------
Leave a comment:
-
Guest repliedI assume that you want the pressed button to "pop up" before the sendfile function starts?
If so, maybe consider starting the SendFile function as a thread, so that execution in your message processor continues, and the button refreshes itself.
If I am on the wrong track, please excuse me!
If you need help threading, then let me know, and I'll share my limited knowledge (I know that there are plenty of other BBS'ers who know tons more than me).
Dorian.
------------------
Leave a comment:
-
Your basic question..
No pun intended
Code:Case %IDM_SEND,%IDB_SEND If IsFalse Exist(FileSpec) Then Exit Function If CbCtlMsg = %BN_CLICKED And IsFalse(g_Busy) Then SendFile FileSpec Function = 0 Exit Function
While it is processing a function (SendFile), I want any messages indicating that button/menu to vaporize, never existed, when the process is done then they must press the button again...
I know this is simple, just discarding the message is all I want to do....
Scott
-------------
Scott
mailto:[email protected][email protected]</A>Tags: None
Leave a comment: