|
-
Aug 31st, 2001, 07:18 AM
#1
Thread Starter
Addicted Member
Using ShellExecute (Another one for the Guru's)
I'm using ShellExecute to show the Find All dialog, which works fine.
http://support.microsoft.com/support...n_SRCH&SPR=VBB
The problem is getting a window handle to the Find All dialog I've just displayed.
Say I already have 2 Find All dialogs open and I call ShellExecute to display another, how do I get the window handle to the Find All dialog I've just displayed.
I can't use FindWindowEx because the window caption will be the same for all the Find All dialogs.
It says on www.vbapi.com that ShellExecute should return the window handle, but I keep getting 33 returned when I run it in Windows 2000 and 123 when I run it in Windows 95.
How do I get the correct window handle?
Thanks in advanced
-
Aug 31st, 2001, 11:28 AM
#2
Frenzied Member
That information is incorrect. According to MSDN, the return code will be > 32 if success, <32 if failed. There is no way to get the window handle.
-
Aug 31st, 2001, 08:40 PM
#3
Goto www.vbapi.com
Look up ShellExecuteEx.
It returns, among other things, the hWnd of the window created.
-
Sep 2nd, 2001, 09:24 AM
#4
Registered User
-
Sep 3rd, 2001, 09:34 AM
#5
Frenzied Member
hey
Try using CreateProcessA function it returns handles to both the process, and the thread that is subsequently created in the PROCESS_INFORMATION structure.
It also allows you to specify priority such as REALTIME_PRIORITY_CLASS [bad idea, btw!]
This function is far superior to Shell, ShellExecute etc. You may also find CreateProcessAsUser which is even better .. .
Hope this helps
-
Sep 3rd, 2001, 09:57 AM
#6
Thread Starter
Addicted Member
How do you display the Windows Find All Files dialog using CreateProcessA yrwyddfa?
-
Sep 3rd, 2001, 10:14 AM
#7
Frenzied Member
ah.
good point - I will try to find out . . .
How do you do it with ShellExecute?
-
Sep 3rd, 2001, 10:17 AM
#8
Fanatic Member
Shellexecute has a special adjuster for the find dialog, i.e.
Code:
Call ShellExecute(Me.hwnd, _
"find", _
StrPtr("C:,D:" & vbNullChar), _
vbNullString, _
vbNullString, _
SW_SHOWNORMAL)
so if you can do this with CreateProcess i'll be quite moved...
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Sep 3rd, 2001, 12:23 PM
#9
Frenzied Member
Explorer
Find All Files dialogue seems to be driven from Windows Explorer:
explorer.exe /e,/C:
But I can't find the switch for the dialogue - I will keep looking though.
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
|