|
-
Apr 5th, 2002, 03:41 PM
#1
Thread Starter
Member
VB Shell Command: Position Window?
I am firing up a small exe file from within my VB application.
The Shell command works just fine.
However, it does not allow me to *position* the exe on my screen. I would like to pass it parameters, like an x/y position, etc..
Anyone have any ideas on how to do this?
Thanks
diver
-
Apr 5th, 2002, 06:32 PM
#2
Frenzied Member
Willing to use some API?????
Try the following...
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const HWND_DESKTOP = 0
Private Const SWP_NOSIZE = &H1
Private Declare Function GetForegroundWindow Lib "user32" () As Long
'Right After Shell command write the following..
Dim tHwnd As Long
tHwnd = GetForegroundWindow
SetWindowPos tHwnd, HWND_DESKTOP, 200, 200, 0, 0, SWP_NOSIZE
Tell me if it does...
-
Apr 5th, 2002, 11:54 PM
#3
Thread Starter
Member
moinkahn!
Works like a charm .
Thanks a million.
The only thing I changed was the x,y coordinates,
and I made my windows HWND_TOPMOST, because I did not want the user clicking on my form and making the newly fired executable "disappear" if you know what I mean.
YOU THE MAN (API Man, that is)
Thanks
diver
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|