--/begin part of the code/--
Dim dblReturnValue As Double
.
.
dblReturnValue = Shell("C:\dbwin32\dbwin32.exe", 1) ' Start DBWIN32
(wait for the next day for filling the dbwin32 log)
AppActivate dblReturnValue ' Activate DBWIN32
Debug Messages
Delay 1
SendKeys "%F", True ' Alt-F (File) ' Save the log to
file
Delay 1
SendKeys "S", True ' S (Save as)
Delay 1
.
--/end part of the code/--
When dbwin32 is running (normal window) it's working fine, but when
minimized it's not.
Question : How can i check (or even better make) the dbwin32 window Normal
or Maximized ?
Many thanks in advance,
Leo van de Kallen
l.g.w.van...@kpn.com
Two methods to change the windowstate:
1) VB:
AppActivate dblReturnValue
SendKeys "% R" '[Alt+space], R(estore)
2) Api:
Dim hwnd As Long
'Find the hwnd...
hwnd = FindWindow("window_classname_here", "window_caption_here")
If hwnd <> 0 Then
ShowWindow hwnd, SW_RESTORE
End If
-Tom
MVP - Visual Basic
(please post replies to the newsgroup)
For the solution (vb) you have given me
I've tried that method and it works (almost).
After the window is back from being minimized to normal, its not listening
to any further SendKeys i'd giving him.
Even if i do another AppActivate after it.
So i'm a step forward, but not at the end yet.
For the other solution (Api)
I need some help with "window_classname", "window_caption"
Was hoping for a example here, i only have "dblReturnValue"
Hope you can help me
Greetings
Leo van der Kallen
"Tom Esh" <tjeshGi...@earthlink.net> wrote in message
news:87jlgvcenlln9in9b...@4ax.com...
>For the solution (vb) you have given me
>I've tried that method and it works (almost).
>After the window is back from being minimized to normal, its not listening
>to any further SendKeys i'd giving him.
>Even if i do another AppActivate after it.
>So i'm a step forward, but not at the end yet.
So it's not responding even if it's the active (foreground) window? I
dunno ...that's just weird. Maybe try SetForegroundWindow after
restoring it.
>For the other solution (Api)
>I need some help with "window_classname", "window_caption"
>Was hoping for a example here, i only have "dblReturnValue"
Both those args would be specific to the window of the app you're
launching. The caption arg would be the titlebar text. You can obtain
it's classname from a running instance of the app with the Spy++
utitlity. If either one is sufficiently unique to identify the window,
you can tell the function to ignore the other arg by passing
vbNullString.
'-----------
lHandle = FindWindow(vbNullString, "Debug Messages (WIN32)")
If lHandle <> 0 Then
ShowWindow lHandle, SW_SHOWNORMAL ' SW_RESTORE
Else
MsgBox Prog_Naam & ", is not running !!", vbCritical
End
End If
SetForegroundWindow (lHandle)
' AppActivate dblReturnValue ' Activate DBWIN32
Delay 1
SendKeys "%F", True ' Alt-F (File)
.
.
.
'-----------
Many thanks,
Leo