Re: Is there any way to stop Window-Resize Animation for my Form only ?
you could use LockWindowUpdate I doubt it'll give you the final look you want, but it might go a smidging towards it.
Perhaps instead of removing the titlebar/borders etc, you could subclass the WM_GETMAXMININFO message and position the window with a negative Left and Top properties depending on the GetSystemMetrics values
Re: Is there any way to stop Window-Resize Animation for my Form only ?
ok, i've managed to find a solution.
Subclassing WM_GETMINMAXINFO turned out not to work because you could set the max X < 0 or the max Y < 0 but not both at the same time (useful).
Instead you can set the dimensions of what the window should look like when in a Normal state even when it's in a Maximized state, so it doesn't return to it's previous size it returns to one you set, which in this case will be exactly the same as the dimensions for maximized:
VB Code:
Option Explicit
Private Declare Function GetWindowPlacement Lib "user32" (ByVal hwnd As Long, lpwndpl As WINDOWPLACEMENT) As Long
Private Declare Function SetWindowPlacement Lib "user32" (ByVal hwnd As Long, lpwndpl As WINDOWPLACEMENT) As Long
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
obviously you'd have to add a variable that remembers what its true Normal position is for when you want to change back, but SetWindowPlacement and GetWindowPlacement provide the solution you need
Re: Is there any way to stop Window-Resize Animation for my Form only ?
The code I supplied was meant to go with your previous code
so if you're window is Maximized and you want it to go to fullscreen then call CreateMaximizedLook and then continue with the stuff you were doing before.
Re: Is there any way to stop Window-Resize Animation for my Form only ?
OK. I tried your code. But it still animates when goes to fullscreen mode from maximized mode. Also, I need to go to fullscreenmode directly from normal mode too.
I tried your original idea (LockWindowUpdate). It works perfectly in normal-to-fullscreen mode, but doesn't work in maximized-to-fullscreen mode.
VB Code:
Option Explicit
Private Declare Function LockWindowUpdate Lib "user32" _
(ByVal hwndLock As Long) As Long
Private Type MyRECT
Left As Long
Top As Long
Width As Long
Height As Long
End Type
Private bFullScreen As Boolean
Private m_NormalState As MyRECT
Private LastState As VBRUN.FormWindowStateConstants
Private Sub Command1_Click()
If Not bFullScreen Then
bFullScreen = True
LastState = Me.WindowState
LockWindowUpdate Me.hwnd
ShowTitlebar False, Me.hwnd
Me.WindowState = vbNormal
Me.Move 0, 0, Screen.Width, Screen.Height
LockWindowUpdate 0
Else
LockWindowUpdate Me.hwnd
If LastState = vbMaximized Then
Me.WindowState = vbMaximized
Else
Me.Move m_NormalState.Left, _
m_NormalState.Top, _
m_NormalState.Width, _
m_NormalState.Height
End If
ShowTitlebar True, Me.hwnd
LockWindowUpdate 0
bFullScreen = False
End If
End Sub
Private Sub Form_Load()
LastState = vbNormal
End Sub
Private Sub Form_Resize()
If Me.WindowState = vbNormal And Not bFullScreen Then
Re: Is there any way to stop Window-Resize Animation for my Form only ?
I guess an alternative would be to create a copy your form but keep it hidden until it's in the correct position (topmost / no title / over taskbar), then just show it, and hide your original form.
Re: Is there any way to stop Window-Resize Animation for my Form only ?
That won't be possible. This application is a Text-to-Speech app (and uses a RTB).
If the control starts reading and user presses Fullscreen button, unloading the original form will stop the TTS too. Also, the new fullscreen form will take long time to initilize the (new) audio data and RTB.
Re: Is there any way to stop Window-Resize Animation for my Form only ?
you wouldn't need to unload the original form, just hide it, but yeah, the initialization of the new form could take a while.
Perhaps you could run the two versions of the form side-by-side, and then when you switch, the speech just picks off from where the other form left off.
Re: Is there any way to stop Window-Resize Animation for my Form only ?
Originally Posted by bushmobile
you wouldn't need to unload the original form, just hide it, but yeah, the initialization of the new form could take a while.
Perhaps you could run the two versions of the form side-by-side, and then when you switch, the speech just picks off from where the other form left off.
Sounds like a good idea. That way the TTS engine will not need to me initialized again.
The only problems that may occur is, the new RTB will take long time to initialize.
Re: XVoice.dll:
This program uses Microsoft Speech API 4. You'll need to download SAPI4 engine. http://www.microsoft.com/speech/download/old/sdk40a.asp
I guess it comes with WinXP or later. I think only installing the engine will work.(spchapi.EXE - 848 KB)
Re: Is there any way to stop Window-Resize Animation for my Form only ?
I downloaded the engine & voices and it's now working perfectly. It's a nice program
I was a bit shocked when I saw the fullscreen animation, but then I realised you hadn't put the new stuff in
One thing I've noticed is that is doesn't pause when it reaches a vbCrLf, e.g.:
Visual Basic
Visual C++
Visual FoxPro
Visual InterDev
Visual J++
is read as if it's all one sentence.
Originally Posted by iPrank
The only problems that may occur is, the new RTB will take long time to initialize.
What would take a long time to initialize?
As the main form is reading, move the cursor on the fullscreen form. When fullscreen mode is pressed, show fullscreen, press stop on the main form, & press read from cursor on the fullscreen form. And then visa versa.
p.s. Female Whisper sounds like it comes straight out of a horror film
Re: Is there any way to stop Window-Resize Animation for my Form only ?
You should add some checking when you change the pitch and the speed. There is a max for both. The slider passed both max values with the voice of sam (didn't try any other ones).
Has someone helped you? Then you can Rate their helpful post.
Re: Is there any way to stop Window-Resize Animation for my Form only ?
Originally Posted by bushmobile
I was a bit shocked when I saw the fullscreen animation, but then I realised you hadn't put the new stuff in
Sorry. My latest code is a mess after testing all those animation codes.
One thing I've noticed is that is doesn't pause when it reaches a vbCrLf.
TTS engine doesn't pause in CrLf. It pauses on punctuation marks. I'll add this feature if you like.
What would take a long time to initialize?
If the text in RTB is long, it will take very long time to update. As my app can save last reading paused position and can resume from that position when you restart the app. I expect my users will paste long texts.
I'm planning to add HTML support. Then it may take even longer if the pageis image intensive.
As the main form is reading, move the cursor on the fullscreen form. When fullscreen mode is pressed, show fullscreen, press stop on the main form, & press read from cursor on the fullscreen form. And then visa versa.
That will cause the TTS engine in fullscreen form to initilize. Takes very long time on longet text.
I'm planning to add the TTS engine in only main form.
When user presses fullscreen, the TTS will be paused. (quick)
Then copy rtf from main form to the fullscreen form. (will take time)
Hide the main form, show the fullscreen form.
Resume TTS and highlight RTB in fullscreen form.
p.s. Female Whisper sounds like it comes straight out of a horror film
I find it very $esy.
Originally Posted by manavo11
You should add some checking when you change the pitch and the speed. There is a max for both. The slider passed both max values with the voice of sam (didn't try any other ones).
Thanks. I had tested it only with Mary. I'll try to kill the bug.
Re: Is there any way to stop Window-Resize Animation for my Form only ?
That will cause the TTS engine in fullscreen form to initilize. Takes very long time on longet text.
I'm planning to add the TTS engine in only main form.
When user presses fullscreen, the TTS will be paused. (quick)
Then copy rtf from main form to the fullscreen form. (will take time)
Hide the main form, show the fullscreen form.
Resume TTS and highlight RTB in fullscreen form.
oh well, i didn't think it'd be a particularly practical idea when i came up with it anyway.